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 |
---|---|---|---|---|---|---|
Retrieve the auhtor for the given ID. | public function show($id)
{
if(empty(Author::find($id))) {
return response()->json(['error' => 'Author does not exist'], 404);
}
return response()->json(Author::find($id), 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function get_organization($id) {\n global $wpdb;\n return $wpdb->get_row(\n $wpdb->prepare('SELECT * FROM ai_organization WHERE id = %d', $id)\n );\n }",
"public function obtener($id)\n {\n $this->db->join('Usuarios','Usuarios.u_id=Areas.a_director');\n $this->db->where('a_id',(int)$id);\n return $this->db->get('Areas')->row();\n }",
"function get_aula ($id_aula){\n $sql=\"SELECT nombre \n FROM aula \n WHERE id_aula=$id_aula\";\n $aula=toba::db('gestion_aulas')->consultar($sql);\n \n return ($aula[0]['nombre']);\n }",
"public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}",
"public function getUser($id);",
"public function userAuthByAuthID($id=NULL) {\n\t\t$authManager = new UserAuthManager();\n\t\treturn $this->userauth($authManager->getUserIDFromAuthID($id));\n\t}",
"public function user()\n {\n if (!is_null($this->user)) {\n return $this->user;\n }\n $user = null;\n try {\n $resourceId = Authorizer::getResourceOwnerId();\n $resourceType = Authorizer::getResourceOwnerType();\n } catch (\\Exception $e) {\n $resourceId = null;\n $resourceType = null;\n // throw $e;\n }\n if ($resourceType !== $this->id) {\n return null;\n }\n if (!empty($resourceId)) {\n $user = $this->getProvider()->retrieveById($resourceId);\n }\n return $this->user = $user;\n\n }",
"public function getUser($id = null);",
"public static function getByUser($id)\n\t{\n\t\treturn new ACL('tl_user', $id);\n\t}",
"function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}",
"function getbyid($id){\n\t\t$this->db->where ('id', $id, \"=\");\n\t\t$res = $this->db->getOne('admin');\n\t\treturn $res;\n\t}",
"public function getUser($id){\n $user = Api::get($this->getSlug());\n \n if($user){\n return $user;\n }\n\n return 'error';\n\n }",
"public function getAnuncio($id){\n $query = \"SELECT fa.idUser, fa.idAnuncio, fa.fecha, fa.precio, fa.titulo, fa.descripcion, \n fa.localizacion, fa.telefono, fa.estado, fa.idComprador, fu.nick, fu.name \n FROM final_anuncio fa INNER JOIN final_usuario fu USING(idUser) WHERE idAnuncio='\".$id.\"'\";\n return $this->con->action($query);\n }",
"public function getAdmin($id)\n {\n return $this->user->where('salon_id',$id)->first();\n }",
"public function show($id)\n {\n //\n // $UuDai = UuDai::where('MaUuDai', $id)->first();\n $UuDai = UuDai::find($id);\n return $UuDai;\n }",
"public static function getUser($id)\n {\n $user = DB::table('users')->join('auth_levels', 'users.auth_id', '=', 'auth_levels.auth_id')\n ->select('users.*', 'auth_levels.auth_name')\n ->where('users.id', '=', $id)\n ->first();\n return $user;\n }",
"public function show($id)\n {\n //\n $universidade = Universidades::findOrfail($id);\n return new UniversidadesResource($universidade);\n }",
"function user(string $id): ?MJKMH_User {\r\n\t\treturn isset($this->users[$id]) ? $this->users[$id] : null;\r\n\t}",
"public function getUser( $id)\n\t{\n\t\n\t\t$user=$this->collection->findOne(array('_id'=> new MongoId($id)));\n\n\t\treturn $user;\n\t}",
"public function getAwrId()\n {\n return $this->awr_id;\n }",
"public function show($id)\n {\n return User::where('role','Organizer')->findOrFail($id);\n }",
"public function getEventOwnerUser($id)\n {\n $user = User::findOrFail($id);\n if(count($user) > 0){\n\n return $user;\n\n }else{\n\n return false;\n }\n\n }",
"function getAccessEntry($id);",
"public function getItem( int $id ) {\n\t\treturn User::where( 'id', $id )->first();\n\t}",
"public function getUserById($id)\n\t{\n\t\t$sql = 'SELECT * FROM admins WHERE id=:id';\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute([':id' => $id]);\n\t\treturn $query->fetch(PDO::FETCH_OBJ);\n\t}",
"public function findOne($id)\n {\n return $this->findItem('users',$id);\n }",
"public function get( $id ){}",
"public function getById() {}",
"public function getOne($id)\n {\n return $this->user->find($id);\n }",
"public function owner($id = null)\n {\n\n if ($id) {\n return $this->followLink('m_role_created');\n } else {\n return $this->m_role_created;\n }\n\n }",
"public function getUser($id) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t$db->vars['id'] = $id;\n\t\t$user = $db->select(\"SELECT u.*, c.name AS country, c.code AS country_code, cd.code AS delivery_country_code, cd.name AS delivery_country\n\t\t\t\t\t\t\t\tFROM users AS u\n\t\t\t\t\t\t\t\tLEFT JOIN z_data_iso3166_countries AS c ON u.country = c.code\n\t\t\t\t\t\t\t\tLEFT JOIN z_data_iso3166_countries AS cd ON u.delivery_country = cd.code\n\t\t\t\t\t\t\t\tWHERE id=:id\");\n\t\t\n\t\treturn (count($user)) ? $user[0] : false ; \n\t}",
"public function Asesor()\n {\n return $this->hasOne('App\\UserAsesor', 'user_id', 'id');\n }",
"public function findById($id){\n $user = Admin::find($id);\n return $user;\n }",
"public function HienThiUSer($id){\n\t\treturn $this -> db -> get('b_admin');\n\t}",
"public function get($id = null)\n {\n return $id === null ? $this['user'] : $this->getUserRepository()->find($id);\n }",
"public function get( $id );",
"function get_by_id($id)\n {\n $db2 = $this->load->database('database_kedua', TRUE);\n\n $db2->where($this->id, $id);\n return $db2->get($this->table)->row();\n }",
"public function show($id)\n {\n return response()->responseUtil(User::where('id', $id)->with('authorities.types')->first(['id', 'name', 'realName', 'openId', 'nickName', 'avatarUrl', 'cellphone', 'officephone', 'regTime', 'email']));\n }",
"public function show($id)\n {\n return user::find($id);\n }",
"public function find($id)\n\t{\n\t\treturn $this->auth->findOrFail($id);\n\t}",
"public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }",
"public function user_get_by_id($id)\n {\n $query = \"SELECT *\n \t FROM \" . $this->db_table_prefix . \"users\n \t WHERE id = $id\";\n \n $result = $this->commonDatabaseAction($query);\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n// return mysql_fetch_assoc($result);\n return $this->sqlAssoc;\n }\n else\n {\n return null;\n }\n }",
"public function show($id)\n {\n return Asistencia::find($id);\n }",
"public function get(string $id);",
"public function getusuaiosById($id)\n {\n return R::load('usuarios', $id);\n }",
"function getUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$query = $this->db->get('usuarios');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}",
"public function getById( $id );",
"public function getOneEmpresa($id){\n\n \t$this->db->where($this->primary_key, $id);\n \treturn $this->db->get($this->administracao);\n }",
"public function getById($id)\n {\n $handler = new ArangoDocumentHandler($this->conn);\n return $userFromServer = $handler->get('listings', $id);\n }",
"function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n $this->db->where('username', $this->session->identity);\n return $this->db->get($this->table)->row();\n }",
"function get($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('taal');\n return $query->row();\n }",
"public function get( int $id ) : IEmployerIncentive\n {\n if ( !isset( self::DB[$id] ))\n throw new RecordNotFoundException();\n \n return self::DB[$id]; \n }",
"function getOwnerById($id)\n\t{\n\t\t$sql = \"Select * from tblowner where pkowner_id =\" .$id; // sql statement \n\t\t$result = getConn($sql);\t\t\t// execute sql statement \n\t\treturn $result;\t\t\t\t\t\t// return result from sql \n\t}",
"public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }",
"public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function getAuthIdentifier(){\n return $this->id;\n }",
"public static function getAccount ($id = null) {\n if (!$id) { \n $id = session::getUserId();\n }\n $db = new db();\n $row = $db->selectOne('account', 'id', $id);\n return $row;\n }",
"public function getUserById($id) {\n\t\t\n\t}",
"public function getUser(int $id)\n {\n $query = $this->db->prepare(\"SELECT Pseudo FROM $this->table WHERE Id LIKE :Id\");\n $query->execute([\n ':Id' => $id,\n ]);\n\n return $query->fetch(\\PDO::FETCH_ASSOC);\n }",
"public function getAuthor() {\n\t\treturn UserManager::getFromBlid($this->blid);\n\t}",
"public function getOne($id)\n\t\t{\n\t\t\treturn usersDao::instance()->getOne($id);\n\t\t}",
"public function get_user($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('users');\n \n return $query->row();\n }",
"function getArticuloByAutor( $autor_id ){\n \n if( $autor_id == NULL) return false; // no pasa id devuelve false;\n\n $sql = \"SELECT articulo.id, articulo.titulo, articulo.contenido, articulo.imagen_1, articulo.subtitulo, articulo.fecha, articulo.autor_id, autor.nombre autor, genero.nombre genero, articulo.activo \n from articulo\n inner join autor on autor_id=autor.id\n inner join genero on genero_id=genero.id WHERE articulo.autor_id = $autor_id ORDER BY `articulo`.`id` DESC\";\n \n return ejecutarConsulta($sql);\n\n }",
"protected function getAssoId()\r\n {\r\n return $this->get('asso_am.asso_selector')->getAssoId();\r\n }",
"public function getById($id) {\r\n $query = $this->db->limit(1)\r\n ->get_where(USERS, array('id' => $id));\r\n return $query->row();\r\n }",
"function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}",
"public function get_user($ID)\n {\n if(!$ID)\n return $this;\n \n $this->db->where('ID', $ID);\n $query = $this->db->get('us_user');\n \n return ($query->num_rows > 0) ? current($query->result()) : $this;\n }",
"public function get($id = null) {\n\n\t\t// get database\n\t\t$db = $this->app->database;\n\n\t\t// check if user id exists\n\t\tif (!is_null($id) && !in_array($id, $this->_queried_users) && !$db->queryResult('SELECT id FROM #__users WHERE id = '.$db->escape($id))) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$this->_queried_users[$id] = $id;\n\n\t\t// get user\n\t\t$user = $this->_call(array('JFactory', 'getUser'), array($id));\n\n\t\t// add super administrator var to user\n\t\t$user->superadmin = $this->isJoomlaSuperAdmin($user);\n\n\t\treturn $user;\n\t}",
"public function getById($id)\n {\n\n foreach ($this->users as $u) {\n if ($u['id']==$id){\n return $u;\n }\n }\n return false;\n }",
"public function getAuthorById($id) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('author', 'getById');\t\t\n\t\t$stm->execute(array(\n\t\t\t':id' => $id\n\t\t));\n\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif ($author = $stm->fetchObject()) {\n\t\t\treturn $author;\n\t\t}\t\n\t\treturn NULL;\n\t}",
"public function show($id)\n {\n return User::where('id', $id)->first();\n }",
"public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }",
"public static function mauth_find_by_id($id);",
"function get_usuario( $id ) {\n\t\t$condicion = array(\n\t\t\t'IdUsuario' => $id,\n\t\t);\n\t\t\n\t\t$consulta = $this->db->get_where( 'ab_usuarios', $condicion, 1 ); \n\t\t\n\t\treturn $consulta;\n\t}",
"public function getIdautor0()\n {\n return $this->hasOne(Autor::class, ['idautor' => 'idautor']);\n }",
"public function showArchitect($id){\n $Architect = User::find($id);\n return $Architect;\n }",
"public static function resolveId()\n\t{\n\t\treturn auth()->guard('api')->check() ? auth()->guard('api')->user()->getAuthIdentifier() : null;\n\t}",
"public function find($id)\n\t{\n // return $this->user->where('id', $id)->first();\n\t}",
"public function getAuthIdentifier()\n {\n \treturn $this->id;\n }",
"public function get_audience( $audience_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'audiences/' . abs( intval( $audience_id ) ),\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}",
"public function getFromID( $id )\n {\n // database connection and sql query\n $core = Core::dbOpen();\n $sql = \"SELECT u.*, tz.timezone FROM user u JOIN timezone tz ON u.timezoneID = tz.timezoneID WHERE u.userID = :userID\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':userID', $id);\n Core::dbClose();\n \n try\n {\n if( $stmt->execute())\n {\n $row = $stmt->fetch();\n \n $this->userID = $id;\n $this->programID = $row[\"programID\"];\n $this->typeID = $row[\"typeID\"];\n $this->firstName = $row[\"firstName\"];\n $this->lastName = $row[\"lastName\"];\n $this->email = $row[\"email\"];\n $this->timezone = $row[\"timezone\"];\n $this->timezoneID = $row[\"timezoneID\"];\n $this->hash = $row[\"hash\"];\n $this->lastLogin = $row[\"loginDate\"];\n $this->active = $row[\"active\"];\n \n return true;\n }\n } catch ( PDOException $e ) {\n echo \"Set User Information Failed!\";\n }\n\n return false;\n }"
] | [
"0.6321544",
"0.6223344",
"0.6144375",
"0.60622317",
"0.59945923",
"0.5919582",
"0.5913875",
"0.5896385",
"0.58893764",
"0.587488",
"0.5869627",
"0.58600587",
"0.58398974",
"0.5805913",
"0.57924473",
"0.57898706",
"0.5782573",
"0.57775927",
"0.576191",
"0.5742409",
"0.57362527",
"0.57353103",
"0.5733473",
"0.57325673",
"0.5726023",
"0.5722834",
"0.57175446",
"0.5717471",
"0.5714371",
"0.5711313",
"0.57104605",
"0.56881195",
"0.5687958",
"0.56849444",
"0.5671579",
"0.5659455",
"0.5653931",
"0.56456655",
"0.564471",
"0.56295735",
"0.56220686",
"0.56144905",
"0.56102794",
"0.5603554",
"0.56025434",
"0.5602483",
"0.55964994",
"0.55914086",
"0.5591343",
"0.55910164",
"0.5589774",
"0.5589768",
"0.5585874",
"0.55780095",
"0.5573513",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5567111",
"0.5563409",
"0.5562621",
"0.5561571",
"0.55609435",
"0.55603147",
"0.55586493",
"0.55564755",
"0.55528045",
"0.55488414",
"0.554759",
"0.5542904",
"0.5535522",
"0.55340165",
"0.55316657",
"0.5530422",
"0.5530279",
"0.5516912",
"0.5516665",
"0.55162996",
"0.55137837",
"0.55114794",
"0.5510437",
"0.55101466",
"0.55082",
"0.55067945",
"0.5504763"
] | 0.0 | -1 |
Store a new author. | public function store(Request $request)
{
$this->validate($request, [
'name' => 'required',
'email' => 'required|email|unique:authors',
'bio' => 'required',
]);
$author = Author::create($request->all());
return response()->json($author, 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store_new_author()\n {\n $author = $this->dispatch( new StoreAuthor( $this->authorDataFormat ) );\n $this->assertTrue( $author->exists() );\n }",
"function saveAuthorToMetadata($a_author = \"\")\n\t{\n\t\t$md =& new ilMD($this->getId(), 0, $this->getType());\n\t\t$md_life =& $md->getLifecycle();\n\t\tif (!$md_life)\n\t\t{\n\t\t\tif (strlen($a_author) == 0)\n\t\t\t{\n\t\t\t\tglobal $ilUser;\n\t\t\t\t$a_author = $ilUser->getFullname();\n\t\t\t}\n\t\t\t\n\t\t\t$md_life =& $md->addLifecycle();\n\t\t\t$md_life->save();\n\t\t\t$con =& $md_life->addContribute();\n\t\t\t$con->setRole(\"Author\");\n\t\t\t$con->save();\n\t\t\t$ent =& $con->addEntity();\n\t\t\t$ent->setEntity($a_author);\n\t\t\t$ent->save();\n\t\t}\n\t}",
"public function setAuthor($author);",
"public function store(CreateAuthorRequest $request)\n {\n return $this->service->createResource(Author::class, $request->input('data.attributes'));\n }",
"function insertAuthor(&$author) {\n\t\t$this->update(\n\t\t\t'INSERT INTO authors\n\t\t\t\t(submission_id, first_name, middle_name, last_name, country, email, url, primary_contact, seq)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, ?, ?, ?, ?, ?)',\n\t\t\tarray(\n\t\t\t\t$author->getSubmissionId(),\n\t\t\t\t$author->getFirstName(),\n\t\t\t\t$author->getMiddleName() . '', // make non-null\n\t\t\t\t$author->getLastName(),\n\t\t\t\t$author->getCountry(),\n\t\t\t\t$author->getEmail(),\n\t\t\t\t$author->getUrl(),\n\t\t\t\t(int) $author->getPrimaryContact(),\n\t\t\t\t(float) $author->getSequence()\n\t\t\t)\n\t\t);\n\n\t\t$author->setId($this->getInsertAuthorId());\n\t\t$this->updateLocaleFields($author);\n\n\t\treturn $author->getId();\n\t}",
"public function testUpdateAuthor() {\n $this->put('/api/author/3',\n ['first_name' => 'Karim'] )\n ->seeJson(['first_name' => 'Karim']);\n }",
"function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}",
"public function post_author( $author ) {\n\t\t$this->data['post_author'] = $author;\n\t}",
"public function create(StoreAuthor $request)\n {\n $author = new Author;\n $author->name = $request->name['new'];\n $author->surname = $request->surname['new'];\n $author->patronymic = $request->patronymic['new']; \n \n $author->save();\n \n $message = 'Вы успешно добавили автора';\n \n return back()->with('status', $message);\n \n $validated = $request->validated();\n }",
"protected function _syncAuthor() {}",
"public function setAuthor($author)\n {\n $this->author = $author;\n }",
"public function setAuthor($author)\n {\n $this->author = $author;\n }",
"function setAuthor($author = \"\") \n\t{\n\t\t$this->author = $author;\n\t}",
"public function setAuthor(Author $author) {\n $this->addAuthor($author);\n }",
"abstract public function setAuthor($author);",
"public function setAuthor($author) {\n $this->_author = $author;\n }",
"public function setAuthor(string $author): void\n {\n $this->_author = $author;\n }",
"public function testAddNewAuthor() {\n $this->post('/api/author',\n [\n 'first_name' => 'John',\n 'last_name' => 'Doe'\n ])\n ->seeJson(['first_name' => 'John']);\n }",
"public function store($author_id, $data){\n //dd($author_id);\n $data['user_id'] = $author_id;\n $this->validation($data);\n return \\Models\\Catalog::create($data);\n }",
"public function store(StoreAuthorRequest $request)\n {\n $author = $this->authorService->createAuthor($request->validated());\n\n return response()\n ->json([\n 'message' => 'success',\n 'data' => $author,\n ]);\n }",
"public function store(StoreAuthors $request)\n {\n $authors = User::create($request->all());\n\n $memberRole = Role::where('name','member')->first();\n $authors->attachRole($memberRole);\n\n return redirect()->route('authors.index');\n }",
"public function setAuthor($author, $encoding = 'UTF-8') {}",
"public function addAuthor($author) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('author', 'add');\n\t\t$stm->execute(array(\n\t\t\t':name' => $author->name,\n\t\t\t':url' => (!empty($author->url))?$author->url:'',\n\t\t\t':email' => (!empty($author->email))?$author->email:''\n\t\t));\n\n\t\tif ($this->_isPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t\treturn true;\n\t}",
"public function setAuthor($author) {\r\n\t\tif (t3lib_div::testInt($author)) {\r\n\t\t\t$this->data['author'] = $author;\r\n\t\t} else {\r\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'fe_users', 'username=\\'' . $author . '\\'');\r\n\t\t\tif (!empty($rows) && is_array($rows)) {\r\n\t\t\t\t$this->data['author'] = intVal($rows[0]['uid']);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|min:3|max:255'\n ]);\n \n $author = new Author;\n $author->aut_nom = $request->name;\n $author->save();\n \n Session::flash('success_message', 'Auteur ajouté !');\n return redirect()->back();\n }",
"public function setAuthor($author)\n {\n if(strlen($author) <= 50 && strlen($author) > 0 && preg_match('#^[a-zA-Z- ]*$#', $author)) {\n $this->author = $author;\n }\n }",
"public function store(AuthorRequest $request)\n {\n $validated = $request->validated();\n\n Author::create($validated);\n\n return response()->json([\"message\" => \"Tambah penulis berhasil\"], Response::HTTP_CREATED);\n }",
"public function setAuthor(UserInterface $author);",
"public function setAuthor(UserInterface $author);",
"public function store(AuthorRequest $request, Author $model)\n {\n $model->create($request->all());\n\n return redirect()->route('author.index')->withStatus(__('Autor criado com sucesso.'));\n }",
"public function author();",
"public function store(Request $request)\n {\n $newAuthor = Author::addAuthor($request->all());\n return response()->json($newAuthor, 201);\n }",
"public function setAuthor(UserInterface $author)\n {\n $this->author = $author;\n }",
"public function store(Request $request)\n {\n $cat = new authors;\n\n $cat->name = $request->name;\n\n $cat->save();\n return redirect('/home');\n }",
"public function setAuthor(\\TYPO3\\Party\\Domain\\Model\\Person $author) {\n\t\t$this->author = $author;\n\t}",
"public function addAction(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n $this->fillInAuthData($author);\n $author->setDisable(1);\n $this->authorRepository->add($author);\n $baseURL = $this->request->getBaseUri();\n $this->persistenceManager->persistAll();\n $emailConfirmationURL = $baseURL . $this->getControllerContext()->getUriBuilder()->reset()->uriFor('activate', array('author' => $author), 'Author', $this->getControllerContext()->getRequest()->getControllerExtensionName());\n\n $this->sendEmail($emailConfirmationURL);\n\n file_put_contents('./debug.txt', print_r(\"\\n-----------------\\n\", true), FILE_APPEND);\n file_put_contents('./debug.txt', print_r($emailConfirmationURL, true), FILE_APPEND);\n\n $this->redirect('list', 'Comment', NULL, NULL);\n }",
"public function store(Request $request) {\n \n \n $validator = \\Validator::make($request->all(), Author::$validation_rules);\n \n if($validator->fails())\n {\n return back()->withErrors($validator)->withInput();\n }\n\n $author = new Author();\n $author->fill($request->all());\n $author->save();\n \n return redirect('/authors');\n }",
"public function store(Request $request)\n {\n $this->author->create($request->all());\n\n return redirect()->route('admin.MediaLinkExample.author.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('medialinkexample::authors.title.authors')]));\n }",
"public function store(AuthorPostRequest $request)\n {\n $authorInput = [\n 'first_name' => $request->input('first_name'),\n 'last_name' => $request->input('last_name'),\n 'age' => $request->input('age'),\n 'address' => $request->input('address'),\n ];\n\n $booksInput = collect($request->input('books'))->map(function ($book, $key) {\n return new Book([\n 'name' => $book['name'],\n 'release_date' => $book['release_date']\n ]);\n });\n\n $author = Author::create($authorInput);\n $author->books()->saveMany($booksInput);\n $author['books'] = $author->books;\n return new AuthorResource($author);\n }",
"public function store(StoreAuthorRequest $request): JsonResponse\n {\n $author = new Author();\n $author->name = $request->name;\n $author->birth_date = Carbon::parse($request->birth_date);\n $author->genre = $request->genre;\n $author->save();\n\n return response()->json([\n 'message' => 'Author has been created.',\n 'author' => $author\n ]);\n }",
"public function store(AuthorRequest $request)\n {\n $author = ShopAuthor::create([\n 'name' => $request->input('name'),\n 'function' => $request->input('function'),\n 'description' => $request->input('description'),\n 'pic_url' => 'None',\n 'fb_link' => ($request->input('fb_link')) ? $request->input('fb_link') : null,\n 'twitter_link' => ($request->input('twitter_link')) ? $request->input('twitter_link') : null,\n 'website_link' => ($request->input('website_link')) ? $request->input('website_link') : null,\n ]);\n $author->storePicture($request);\n return response()->json([\n \"data\" =>$author\n ], 200);\n }",
"public function newAuthor(): AuthorInterface;",
"public function postAuthor() {\n $data = Request;\n //Add Author fields sent to Author Table\n //AuthorsController->AuthorsController::store($request);\n $p = sizeof($data);\n // $p = $data;\n //print_r($_POST);\n //$l = fopen('/home/sudipta/check.log','w+');\n //fwrite($l,\" SIZEOF \".$p);\n //Author::create($request);\n //AuthorsController->store($request);\n return;\n }",
"private function fillInAuthData(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n /** @var \\TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUserGroup $feUserGroup */\n $feUserGroup = ($this->settings['usergroup']) ? $this->frontendUserGroupRepository->findByUid($this->settings['usergroup']) : '';\n $userGroup = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n $author->setUsergroup($userGroup);\n $author->getUsergroup()->attach($feUserGroup);\n $this->setAuthorImage($author);\n $author->setPassword($this->getAuthorPassword($author));\n }",
"public function create(StoreAuthorPost $requst)\n {\n author::create([\n 'name'=>$requst->name,\n 'age'=>$requst->age,\n 'books'=>$requst->books\n ]);\n Session::flash('alert-success', 'User Added');\n return redirect()->route('blogs'); \n\n }",
"private function findOrCreateAuthor($author) {\n $author = strtolower($author);\n\n if (array_key_exists($author, $this->m_authors))\n return $this->m_authors[$author];\n\n if ($this->m_authorStatement === null) {\n $this->m_authorStatement = $this->database()->prepare('\n INSERT INTO\n tracking_authors\n (author_name)\n VALUES\n (?)');\n\n if ($this->m_authorStatement === false) {\n Error('RepositoryTracker: Unable to prepare a database statement for inserting authors.');\n return 0;\n }\n }\n\n $this->m_authorStatement->bind_param('s', $author);\n if ($this->m_authorStatement->execute() !== true) {\n Error('RepositoryTracker: Unable to create an author row for \"' . $author . '\".');\n return 0;\n }\n\n $authorId = $this->database()->insert_id;\n\n $this->m_authors[$author] = $authorId;\n return $authorId;\n }",
"function setAuthor($author) {\n $this->fields['author'] = $author;\n return $this;\n }",
"public function save( $autor ){\n\n $this->db->set( $this->_setAutor( $autor ) )->insert('author');\n\n // Si se ejecuta la consulta\n if($this->db->affected_rows() == 1 ){\n return $this->db->insert_id();\n } else{\n return null;\n }\n }",
"public static function store()\n {\n $user = User::getUser(Authentication::$user_email);\n Tutor::create_tutor($user->getEmail(), '', 0);\n }",
"public function create()\n {\n //\n $author = new Author();\n $author->lastname = \"Straub\";\n $author->firstname = \"Peter\";\n $author->birthday = \"1943-03-02\";\n $author->genres = \"horrory, thrillery\";\n $author->save();\n\n $authorSecond = new Author();\n $authorSecond->lastname = \"King\";\n $authorSecond->firstname = \"Stephen\";\n $authorSecond->birthday = \"1947-09-21\";\n $authorSecond->genres = \"horrory, thrilerry\";\n $authorSecond->save();\n\n $czarnyDom = Book::where('name', \"Czarny Dom\")->first();\n $czarnyDom->authors()->attach($author);\n $czarnyDom->authors()->attach($authorSecond);\n\n return redirect('books');\n\n }",
"protected function _getAuthorId($author) {\n\t\tif (!empty($author->id)) {\n\t\t\treturn $author->id;\n\t\t} else {\n\t\t\t$this->addAuthor($author);\n\t\t\t$storedAuthor = $this->getAuthor($author->name);\n\t\t\t//echo \"Stored Author: \"; print_r($storedAuthor);\n\t\t\t\n\t\t\tif (!empty($storedAuthor->id)) {\n\t\t\t\treturn $storedAuthor->id;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public function store(\n Request $request,\n \\App\\Services\\AuthorsServiceClient $authorsServiceClient\n ) {\n $authorsServiceClient->getAuthor($request->author_id);\n\n return $this->successResponse(\n $this->client->createBook($request->all()),\n Response::HTTP_CREATED\n );\n }",
"public function author()\n {\n $userId = $_post['userId'];\n $userRepository = new UserRepository();\n if (!empty($userId)) {\n $author = $userRepository->getAuthor();\n }\n }",
"public function store(Request $request) {\n\t\t$rules = [\n\t\t\t'title' => 'required|max:255',\n\t\t\t'description' => 'required|max:255',\n\t\t\t'price' => 'required|min:1',\n\t\t\t//'author_id' => 'required|min:1|unique:authors,id',\n\t\t];\n\n\t\t$author = Author::find($request->author_id);\n\n\t\tif(!$author){\n\t\t\treturn $this->errorMessage('No se encontro un instancia para el autor solicitado', Response::HTTP_NOT_FOUND);\n\t\t}\n\n\t\t$this->validate($request, $rules);\n\n\t\t$book = Book::create($request->all());\n\n\t\treturn $this->successResponse($book, Response::HTTP_CREATED);\n\t}",
"public function add_author( $data, $post ) {\n\t\tif ( $this->context->site_represents === false ) {\n\t\t\t$data['author'] = [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $post->post_author, $this->context ) ];\n\t\t}\n\t\treturn $data;\n\t}",
"function addSynonymForAuthor($author, $syn_author)\r\n {\r\n $CI = &get_instance();\r\n if ($author == null) return;\r\n if ($author->author_id==$syn_author->author_id)\r\n {\r\n appendErrorMessage(__(\"Cannot set author as synonym of itself\").'.<br/>');\r\n return;\r\n }\r\n if ($this->hasSynonyms($syn_author)) \r\n {\r\n appendErrorMessage(__(\"Cannot set author as synonym, because it already has synonyms itself\").'.<br/>');\r\n return;\r\n }\r\n if ($author->synonym_of!='0')\r\n {\r\n $this->addSynonymForAuthor($CI->author_db->getByID($author->synonym_of),$syn_author);\r\n }\r\n $syn_author->synonym_of = $author->author_id;\r\n $syn_author->update();\r\n }",
"public function store(Request $request)\n {\n if(request()->hasFile('author_image')){\n $file = request()->file('author_image');\n if($file->isValid()){\n $file_type = $file->getClientOriginalExtension();\n $file_name = date('Ymdhms').'.'.$file_type;\n $file->storeAs('author', $file_name);\n }\n }\n\n Author::insert($request->except('_token', 'author_image') + [\n 'author_slug' => Str::slug($request->author_name),\n 'author_image' => $file_name,\n 'created_at' => Carbon::now()\n ]);\n return back()->with('author_status', 'Author Added Succesfully!');\n }",
"public function newauthor( $name, $tname )\n\t{\n\t\t$sql = \"INSERT INTO \" . $this->table_prefix . \"_author ( id, ten, tenthat, thumb, introduction, numsong, numvideo) VALUES ( NULL, \" . $this->db->quote( $name ) . \", \" . $this->db->quote( $tname ) . \", '', '', 0, 0 )\";\n\n\t\t$newid = $this->db->insert_id( $sql );\n\n\t\tif( $newid )\n\t\t{\n\t\t\t$this->db->sql_freeresult();\n\t\t\t$this->del_cache( $this->mod_name );\n\t\t\treturn $newid;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function author(): User\n {\n $author = new User($this->wpPost->post_author);\n\n return $this->setAttribute(__METHOD__, $author);\n }",
"function updateAuthor(&$author) {\n\t\t$returner = $this->update(\n\t\t\t'UPDATE authors\n\t\t\tSET\tfirst_name = ?,\n\t\t\t\tmiddle_name = ?,\n\t\t\t\tlast_name = ?,\n\t\t\t\tcountry = ?,\n\t\t\t\temail = ?,\n\t\t\t\turl = ?,\n\t\t\t\tprimary_contact = ?,\n\t\t\t\tseq = ?\n\t\t\tWHERE\tauthor_id = ?',\n\t\t\tarray(\n\t\t\t\t$author->getFirstName(),\n\t\t\t\t$author->getMiddleName() . '', // make non-null\n\t\t\t\t$author->getLastName(),\n\t\t\t\t$author->getCountry(),\n\t\t\t\t$author->getEmail(),\n\t\t\t\t$author->getUrl(),\n\t\t\t\t(int) $author->getPrimaryContact(),\n\t\t\t\t(float) $author->getSequence(),\n\t\t\t\t(int) $author->getId()\n\t\t\t)\n\t\t);\n\t\t$this->updateLocaleFields($author);\n\t\treturn $returner;\n\t}",
"public function testCreateAuthorTest()\n {\n $payload = [\n 'name' => 'Author Test',\n ];\n\n $this->actingAs($this->user, 'api')->postJson('/api/authors', $payload, [])\n ->assertStatus(201)->assertJsonStructure([\n 'data' => ['id', 'name'],\n ])->assertJson([\n 'data' => [ 'name' => $payload['name'] ],\n ]);\n }",
"public function setAuthorAttribute(User $user)\n {\n $this->attributes['author_id'] = $user->id;\n }",
"public function store(Request $request)\n {\n $this->authorService->obtainAuthor($request->author_id);\n return $this->successResponse($this->bookService->createBook($request->all()));\n }",
"public function store(Request $request)\n {\n $auth_user=authSession();\n if($auth_user->is('demo_admin') || $auth_user->is('demo_admin')){\n return redirect()->back()->withSuccess(trans('messages.demo_permission_denied'));\n }\n\n if(!Auth::user()->allowedAccess(\"contributors\"))\n {\n return redirect()->back()->withErrors(trans('messages.permission_denied'));\n }\n\n $data=$request->all();\n $valid['validation'] =[\n 'name' => 'required|regex:/^[a-z0-9 .\\-]+$/i|min:2',\n 'description' => 'required',\n 'designation'=>'required',\n 'education'=>'required',\n ];\n $valid['messsage']=[];\n\n\n $validator = \\Validator::make($data,$valid['validation'],$valid['messsage']);\n\n $result = Author::updateOrCreate(['author_id'=>$request->author_id],$data);\n if($request->image) {\n $result->clearMediaCollection('image');\n $result->addMediaFromRequest('image')\n ->toMediaCollection('image');\n }\n\n $message = trans('messages.update_form',['form' => trans('messages.author')] );\n if($result->wasRecentlyCreated){\n $message = trans('messages.save_form',['form' => trans('messages.author')] );\n }\n return redirect(route('author.index'))->withSuccess($message);\n }",
"function setLastchangeAuthor($a) {\n\t\t$this->set(\"lastchangeauthor\",$a);\n\t}",
"public function addFormAction(\\Vendor\\Guestbook\\Domain\\Model\\Author $author = NULL)\n {\n $this->view->assign('author', $author);\n }",
"public function setAuthor($author) {\n $this->author = $author;\n return $this;\n }",
"public function getAuthorID();",
"public function setAuthor($author) {\n $this->properties['author'] = $author;\n\n return $this;\n }",
"public function create_author($name) {\n return random_string(20);\n }",
"public function setAuthor(?User $author): self\r\n {\r\n $this->author = $author;\r\n\r\n return $this;\r\n }",
"public function setAuthor( $mail, $name = false ) {\n\t\t$this->author = [\n\t\t\t'mail' => $mail,\n\t\t\t'name' => $name\n\t\t];\n\t}",
"public function store(Request $request)\n {\n $request->validate([\n 'nombre' => 'required|min:2',\n 'apellido' => 'required|min:2',\n 'dni' => 'required|regex:/^[0-9]{8}$/|unique:authors,dni',\n 'edad' => 'required|numeric|min:1|max:120|regex:/^[0-9]*$/',\n 'direccion' => 'required',\n 'telefono' => 'required',\n ]);\n \n Author::create($request->all());\n return redirect()\n ->route('author.index')\n ->with([\n 'message' => 'El registro se agrego satisfactoriamente!',\n ]);\n }",
"public function updateAction(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n\n $this->fillInAuthData($author);\n $this->authorRepository->update($author);\n $this->redirect('updateForm', 'Author', NULL, array('author' => $author));\n }",
"public function create()\n {\n return view('addAuthor');\n }",
"public function run()\n {\n\n author::create([\n 'name' => 'jesus',\n 'surname' => 'martinez',\n 'email' => '[email protected]',\n 'wallet' => 500,\n ]);\n\n }",
"public function getAuthorId()\n {\n return $this->_authorId;\n }",
"private function addAuthor(array $authors)\n {\n $checkSQL = \"SELECT Count(id) as 'bool' FROM authors WHERE name_author = ?\";\n $sql = \"INSERT INTO `authors` (`name_author`) VALUES (?)\";\n foreach ($authors as $author) {\n if (!$this->findBySql($checkSQL, [$author])[0]['bool']) {\n $this->findBySql($sql, [$author]);\n }\n }\n }",
"public function getAuthorId() {\n\t\treturn $this->authorId;\n\t}",
"public function is_author($author = '')\n {\n }",
"public function add_author( $data, $post ) {\n\t\t_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\\WP\\SEO\\Generators\\Schema\\WebPage::add_author' );\n\n\t\treturn $this->stable->add_author( $data, $post );\n\t}",
"public function getAuthor_id()\n {\n return $this->author_id;\n }",
"public function record(string $type, Model $subject, ?Authenticatable $author): void;",
"function saveSubmit($args, $request) {\n\t\t$step = (int) array_shift($args);\n\t\t$articleId = (int) $request->getUserVar('articleId');\n\t\t$journal =& $request->getJournal();\n\n\t\t$this->validate($request, $articleId, $step);\n\t\t$this->setupTemplate($request, true);\n\t\t$article =& $this->article;\n\n\t\t$formClass = \"AuthorSubmitStep{$step}Form\";\n\t\timport(\"classes.author.form.submit.$formClass\");\n\n\t\t$submitForm = new $formClass($article, $journal, $request);\n\t\t$submitForm->readInputData();\n\n\t\tif (!HookRegistry::call('SubmitHandler::saveSubmit', array($step, &$article, &$submitForm))) {\n\n\t\t\t// Check for any special cases before trying to save\n\t\t\tswitch ($step) {\n\t\t\t\tcase 2:\n\t\t\t\t\tif ($request->getUserVar('uploadSubmissionFile')) {\n\t\t\t\t\t\t$submitForm->uploadSubmissionFile('submissionFile');\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\tif ($request->getUserVar('addAuthor')) {\n\t\t\t\t\t\t// Add a sponsor\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t\t$authors = $submitForm->getData('authors');\n\t\t\t\t\t\tarray_push($authors, array());\n\t\t\t\t\t\t$submitForm->setData('authors', $authors);\n\n\t\t\t\t\t} else if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) {\n\t\t\t\t\t\t// Delete an author\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t\tlist($delAuthor) = array_keys($delAuthor);\n\t\t\t\t\t\t$delAuthor = (int) $delAuthor;\n\t\t\t\t\t\t$authors = $submitForm->getData('authors');\n\t\t\t\t\t\tif (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) {\n\t\t\t\t\t\t\t$deletedAuthors = explode(':', $submitForm->getData('deletedAuthors'));\n\t\t\t\t\t\t\tarray_push($deletedAuthors, $authors[$delAuthor]['authorId']);\n\t\t\t\t\t\t\t$submitForm->setData('deletedAuthors', join(':', $deletedAuthors));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray_splice($authors, $delAuthor, 1);\n\t\t\t\t\t\t$submitForm->setData('authors', $authors);\n\n\t\t\t\t\t\tif ($submitForm->getData('primaryContact') == $delAuthor) {\n\t\t\t\t\t\t\t$submitForm->setData('primaryContact', 0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ($request->getUserVar('moveAuthor')) {\n\t\t\t\t\t\t// Move an author up/down\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t\t$moveAuthorDir = $request->getUserVar('moveAuthorDir');\n\t\t\t\t\t\t$moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd';\n\t\t\t\t\t\t$moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex');\n\t\t\t\t\t\t$authors = $submitForm->getData('authors');\n\n\t\t\t\t\t\tif (!(($moveAuthorDir == 'u' && $moveAuthorIndex <= 0) || ($moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1))) {\n\t\t\t\t\t\t\t$tmpAuthor = $authors[$moveAuthorIndex];\n\t\t\t\t\t\t\t$primaryContact = $submitForm->getData('primaryContact');\n\t\t\t\t\t\t\tif ($moveAuthorDir == 'u') {\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1];\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex - 1] = $tmpAuthor;\n\t\t\t\t\t\t\t\tif ($primaryContact == $moveAuthorIndex) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex - 1);\n\t\t\t\t\t\t\t\t} else if ($primaryContact == ($moveAuthorIndex - 1)) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1];\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex + 1] = $tmpAuthor;\n\t\t\t\t\t\t\t\tif ($primaryContact == $moveAuthorIndex) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex + 1);\n\t\t\t\t\t\t\t\t} else if ($primaryContact == ($moveAuthorIndex + 1)) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex);\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$submitForm->setData('authors', $authors);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 4:\n\t\t\t\t\tif ($request->getUserVar('submitUploadSuppFile')) {\n\t\t\t\t\t\t$this->submitUploadSuppFile(array(), $request);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!isset($editData) && $submitForm->validate()) {\n\t\t\t\t$articleId = $submitForm->execute();\n\t\t\t\tHookRegistry::call('Author::SubmitHandler::saveSubmit', array(&$step, &$article, &$submitForm));\n\n\t\t\t\tif ($step == 5) {\n\t\t\t\t\t// Send a notification to associated users\n\t\t\t\t\timport('classes.notification.NotificationManager');\n\t\t\t\t\t$notificationManager = new NotificationManager();\n\t\t\t\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\n\t\t\t\t\t$article =& $articleDao->getArticle($articleId);\n\t\t\t\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t\t\t\t$notificationUsers = array();\n\t\t\t\t\t$editors = $roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getId());\n\t\t\t\t\twhile ($editor =& $editors->next()) {\n\t\t\t\t\t\t$notificationManager->createNotification(\n\t\t\t\t\t\t\t$request, $editor->getId(), NOTIFICATION_TYPE_ARTICLE_SUBMITTED,\n\t\t\t\t\t\t\t$article->getJournalId(), ASSOC_TYPE_ARTICLE, $article->getId()\n\t\t\t\t\t\t);\n\t\t\t\t\t\tunset($editor);\n\t\t\t\t\t}\n\n\t\t\t\t\t$journal =& $request->getJournal();\n\t\t\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t\t\t$templateMgr->assign_by_ref('journal', $journal);\n\t\t\t\t\t// If this is an editor and there is a\n\t\t\t\t\t// submission file, article can be expedited.\n\t\t\t\t\tif (Validation::isEditor($journal->getId()) && $article->getSubmissionFileId()) {\n\t\t\t\t\t\t$templateMgr->assign('canExpedite', true);\n\t\t\t\t\t}\n\t\t\t\t\t$templateMgr->assign('articleId', $articleId);\n\t\t\t\t\t$templateMgr->assign('helpTopicId','submission.index');\n\t\t\t\t\t$templateMgr->display('author/submit/complete.tpl');\n\n\t\t\t\t} else {\n\t\t\t\t\t$request->redirect(null, null, 'submit', $step+1, array('articleId' => $articleId));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$submitForm->display();\n\t\t\t}\n\t\t}\n\t}",
"public function setAuthor($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataform\\V1beta1\\CommitAuthor::class);\n $this->author = $var;\n\n return $this;\n }",
"function newDataObject() {\n\t\treturn new Author();\n\t}",
"public function setAuthor($author)\n {\n $this->author = $author;\n\n return $this;\n }",
"public function setAuthorId($authorId)\n {\n $this->_authorId = $authorId;\n }",
"public function setAuthors($authors)\n {\n $this->setValue('authors', $authors);\n }",
"public function addNewQuote($quote, $author) {\n\t\t\t$stmt = $this->DB->prepare ( \"INSERT INTO quotations (added, quote, author, rating, flagged ) values(now(), :quote, :author, 0, 'f')\" );\n\t\t\t$stmt->bindParam ( 'quote', $quote );\n\t\t\t$stmt->bindParam ( 'author', $author );\n\t\t\t$stmt->execute ();\n\t\t}",
"public function setAuthor(User $author): self\n {\n $this->author = $author;\n\n return $this;\n }",
"public function run()\n {\n $author = factory(\\CodeEduUser\\Models\\User::class, 1)->states('author')->create();\n $roleAuthor = \\CodeEduUser\\Models\\Role::where('name', config('codeedubook.acl.role_autor'))->first();\n $author->roles()->attach($roleAuthor);\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'name' => 'max:10|min:3',\n 'age' => 'max:10|min:1',\n 'province' => 'nullable'\n ]);\n\n $author = new Author();\n $author->name = $request->name;\n $author->age = $request->age;\n $author->province = $request->province;\n $author->save();\n\n return response()->json([\"Message\" => \"Create\", \"data\" => $author], 200);\n }",
"public function add_author_resault()\n\t{\n\t\t$this->add_author_model->addAuthor();\n\t\t$this->load->view('add_author_resault');\n\t}",
"function decorateWithAuthor($article) {\n global $authorArticleTable;\n\n createAuthorArticleTable();\n\n $article->authors = $authorArticleTable[$article->id];\n\n return $article;\n}",
"public function addAuthor()\n\t{\n\t\t$this->load->view('add_author');\n\t}",
"public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}",
"public function create_author(Request $request) {\n\t\t// check validate\n\t\t$validate = [\n\t\t\t'name' => 'required'\n\t\t];\n\t\t$this->validate($request, $validate);\n\n\t\t// upload image\n\t\t$data['image'] = $request->file('image');\n\t\t$data['name'] = $request->input('name');\n\t\t$data['path'] = '/image/authors';\n\t\tif ($data['image'] != null) {\n\t\t\tImages::upload_image($data);\n\t\t}\n\n\t\t// create author\n\t\t$author = new \\stdClass;\n\t\t$author->name = $request->input('name');\n\t\t$author->gender = $request->input('gender');\n\t\t$author->type = $request->input('type');\n\t\t$author->categories = json_decode($request->input('category'));\n\t\t$author->facebook = $request->input('facebook');\n\t\t$author->twitter = $request->input('twitter');\n\t\t$author->website = $request->input('website');\n\t\t$author->description = $request->input('description');\n\t\tif ($data['image'] == null) {\n\t\t\t$author->is_image = false;\n\t\t} else {\n\t\t\t$author->is_image = true;\n\t\t}\n\n\t\tAuthorsBModel::create_author($author);\n\n\t\treturn redirect()->back()->with('success', 'Thêm tác giả thành công');\n\t}",
"public function getAuthor();",
"public function getAuthor();"
] | [
"0.8141414",
"0.7289865",
"0.7005693",
"0.6779516",
"0.67061484",
"0.6669707",
"0.66429204",
"0.6593916",
"0.6593879",
"0.6586489",
"0.6566397",
"0.6566397",
"0.6549089",
"0.6544887",
"0.6543757",
"0.6516128",
"0.64697385",
"0.64652336",
"0.6448588",
"0.6447467",
"0.6436703",
"0.6435675",
"0.6357982",
"0.6356035",
"0.6355101",
"0.633264",
"0.6276379",
"0.6236629",
"0.6236629",
"0.6233864",
"0.62256074",
"0.6216521",
"0.6115901",
"0.61057514",
"0.6094614",
"0.6075624",
"0.6050247",
"0.6031607",
"0.60114866",
"0.59992003",
"0.59972954",
"0.5979663",
"0.5957893",
"0.59424543",
"0.5916716",
"0.59066",
"0.58945966",
"0.58938295",
"0.5881955",
"0.58743674",
"0.5853584",
"0.5840159",
"0.58294326",
"0.58091736",
"0.5793266",
"0.5754999",
"0.5752144",
"0.57441175",
"0.5731892",
"0.5718664",
"0.5699597",
"0.56641763",
"0.5661974",
"0.5643721",
"0.56423485",
"0.5641845",
"0.56415004",
"0.5639473",
"0.56212103",
"0.56209236",
"0.5610942",
"0.5588052",
"0.5586776",
"0.557934",
"0.55678684",
"0.5555288",
"0.5555149",
"0.5552657",
"0.5550003",
"0.5545334",
"0.5526399",
"0.5524543",
"0.5524444",
"0.5518926",
"0.55154186",
"0.5505636",
"0.5502404",
"0.54992014",
"0.54965407",
"0.5482781",
"0.54795337",
"0.546838",
"0.5467263",
"0.5457738",
"0.54549646",
"0.54524326",
"0.54522747",
"0.5450529",
"0.54404485",
"0.54404485"
] | 0.6097321 | 34 |
Update the given author. | public function update(Request $request, $id)
{
$author = Author::findOrFail($id);
$this->validate($request, [
'name' => 'required',
'email' => 'required|email',
'bio' => 'required',
]);
$author->update($request->all());
return response()->json($author, 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdateAuthor() {\n $this->put('/api/author/3',\n ['first_name' => 'Karim'] )\n ->seeJson(['first_name' => 'Karim']);\n }",
"function updateAuthor(&$author) {\n\t\t$returner = $this->update(\n\t\t\t'UPDATE authors\n\t\t\tSET\tfirst_name = ?,\n\t\t\t\tmiddle_name = ?,\n\t\t\t\tlast_name = ?,\n\t\t\t\tcountry = ?,\n\t\t\t\temail = ?,\n\t\t\t\turl = ?,\n\t\t\t\tprimary_contact = ?,\n\t\t\t\tseq = ?\n\t\t\tWHERE\tauthor_id = ?',\n\t\t\tarray(\n\t\t\t\t$author->getFirstName(),\n\t\t\t\t$author->getMiddleName() . '', // make non-null\n\t\t\t\t$author->getLastName(),\n\t\t\t\t$author->getCountry(),\n\t\t\t\t$author->getEmail(),\n\t\t\t\t$author->getUrl(),\n\t\t\t\t(int) $author->getPrimaryContact(),\n\t\t\t\t(float) $author->getSequence(),\n\t\t\t\t(int) $author->getId()\n\t\t\t)\n\t\t);\n\t\t$this->updateLocaleFields($author);\n\t\treturn $returner;\n\t}",
"public function updateAction(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n\n $this->fillInAuthData($author);\n $this->authorRepository->update($author);\n $this->redirect('updateForm', 'Author', NULL, array('author' => $author));\n }",
"public function update(AuthorRequest $request, author $author)\n {\n $author->update(\n $request->all()\n );\n\n return redirect()->route('author.index')->withStatus(__('Autor atualizado com sucesso.'));\n }",
"public function setAuthor($author);",
"public function updateFormAction(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n $this->view->assign('author', $author);\n }",
"public function update(AuthorRequest $request, Author $author)\n {\n $validated = $request->validated();\n\n $author->update($validated);\n\n return response()->json([\"message\" => \"Ubah penulis berhasil\"], Response::HTTP_OK);\n }",
"public function setAuthor($author)\n {\n $this->author = $author;\n }",
"public function setAuthor($author)\n {\n $this->author = $author;\n }",
"public function update_author($old_author, $author, $tab) {\n global $pdo;\n $query = $pdo->prepare(\"UPDATE $tab SET author = ? WHERE author = ?\");\n $query->bindValue(1, $author);\n $query->bindValue(2, $old_author);\n $query->execute();\n }",
"public function setAuthor($author) {\n $this->_author = $author;\n }",
"abstract public function setAuthor($author);",
"function setAuthor($author = \"\") \n\t{\n\t\t$this->author = $author;\n\t}",
"public function setAuthor($author) {\r\n\t\tif (t3lib_div::testInt($author)) {\r\n\t\t\t$this->data['author'] = $author;\r\n\t\t} else {\r\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'fe_users', 'username=\\'' . $author . '\\'');\r\n\t\t\tif (!empty($rows) && is_array($rows)) {\r\n\t\t\t\t$this->data['author'] = intVal($rows[0]['uid']);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function update(Author $author, Request $request)\n {\n $this->author->update($author, $request->all());\n\n return redirect()->route('admin.MediaLinkExample.author.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('medialinkexample::authors.title.authors')]));\n }",
"public function setAuthor(string $author): void\n {\n $this->_author = $author;\n }",
"public function update(Request $request, Author $author)\n {\n $request->validate([\n 'nombre' => 'required|min:2',\n 'apellido' => 'required|min:2',\n 'dni' => 'required|regex:/^[0-9]{8}$/|unique:authors,dni,' . $author->id,\n 'edad' => 'required|numeric|min:1|max:120|regex:/^[0-9]*$/',\n 'direccion' => 'required',\n 'telefono' => 'required',\n ]);\n \n $author->update($request->all());\n return redirect()\n ->route('author.index')\n ->with([\n 'message' => 'El registro se edito satisfactoriamente!',\n ]);\n }",
"public function update(UpdateAuthorRequest $request, Author $author): JsonResponse\n {\n $author->name = $request->name;\n $author->birth_date = Carbon::parse($request->birth_date);\n $author->genre = $request->genre;\n $author->save();\n\n return response()->json([\n 'message' => 'Author has been updated.',\n ]);\n }",
"public function update(UpdateAuthorRequest $request, Author $author)\n {\n return $this->service->updateResource($author, $request->input('data.attributes'));\n }",
"public function updateStatus($author)\n {\n return $this->where('status_author', '=', $author)\n ->update([\n 'author_poked' => 1,\n 'poked_date' => date(\"Y-m-d\")\n ]);\n }",
"public function authorUpdate(Request $request, $author ) \n {\n $rules = [\n 'name' => 'required|max:255',\n 'categories' => 'required|max:255',\n ];\n\n $this->validate($request, $rules);\n\n $author = Author::findOrFail($author);\n\n $author->fill($request->all());\n\n if ($author->isClean()) {\n return $this->errorResponse('Debe cambiar al menos un valor', Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n $authors=Author::all()->where('name',$request->name)->where('categories',$request->categories);\n if ($authors->isEmpty()) {\n $author->save();\n }else{\n return $this->errorResponse('Ya existe un registro con el mismo nombre y categoria', Response::HTTP_UNPROCESSABLE_ENTITY);\n\n }\n\n return $this->successResponse($author,Response::HTTP_CREATED);\n }",
"protected function _syncAuthor() {}",
"public function update_author($id_author, Request $request) {\n\t\t// check validate\n\t\t$validate = [\n\t\t\t'name' => 'required'\n\t\t];\n\t\t$this->validate($request, $validate);\n\n\t\t// upload image\n\t\t$data['image'] = $request->file('image');\n\t\t$data['name'] = $request->input('name');\n\t\t$data['path'] = '/image/authors';\n\t\tif ($data['image'] != null) {\n\t\t\tImages::upload_image($data);\n\t\t}\n\n\t\t// create author\n\t\t$author = new \\stdClass;\n\t\t$author->id = $id_author;\n\t\t$author->name = $request->input('name');\n\t\t$author->gender = $request->input('gender');\n\t\t$author->type = $request->input('type');\n\t\t$author->categories = json_decode($request->input('category'));\n\t\t$author->facebook = $request->input('facebook');\n\t\t$author->twitter = $request->input('twitter');\n\t\t$author->website = $request->input('website');\n\t\t$author->description = $request->input('description');\n\t\tif ($data['image'] == null) {\n\t\t\t$author->is_image = false;\n\t\t} else {\n\t\t\t$author->is_image = true;\n\t\t}\n\n\t\tAuthorsBModel::update_author($author);\n\n\t\treturn redirect()->back()->with('success', 'Chỉnh sửa thông tin tác giả thành công');\n\t}",
"public function update(Request $request, Author $author)\n {\n $updatedAuthor = Author::updateAuthor($author, $request->all());\n\n return response()->json($updatedAuthor, 200);\n }",
"public function setAuthor(Author $author) {\n $this->addAuthor($author);\n }",
"public function setAuthor($author)\n {\n if(strlen($author) <= 50 && strlen($author) > 0 && preg_match('#^[a-zA-Z- ]*$#', $author)) {\n $this->author = $author;\n }\n }",
"public function setAuthor(UserInterface $author)\n {\n $this->author = $author;\n }",
"function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}",
"public function setAuthor(\\TYPO3\\Party\\Domain\\Model\\Person $author) {\n\t\t$this->author = $author;\n\t}",
"public function setAuthor(UserInterface $author);",
"public function setAuthor(UserInterface $author);",
"public function update(AuthorForm $request, Author $author)\n {\n $author->update($request->except('_token', 'author_image') + [\n 'author_slug' => Str::slug($request->author_name)\n ]);\n\n $file_path = public_path('uploads/author/'.$author->author_image);\n if(request()->hasFile('author_image')){\n $file = request()->file('author_image');\n if($file->isValid()){\n $file_type = $file->getClientOriginalExtension();\n $file_name = date('Ymdhms').'.'.$file_type;\n $file->storeAs('author', $file_name);\n\n if(file_exists($file_path)){\n unlink($file_path);\n }\n $author->update([\n 'author_image' => $file_name\n ]);\n }\n }\n return back()->with('author_status', 'Author Updated Succesfully!');\n }",
"public function update(Request $request, Author $author)\n {\n return $this->apiUpdate($request, $author);\n }",
"public function post_author( $author ) {\n\t\t$this->data['post_author'] = $author;\n\t}",
"public function setAuthor($author, $encoding = 'UTF-8') {}",
"public function update( $id, $autor ){\n\n $autor['idAuthor'] = $id;\n $this->db->set( $this->_setAutor( $autor ) )->where( 'idAuthor', $id )->update( 'author' );\n\n // Si se ejecuta la consulta\n if ($this->db->affected_rows() == 1) {\n return true;\n }\n return null;\n }",
"public function update_author($author_content){\n $sql25 = \"update pages set page_content='$author_content',modified_by='1',modified_on=NOW() where page_id='2'\";\n $result25 = mysqli_query($this->db,$sql25);\n return $result25;\n }",
"function setAuthor($author) {\n $this->fields['author'] = $author;\n return $this;\n }",
"public function update(Request $request, $authorId)\n {\n return $this->success($this->authorService->editAuthor($authorId, $request->all()), 200);\n }",
"public function setAuthor(?User $author): self\r\n {\r\n $this->author = $author;\r\n\r\n return $this;\r\n }",
"public function edit_author_segment($author_id, $data = array())\n\t{\n\t\t$this->admin_header();\n\t\t\n\t\t$result = $this->Admin_model->fetch_author_details($author_id);\n\t\t\n\t\tif ($result !== FALSE) {\n\t\t\t$data['author_details'] = $result;\n\t\t\t$this->add_author_template('edit_author', $data);\n\t\t}else {\n\t\t\tredirect('Admin/authors_list');\n\t\t}\n\t}",
"public function change_author($user_id,$song_id,$new_author){\r\n //0-\r\n //1-\r\n //2-\r\n //3-\r\n\r\n $ans=mysql_query(\"SELECT song_change_author(\".$user_id.\",\".$song_id.\",\".$new_author.\");\",$this->get_connection());\r\n $ans=mysql_fetch_row($ans);\r\n\r\n if($ans[0]==0){\r\n return TRUE;\r\n }elseif($ans[0]==1){\r\n $this->set_status('SONG_EXIST');\r\n return FALSE;\r\n }\r\n }",
"public function setAuthor($author) {\n $this->author = $author;\n return $this;\n }",
"public function setAuthorUpdatedDate($userUpdatedDate);",
"public function update(Author $author, AuthorService $authorService) {\n\n $authorService->editAuthor($author);\n\n $viewModel = [\n 'author' => $author\n ];\n\n return redirect('authors')->with('success', 'Autor je uspješno izmijenjen!');\n }",
"function saveAuthorToMetadata($a_author = \"\")\n\t{\n\t\t$md =& new ilMD($this->getId(), 0, $this->getType());\n\t\t$md_life =& $md->getLifecycle();\n\t\tif (!$md_life)\n\t\t{\n\t\t\tif (strlen($a_author) == 0)\n\t\t\t{\n\t\t\t\tglobal $ilUser;\n\t\t\t\t$a_author = $ilUser->getFullname();\n\t\t\t}\n\t\t\t\n\t\t\t$md_life =& $md->addLifecycle();\n\t\t\t$md_life->save();\n\t\t\t$con =& $md_life->addContribute();\n\t\t\t$con->setRole(\"Author\");\n\t\t\t$con->save();\n\t\t\t$ent =& $con->addEntity();\n\t\t\t$ent->setEntity($a_author);\n\t\t\t$ent->save();\n\t\t}\n\t}",
"public function setAuthor(User $author): self\n {\n $this->author = $author;\n\n return $this;\n }",
"public function update(StoreAuthor $request, $id)\n {\n $author = Author::find($id);\n $author->name = $request->name[$id];\n $author->surname = $request->surname[$id];\n $author->patronymic = $request->patronymic[$id]; \n \n $author->save();\n $message = 'Вы успешно отредактировали автора';\n //$message = var_export($request->name[$id], true);\n return redirect('/authors')->with('status', $message);\n \n $validated = $request->validated();\n }",
"public function setAuthor($author) {\n $this->properties['author'] = $author;\n\n return $this;\n }",
"public function setAuthor($author)\n {\n $this->author = $author;\n\n return $this;\n }",
"public function author();",
"public function activateAction($author)\n {\n /** @var \\Vendor\\Guestbook\\Domain\\Model\\Author $author */\n $author = $this->authorRepository->findByUid((int)$author);\n if ($author->getDisable() == 0) $this->redirect('list', 'Comment', NULL, NULL);\n $author->setDisable(0);\n $this->authorRepository->update($author);\n $this->view->assign('author', $author);\n }",
"public function manageAuthor(Request $request, $author_id){\n try {\n $author = Admin::findOrFail($author_id);\n\n } catch (ModelNotFoundException $e) {\n Session::flash('error_message', 'Cannot find author by id :'.$author_id);\n }\n }",
"protected function updateAuthors() {\n\n // Find all content authors.\n $query = \\Drupal::entityQuery('node')\n ->condition('status', 1);\n $nids = $query->execute();\n $nodes = Node::loadMultiple($nids);\n\n // Add a content subscription flag for each owner.\n $flag_service = \\Drupal::service('flag');\n $flag_id = 'subscribe_node';\n $flag = $flag_service->getFlagById($flag_id);\n foreach ($nodes as $node) {\n $account = $node->getOwner();\n // Skip inactive users.\n if ($account->isBlocked()) {\n continue;\n }\n // Skip admin and anonymous users.\n if (in_array($account->id(), [0, 1])) {\n continue;\n }\n // Check if already flagged to avoid exception error.\n $flagging = $flag_service->getFlagging($flag, $node, $account);\n if (!$flagging) {\n $flag_service->flag($flag, $node, $account);\n }\n }\n }",
"public function update(Request $request, $id)//Request $request, Author $author\n {\n //\n $request->validate([\n 'name'=>'required',\n // 'avatar'=>'required',\n 'DOB'=>'required',\n 'nationality'=>'required',\n 'career'=>'required',\n 'category_id'=>'required'\n ]);\n $author = Author::find( $id ) ;\n if ($request->has('avatar')) {\n $avatar = $request->avatar;\n $newAvatar = time().$avatar->getClientOriginalName();\n $avatar->move('uploads/authors',$newAvatar);\n $author->avatar ='uploads/authors/'.$newAvatar ;\n }\n // dd($request->category_id);\n\n $author->name = $request->name;\n $author->DOB = $request->DOB;\n $author->nationality = $request->nationality;\n $author->career = $request->career;\n $author->category_id = $request->category_id;\n $author->save();\n\n\n return redirect()->route('author.index')\n ->with('success','author update successflly') ;\n }",
"function updateManagedAuthorMetaData( $user_id, $fistLastName ) {\n\t$update_data = [];\n\t$update_data['user_url'] = \"https://wordpress.org/ionurboz\";\n\t$update_data['first_name'] = isset( $fistLastName[0] ) ? $fistLastName[0] : \"\";\n\t$update_data['last_name'] = isset( $fistLastName[1] ) ? $fistLastName[1] : \"\";\n\t$update_data['wp_capabilities'] = [ 'author' => true ];\n\t$update_data['wp_user_level'] = 8;\n\n\tforeach ( $update_data as $key => $value ) {\n\t\tupdate_user_meta( $user_id, $key, $value );\n\t}\n}",
"public function setAuthor($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataform\\V1beta1\\CommitAuthor::class);\n $this->author = $var;\n\n return $this;\n }",
"public function setAuthor(?Author $author): self\n {\n $this->author = $author;\n\n return $this;\n }",
"public function update(UpdateAuthorRequest $request, $id)\n {\n $this->authorService->updateAuthor($id, $request->validated());\n\n return response()\n ->json([\n 'message' => 'success',\n ]);\n }",
"public function byAuthor(string $author): self\n {\n if (!strstr($author, '@')) {\n $this->author = '[email protected] (' . $author . ')';\n } else {\n $this->author = $author;\n }\n\n return $this;\n }",
"private function fillInAuthData(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n /** @var \\TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUserGroup $feUserGroup */\n $feUserGroup = ($this->settings['usergroup']) ? $this->frontendUserGroupRepository->findByUid($this->settings['usergroup']) : '';\n $userGroup = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n $author->setUsergroup($userGroup);\n $author->getUsergroup()->attach($feUserGroup);\n $this->setAuthorImage($author);\n $author->setPassword($this->getAuthorPassword($author));\n }",
"public function author()\n {\n $userId = $_post['userId'];\n $userRepository = new UserRepository();\n if (!empty($userId)) {\n $author = $userRepository->getAuthor();\n }\n }",
"function handleAuthor($role_name, $author) {\n $replacements = array(\n $role_name,\n $author['name'],\n $author['email'],\n $author['when']['time'],\n $author['when']['offutc']\n );\n return vsprintf(\"%s %s <%s> %s %s\\n\", $replacements);\n }",
"public function update(Request $request, $id){\n\t\t$author = Author::findOrFail($id);\n\n\t\t$validation = \\Validator::make(Input::all(), [\n\t\t\t'first_name' => 'required|max:80|min:2',\n\t\t\t'last_name' => 'required|max:80|min:2',\n\t\t\t'email' => 'required',\n\t\t]);\n\n\t\tif($validation->fails()){\n\t\t\treturn $this->setStatusCode(422)\n\t\t\t\t->respondWithError($validation->errors()->getMessages());\n\t\t}\n\t\tif($validation->passes()){\n\t\t\t$author->first_name = $request->get('first_name');\n\t\t\t$author->last_name = $request->get('last_name');\n\t\t\t$author->email = $request->get('email');\n\t\t\t$author->phone = $request->get('phone');\n\t\t\t$author->user_id = $request->get('user_id', null);\n\n\t\t\t//If this author is set as the PRIMARY STORY contact, set all other authors' is_principal_contact fields to 0 and mark this author as a contact automatically\n\t\t\tif($request->get('is_principal_contact') == 1){\n\t\t\t\t$author->is_principal_contact = 1;\n\t\t\t\t$author->is_contact = 1;\n\t\t\t\tAuthor::where('id', '!=', $author->id)->update(['is_principal_contact' => 0]);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$author->is_principal_contact = 0;\n\t\t\t\tif($request->get('is_contact') == 1){\n\t\t\t\t\t$author->is_contact = 1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$author->is_contact = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//If this author is set as the PRIMARY MAGAZINE contact, set all other authors' is_principal_magazine_contact fields to 0 and mark this author as a contact automatically\n\t\t\tif($request->get('is_principal_magazine_contact') == 1){\n\t\t\t\t$author->is_principal_magazine_contact = 1;\n\t\t\t\t$author->is_contact = 1;\n\t\t\t\tAuthor::where('id', '!=', $author->id)->update(['is_principal_magazine_contact' => 0]);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$author->is_principal_magazine_contact = 0;\n\t\t\t\tif($request->get('is_contact') == 1){\n\t\t\t\t\t$author->is_contact = 1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$author->is_contact = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($author->save()){\n\t\t\t\treturn $this->setStatusCode(201)\n\t\t\t\t\t->respondSavedWithData('Author successfully Updated!', ['record_id' => $author->id]);\n\t\t\t}\n\t\t}\n\t}",
"public function actualizar_put( $idAutor, $idRevista ){\n\n if( !$this->put() ){\n $this->response( array( 'error' => \"problemas al recibir los nuevos datos\"), 400 );\n }\n\n // Si no viene un objeto, autor ó revista\n if( !$idAutor || !$idRevista ){\n $this->response( array( 'error' => \"problemas con id del autor y revista, asegurate de pasar ambos parametros\"), 400 );\n }\n\n $update = $this->rautor_model->update( $idAutor, $idRevista, $this->put() );\n\n // Comprobar que venga la informacion\n if( !is_null( $update ) ){\n $this->response( array( 'response' => 'revista_author actualizado correctamente..' ), 200 );\n } else {\n $this->response( array('error' => \"Algo ha falldo en el servidor. No se pudo editar el revista_author\" ), 400 );\n }\n }",
"public function setAuthorAttribute(User $user)\n {\n $this->attributes['author_id'] = $user->id;\n }",
"public function is_author($author = '')\n {\n }",
"public function setAuthorId($authorId)\n {\n $this->_authorId = $authorId;\n }",
"public function setAuthorUsername($AUTHOR_USERNAME)\n {\n $this->AUTHOR_USERNAME = $AUTHOR_USERNAME;\n }",
"function the_author_aim()\n {\n }",
"function the_modified_author()\n {\n }",
"function the_author_yim()\n {\n }",
"public function update(PDO $pdo){\n\t\t//Only updates if not new id\n\t\tif($this->authorId === null) {\n\t\t\tthrow(new PDOException(\"Unable to update, author id does not exist.\"));\n\t\t}\n\n\t\t//Create query template\n\t\t$query = \"UPDATE author SET name = :name, email = :email, title = :title WHERE authorId = :authorId\";\n\t\t$statement = $pdo->prepare($query);\n\n\t\t//Bind variables to place holders\n\t\t$parameters = array(\"name\" => $this->name, \"email\" => $this->email, \"title\" => $this->title, \"authorId\" => $this->authorId);\n\t\t$statement->execute($parameters);\n\t}",
"public function update(SplSubject $publisher){\r\n \r\n }",
"public function update(Request $request, $id)\n {\n // User::find($id)->update($request->except('role'));\n $authors = User::find($id);\n $authors->name = $request->name;\n $authors->email = $request->email;\n $authors->save();\n\n if( $request->role == 1)\n {\n $memberRole = Role::where('name','member')->first();\n $adminRole = Role::where('name','admin')->first();\n $authors->detachRole($memberRole);\n $authors->attachRole($adminRole);\n }else {\n $memberRole = Role::where('name','member')->first();\n $adminRole = Role::where('name','admin')->first();\n $authors->attachRole($memberRole);\n $authors->detachRole($adminRole);\n }\n\n return redirect()->route('authors.index');\n }",
"function addSynonymForAuthor($author, $syn_author)\r\n {\r\n $CI = &get_instance();\r\n if ($author == null) return;\r\n if ($author->author_id==$syn_author->author_id)\r\n {\r\n appendErrorMessage(__(\"Cannot set author as synonym of itself\").'.<br/>');\r\n return;\r\n }\r\n if ($this->hasSynonyms($syn_author)) \r\n {\r\n appendErrorMessage(__(\"Cannot set author as synonym, because it already has synonyms itself\").'.<br/>');\r\n return;\r\n }\r\n if ($author->synonym_of!='0')\r\n {\r\n $this->addSynonymForAuthor($CI->author_db->getByID($author->synonym_of),$syn_author);\r\n }\r\n $syn_author->synonym_of = $author->author_id;\r\n $syn_author->update();\r\n }",
"public function edit(Author $author)\n {\n return view('dashboard.author.edit')\n ->with([\n 'author' => $author,\n ]);\n }",
"public function showEdit(Author $author) {\n \n $viewName = $this->viewFolder . '.editAuthor';\n\n $viewModel = [\n 'author' => $author\n ];\n\n return view($viewName, $viewModel);\n }",
"public function update($id, AuthorRequest $request)\n {\n $author = ShopAuthor::findOrFail($id);\n $author->update([\n 'name' => $request->input('name'),\n 'function' => $request->input('function'),\n 'description' => $request->input('description'),\n 'fb_link' => ($request->input('fb_link')) ? $request->input('fb_link') : null,\n 'twitter_link' => ($request->input('twitter_link')) ? $request->input('twitter_link') : null,\n 'website_link' => ($request->input('website_link')) ? $request->input('website_link') : null,\n ]);\n if($request->hasFile('pic_url')){\n $author->storePicture($request);\n }\n return response()->json([\n \"data\" =>$id\n ], 200);\n }",
"public function author($id){\n try{\n $id = Crypt::decryptString($id);\n } catch (DecryptException $e) {\n return 'UPD-E0002';\n }\n \n $author = Author::find($id);\n return view('bahai.forms.update.author', compact('author'));\n }",
"function thememove_setup_author() {\n\tglobal $wp_query;\n\n\tif ( $wp_query->is_author() && isset( $wp_query->post ) ) {\n\t\t$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );\n\t}\n}",
"public function showAuthor($author)\n {\n $author=Author::findOrFail($author);\n return $this->successResponse($author);\n }",
"protected function drawAuthor($im, $author)\n {\n // Scale author to fit by incrementing fontsizes down\n $fontSize = $this->settings->fontSize;\n do {\n $txtWidth = $this->textWidth(\n $author,\n $this->settings->titleFont,\n $fontSize\n );\n $fontSize--;\n } while ($txtWidth > $this->settings->wrapWidth);\n // white text, black outline\n $fontSize = ++$fontSize < $this->settings->minFontSize\n ? $this->settings->fontSize\n : $fontSize;\n // Too small to read? Align left\n $alignment = $fontSize < $this->settings->minFontSize\n ? 'left'\n : null;\n $this->drawText(\n $im,\n $author,\n 5,\n $this->settings->size - 3,\n $this->settings->authorFont,\n $fontSize,\n $this->white,\n $this->black,\n $alignment\n );\n }",
"function setLastchangeAuthor($a) {\n\t\t$this->set(\"lastchangeauthor\",$a);\n\t}",
"public function update_book($title,$author,$publisher,$id){\n $sql = \"UPDATE book SET title=:title, author=:author, publisher=:publisher WHERE id=:id\";\n $stmt = $this->con->prepare($sql); \n $stmt->bindParam(':title', $title, PDO::PARAM_STR); \n $stmt->bindParam(':author', $author, PDO::PARAM_STR); \n $stmt->bindParam(':publisher', $publisher, PDO::PARAM_STR); \n $stmt->bindParam(':id', $id, PDO::PARAM_INT); \n $stmt->execute();\n\n \n if($stmt){\n $location=\"../welcome.php\";\n $message=\"Book has been successfully updated\";\n header(\"Location: $location?message=$message\");\n }\n else{\n $location=\"../welcome.php\";\n $message=\"something went wrong!\";\n header(\"Location: $location?error_msg=$message\");\n\n }\n \n\n }",
"function GetAuthor()\n {\n return 'calguy1000';\n }",
"public function setAuthors($authors)\n {\n $this->setValue('authors', $authors);\n }",
"public function updateSimilar($authorId)\n {\n if (!is_numeric($authorId)) {\n throw new App_Exception('authorId must be numeric');\n }\n require_once 'App/Db/Table/UserBookshelf.php';\n $table = new App_Db_Table_UserBookshelf();\n $authors = $table->getSimilarAuthors($authorId);\n\n $this->delete($this->_db->quoteInto('author1_id = ?', $authorId));\n\n if (is_array($authors)) {\n foreach ($authors as $author) {\n $this->insert(array(\n 'title1_id' => $authorId,\n 'title2_id' => $author['lib_author_id'],\n 'avg' => $author['avg'],\n 'count' => $author['count']\n ));\n }\n }\n }",
"protected function setGitCommitter(Author $author): void\n {\n $this->git('config user.name '.$this->gitEscape($author->getName()));\n $this->git('config user.email '.$this->gitEscape($author->getEmail()));\n }",
"public function getAuthorUpdatedDate();",
"function attach_rank_to_author( $author ) \n\t{\n\t\treturn $author . ' - <small>' . __('Rank', 'simple-user-rank-comments') .' : ' . esc_html( get_user_rank() ) . '</small>';\n\t}",
"function merge($author, $simauthor_id) {\r\n $CI = &get_instance();\r\n //0) get author and simauthor, to verify synonym information! \r\n //a synonym can ONLY be merged with its primary as TARGET.\r\n $simauthor = $CI->author_db->getByID($simauthor_id);\r\n if ($author->synonym_of != '0')\r\n {\r\n appendErrorMessage(__(\"You cannot merge authors with a synonym author as target\").'.<br/>');\r\n return;\r\n }\r\n if (($simauthor->synonym_of != '0') && ($simauthor->synonym_of != $author->author_id))\r\n {\r\n appendErrorMessage(__(\"An author synonym can only be merged with the corresponding primary author\").'.<br/>');\r\n return;\r\n }\r\n \r\n //1) get all publications of old, similar author, one by one.\r\n $pubs = $CI->publication_db->getForAuthor($simauthor_id);\r\n //2) reassign the publication, if appropriate rights \r\n foreach ($pubs as $pub) {\r\n if ($CI->accesslevels_lib->canEditObject($pub)) { //reasign this publication, directly in database tables\r\n $transfer = true;\r\n //was the new author not already an author for this publications?\r\n foreach($pub->authors as $a) {\r\n if ($a->author_id == $author->author_id) {\r\n $transfer = false;\r\n }\r\n }\r\n if (!$transfer) {\r\n //remove link for similarauthor\r\n $CI->db->delete('publicationauthorlink',array('author_id'=>$simauthor_id,'pub_id'=>$pub->pub_id));\r\n } else {\r\n //transfer link for similarauthor\r\n $CI->db->update('publicationauthorlink',array('author_id'=>$author->author_id),array('author_id'=>$simauthor_id,'pub_id'=>$pub->pub_id));\r\n }\r\n }\r\n }\r\n //3) look if table contains any publication for old author (might have been inaccessible for you!)\r\n // if all publications successfully reassigned, kill old similar author, else give warning\r\n $remainingPubsQ = $CI->db->get_where('publicationauthorlink',array('author_id'=>$simauthor_id));\r\n if ($remainingPubsQ->num_rows() > 0) {\r\n appendErrorMessage(__('There are some publications that could not be reassigned due to access rights'));\r\n } else {\r\n $CI->db->delete('author',array('author_id'=>$simauthor_id));\r\n }\r\n //4) reassign all synonyms of old author to new author\r\n $CI->db->update('author',array('synonym_of'=>$author->author_id),array('synonym_of'=>$simauthor_id));\r\n }",
"public function set_author_class($class = 'SimplePie_Author')\n {\n }",
"public function edit(Author $author)\n {\n return view('medialinkexample::admin.authors.edit', compact('author'));\n }",
"public function getAuthor()\n {\n return $this->author;\n }",
"public function getAuthor()\n {\n return $this->author;\n }",
"public function getAuthor()\n {\n return $this->author;\n }",
"public function getAuthor()\n {\n return $this->author;\n }",
"public function getAuthor()\n {\n return $this->author;\n }",
"public function getAuthor()\n {\n return $this->author;\n }"
] | [
"0.8462203",
"0.8005925",
"0.78261405",
"0.73645127",
"0.73552096",
"0.70964664",
"0.709519",
"0.70813674",
"0.70813674",
"0.705324",
"0.7050435",
"0.7039484",
"0.6998898",
"0.6991568",
"0.6986155",
"0.69636196",
"0.69571453",
"0.69389886",
"0.6929387",
"0.68639785",
"0.6862548",
"0.68280894",
"0.6794445",
"0.67940915",
"0.67781395",
"0.6733464",
"0.67057604",
"0.6696942",
"0.6648438",
"0.6611925",
"0.6611925",
"0.66058403",
"0.65621203",
"0.6558334",
"0.649296",
"0.6477461",
"0.6411597",
"0.6371017",
"0.63628334",
"0.62857044",
"0.626775",
"0.62602246",
"0.6241586",
"0.6239836",
"0.62181413",
"0.62059957",
"0.61734885",
"0.61648744",
"0.6111562",
"0.6106397",
"0.609796",
"0.60436493",
"0.6028692",
"0.6024649",
"0.59781677",
"0.5961866",
"0.5957608",
"0.5935162",
"0.59181",
"0.58867794",
"0.58706224",
"0.5865546",
"0.5864262",
"0.5863183",
"0.5853631",
"0.58517176",
"0.5851103",
"0.58408815",
"0.58401155",
"0.5812539",
"0.5803794",
"0.57969856",
"0.57708895",
"0.5762691",
"0.5749327",
"0.5747682",
"0.57397693",
"0.57280296",
"0.5717531",
"0.57152045",
"0.5711576",
"0.5698989",
"0.5687866",
"0.5686606",
"0.56811196",
"0.5674008",
"0.5668604",
"0.56668997",
"0.56579244",
"0.56498575",
"0.5642269",
"0.5637244",
"0.56337965",
"0.5618947",
"0.5609001",
"0.5609001",
"0.5609001",
"0.5609001",
"0.5609001",
"0.5609001"
] | 0.5775721 | 72 |
this up() migration is autogenerated, please modify it to your needs | public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE pergunta (id INT AUTO_INCREMENT NOT NULL, questionario_id INT DEFAULT NULL, resposta_id INT DEFAULT NULL, descricao VARCHAR(255) NOT NULL, pontuacao INT NOT NULL, dica VARCHAR(255) NOT NULL, INDEX IDX_124A7194664E1225 (questionario_id), INDEX IDX_124A719479F97242 (resposta_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE pergunta_resposta (id INT AUTO_INCREMENT NOT NULL, pergunta_id INT NOT NULL, resposta_id INT NOT NULL, letra VARCHAR(10) NOT NULL, INDEX IDX_158F27FD3C763537 (pergunta_id), INDEX IDX_158F27FD79F97242 (resposta_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE questionario (id INT AUTO_INCREMENT NOT NULL, descricao VARCHAR(255) NOT NULL, pontuacao_total INT NOT NULL, tempo INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE resposta (id INT AUTO_INCREMENT NOT NULL, descricao VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE tentativa (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, questionario_id INT NOT NULL, dica_acionada TINYINT(1) NOT NULL, eliminar_acionado TINYINT(1) NOT NULL, pular_acionado TINYINT(1) NOT NULL, dobrar_acionado TINYINT(1) NOT NULL, desafio_acionado TINYINT(1) NOT NULL, pontuacao INT NOT NULL, INDEX IDX_DCAE46E0A76ED395 (user_id), INDEX IDX_DCAE46E0664E1225 (questionario_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE tentativa_resposta (id INT AUTO_INCREMENT NOT NULL, tentativa_id INT NOT NULL, pergunta_id INT NOT NULL, resposta_id INT DEFAULT NULL, respondida TINYINT(1) NOT NULL, acertou TINYINT(1) NOT NULL, pulou TINYINT(1) NOT NULL, usou_dica TINYINT(1) NOT NULL, INDEX IDX_EBC5128058EE7320 (tentativa_id), INDEX IDX_EBC512803C763537 (pergunta_id), INDEX IDX_EBC5128079F97242 (resposta_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE pergunta ADD CONSTRAINT FK_124A7194664E1225 FOREIGN KEY (questionario_id) REFERENCES questionario (id)');
$this->addSql('ALTER TABLE pergunta ADD CONSTRAINT FK_124A719479F97242 FOREIGN KEY (resposta_id) REFERENCES resposta (id)');
$this->addSql('ALTER TABLE pergunta_resposta ADD CONSTRAINT FK_158F27FD3C763537 FOREIGN KEY (pergunta_id) REFERENCES pergunta (id)');
$this->addSql('ALTER TABLE pergunta_resposta ADD CONSTRAINT FK_158F27FD79F97242 FOREIGN KEY (resposta_id) REFERENCES resposta (id)');
$this->addSql('ALTER TABLE tentativa ADD CONSTRAINT FK_DCAE46E0A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE tentativa ADD CONSTRAINT FK_DCAE46E0664E1225 FOREIGN KEY (questionario_id) REFERENCES questionario (id)');
$this->addSql('ALTER TABLE tentativa_resposta ADD CONSTRAINT FK_EBC5128058EE7320 FOREIGN KEY (tentativa_id) REFERENCES tentativa (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tentativa_resposta ADD CONSTRAINT FK_EBC512803C763537 FOREIGN KEY (pergunta_id) REFERENCES pergunta (id)');
$this->addSql('ALTER TABLE tentativa_resposta ADD CONSTRAINT FK_EBC5128079F97242 FOREIGN KEY (resposta_id) REFERENCES resposta (id)');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function up();",
"abstract public function up();",
"abstract public function up();",
"abstract public function up();",
"public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }",
"public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }",
"public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }",
"public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}",
"public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }",
"public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }",
"public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}",
"public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }",
"public function up()\n {\n }",
"public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }",
"public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }",
"public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}",
"public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }",
"public function preUp()\n {\n }",
"public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}",
"public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }",
"public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}",
"public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }",
"public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }",
"public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }",
"public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }",
"public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }",
"public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }",
"public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }",
"public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}",
"public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }",
"public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }",
"public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }",
"public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }",
"public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}",
"public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }",
"public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}",
"public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}",
"public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }",
"public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }",
"public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }",
"public function up() { return $this->run('up'); }",
"public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}",
"public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }",
"public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}",
"public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }",
"public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }",
"public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }",
"public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }",
"public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }",
"public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }",
"public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function safeUp()\r\n {\r\n $this->up();\r\n }",
"public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}",
"public function safeUp()\n\t{\n\t\t$this->up();\n\t}",
"public function safeUp()\n {\n $this->up();\n }",
"public function safeUp()\n {\n $this->up();\n }",
"public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }",
"public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}",
"public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}",
"public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }",
"public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }",
"public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}",
"public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}",
"public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }",
"public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}",
"public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }",
"public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}",
"public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }",
"public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }",
"public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }",
"public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}",
"public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}",
"public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}",
"public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }",
"public function up()\n\t{\n// $import->import();\n\t}",
"public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}",
"public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}",
"public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }",
"public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }",
"public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}",
"public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}",
"public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}",
"public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }",
"public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }",
"public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}",
"public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }",
"public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }",
"public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }",
"public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }",
"public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }",
"public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}",
"public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}",
"public function up()\n\t{\n Laravel\\Database\\Schema::create(\"orbs\", function($table){\n $table->increments(\"id\");\n $table->string(\"name\");\n $table->string(\"description\");\n $table->integer(\"coins\");\n $table->integer(\"points\");\n $table->integer(\"min_level\");\n $table->integer(\"max_level\");\n $table->integer(\"owner_character\");\n $table->integer(\"acquisition_time\");\n $table->integer(\"last_attacker\");\n $table->integer(\"last_attack_time\");\n $table->string(\"image\");\n });\n\t}"
] | [
"0.80066043",
"0.7914959",
"0.7914959",
"0.7914959",
"0.75719035",
"0.7560778",
"0.7527931",
"0.74982595",
"0.7493783",
"0.74534315",
"0.74463856",
"0.7433922",
"0.74311835",
"0.7427006",
"0.7417858",
"0.73779964",
"0.73755157",
"0.73712873",
"0.7363846",
"0.735142",
"0.73292845",
"0.73129934",
"0.7298562",
"0.72951734",
"0.7291847",
"0.7291476",
"0.72914755",
"0.7284709",
"0.7283983",
"0.7272072",
"0.7272034",
"0.7265825",
"0.726298",
"0.72617865",
"0.72560364",
"0.72512585",
"0.72499496",
"0.7243614",
"0.72404116",
"0.7237569",
"0.721851",
"0.7218458",
"0.7204767",
"0.72034365",
"0.71961236",
"0.71919805",
"0.7189841",
"0.71769035",
"0.71762794",
"0.7167893",
"0.7164443",
"0.7164443",
"0.71597344",
"0.71471286",
"0.71358293",
"0.71311086",
"0.71246946",
"0.7123576",
"0.7118145",
"0.7105957",
"0.7105957",
"0.7104579",
"0.7096639",
"0.7093377",
"0.7088464",
"0.70865136",
"0.70863265",
"0.7083635",
"0.70828265",
"0.70793617",
"0.7069573",
"0.70689183",
"0.7065983",
"0.7061844",
"0.70594215",
"0.7059001",
"0.7055699",
"0.70550114",
"0.7054347",
"0.70504284",
"0.7048151",
"0.7047305",
"0.7045819",
"0.70448506",
"0.70433927",
"0.7039105",
"0.7038329",
"0.70365304",
"0.7033573",
"0.703223",
"0.7031371",
"0.70262486",
"0.7014226",
"0.7009951",
"0.7007122",
"0.698899",
"0.698483",
"0.69629115",
"0.6961206",
"0.6958413",
"0.6957081"
] | 0.0 | -1 |
this down() migration is autogenerated, please modify it to your needs | public function down(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE pergunta_resposta DROP FOREIGN KEY FK_158F27FD3C763537');
$this->addSql('ALTER TABLE tentativa_resposta DROP FOREIGN KEY FK_EBC512803C763537');
$this->addSql('ALTER TABLE pergunta DROP FOREIGN KEY FK_124A7194664E1225');
$this->addSql('ALTER TABLE tentativa DROP FOREIGN KEY FK_DCAE46E0664E1225');
$this->addSql('ALTER TABLE pergunta DROP FOREIGN KEY FK_124A719479F97242');
$this->addSql('ALTER TABLE pergunta_resposta DROP FOREIGN KEY FK_158F27FD79F97242');
$this->addSql('ALTER TABLE tentativa_resposta DROP FOREIGN KEY FK_EBC5128079F97242');
$this->addSql('ALTER TABLE tentativa_resposta DROP FOREIGN KEY FK_EBC5128058EE7320');
$this->addSql('ALTER TABLE tentativa DROP FOREIGN KEY FK_DCAE46E0A76ED395');
$this->addSql('DROP TABLE pergunta');
$this->addSql('DROP TABLE pergunta_resposta');
$this->addSql('DROP TABLE questionario');
$this->addSql('DROP TABLE resposta');
$this->addSql('DROP TABLE tentativa');
$this->addSql('DROP TABLE tentativa_resposta');
$this->addSql('DROP TABLE user');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function down()\n {\n //add your migration here \n }",
"public function down()\n {\n //add your migration here\n }",
"public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}",
"public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }",
"public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }",
"public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }",
"public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }",
"public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}",
"public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}",
"public function down(){\n $this->dropTable('users');\n }",
"public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }",
"public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}",
"public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }",
"public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}",
"public function down()\n\t{\n\t\t// nothing to do here.\n\t}",
"public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }",
"public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}",
"public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}",
"public function down() \n {\n \n }",
"public function down()\n\t{\n\t}",
"public function down()\n\t{\n\t}",
"public function down()\n\t{\n\t\t//\n\t}",
"public function down()\n\t{\n\t\t//\n\t}",
"public function down()\n\t{\n\t\t//\n\t}",
"public function down()\n {\n $this->table('contents')->drop()->save();\n }",
"public function down()\n\t{\n\t\tSchema::drop('education');\n\t}",
"public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}",
"public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}",
"public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}",
"public function down()\n {\n\tSchema::drop('quizzes');\n }",
"public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }",
"public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function down ()\n {\n }",
"abstract public function down();",
"abstract public function down();",
"abstract public function down();",
"public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }",
"public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }",
"public function down() {\n\n\t}",
"public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }",
"public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}",
"public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }",
"public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }",
"public function down(): void\n {\n // Remove your data\n }",
"public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}",
"public function down()\n {\n\tSchema::drop('activities');\n }",
"public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }",
"public function down()\n {\n }",
"public function down()\n {\n }",
"public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }",
"public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}",
"public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}",
"public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }",
"public function down()\n\t{\n\t\t//return false;\n\t}",
"public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }",
"public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}",
"public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }",
"public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }",
"public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}",
"public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }",
"public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}",
"public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }",
"public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}",
"protected abstract function do_down();",
"public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}",
"public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }",
"public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }",
"public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}",
"public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}",
"public function safeDown()\n {\n $this->down();\n }",
"public function safeDown()\n {\n $this->down();\n }",
"public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}",
"public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}",
"public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}",
"public function safeDown()\r\n {\r\n $this->down();\r\n }",
"public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }",
"public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}",
"public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}",
"public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}",
"public function down() {\n\t}",
"public function down() {\n\t}",
"public function down() {\n\t}",
"public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }",
"public function down()\n {\n Schema::dropIfExists('reunion');\n }",
"public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }",
"public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}",
"public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }",
"public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}",
"public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}",
"public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}",
"public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}",
"protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }",
"public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }",
"public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}",
"public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }",
"public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }",
"public function down()\n {\n Schema::dropIfExists('data');\n }",
"public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}"
] | [
"0.79504126",
"0.786382",
"0.76066226",
"0.7494023",
"0.73207307",
"0.72453755",
"0.71876216",
"0.71545076",
"0.7153052",
"0.7141973",
"0.71357507",
"0.7121533",
"0.7115573",
"0.710582",
"0.7098136",
"0.7080175",
"0.7078857",
"0.7073052",
"0.7068457",
"0.7066428",
"0.7053525",
"0.7053525",
"0.70423424",
"0.70423424",
"0.70423424",
"0.70418614",
"0.7040274",
"0.70289254",
"0.70255107",
"0.70218396",
"0.69887465",
"0.69869775",
"0.69781595",
"0.69719964",
"0.69443035",
"0.69443035",
"0.69443035",
"0.6942285",
"0.6941494",
"0.69394",
"0.6935384",
"0.6933575",
"0.6928748",
"0.69249374",
"0.6924927",
"0.69135904",
"0.6902533",
"0.68980044",
"0.6897988",
"0.6897988",
"0.6897979",
"0.6888752",
"0.68827",
"0.6874066",
"0.6869992",
"0.6863854",
"0.68585324",
"0.6854623",
"0.68441147",
"0.6842246",
"0.68371",
"0.68363124",
"0.68348014",
"0.68304574",
"0.68297744",
"0.68283874",
"0.6826765",
"0.6824095",
"0.6818576",
"0.6811012",
"0.6807886",
"0.6805734",
"0.6805734",
"0.67892736",
"0.6775542",
"0.67743915",
"0.6765173",
"0.6759687",
"0.6759515",
"0.6756515",
"0.6756515",
"0.6756515",
"0.6753534",
"0.6753534",
"0.6753534",
"0.67535",
"0.67527735",
"0.6745868",
"0.67439425",
"0.67388934",
"0.6733941",
"0.67332995",
"0.67314035",
"0.6730381",
"0.672757",
"0.6727422",
"0.6727353",
"0.67261106",
"0.67173046",
"0.67140734",
"0.6713103"
] | 0.0 | -1 |
Tests a string literal in an action group | public function testGetStepsWithDefaultCase()
{
$entity = (new EntityDataObjectBuilder())
->withDataFields(['field1' => 'testValue'])
->build();
$this->setEntityObjectHandlerReturn($entity);
$actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();
$steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testStringActions() {\n\t\tRouter::connect('/login', ['controller' => 'sessions', 'action' => 'create']);\n\t\tRouter::connect('/{:controller}/{:action}');\n\n\t\t$result = Router::match(\"Sessions::create\");\n\t\t$this->assertIdentical('/login', $result);\n\n\t\t$result = Router::match(\"Posts::index\");\n\t\t$this->assertIdentical('/posts', $result);\n\n\t\t$result = Router::match(\"ListItems::archive\");\n\t\t$this->assertIdentical('/list_items/archive', $result);\n\t}",
"public function testEmbeddedStringActions() {\n\t\tRouter::connect('/logout/{:id:[0-9]{5,6}}', [\n\t\t\t'controller' => 'sessions', 'action' => 'destroy', 'id' => null\n\t\t]);\n\t\tRouter::connect('/{:controller}/{:action}');\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}', ['id' => null]);\n\n\t\t$result = Router::match(\"Sessions::create\");\n\t\t$this->assertIdentical('/sessions/create', $result);\n\n\t\t$result = Router::match([\"Sessions::create\"]);\n\t\t$this->assertIdentical('/sessions/create', $result);\n\n\t\t$result = Router::match([\"Sessions::destroy\", 'id' => '03815']);\n\t\t$this->assertIdentical('/logout/03815', $result);\n\n\t\t$result = Router::match(\"Posts::index\");\n\t\t$this->assertIdentical('/posts', $result);\n\n\t\t$ex = \"No parameter match found for URL \";\n\t\t$ex .= \"`('controller' => 'Sessions', 'action' => 'create', 'id' => 'foo')`.\";\n\t\t$this->assertException($ex, function() {\n\t\t\tRouter::match([\"Sessions::create\", 'id' => 'foo']);\n\t\t});\n\t}",
"public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }",
"public function setAction($str);",
"public function test_add_action_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, rand_str() );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Specific function name to test with yourls_do_action\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, 'change_one_global' );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"public function has_valid_action(): bool {\n\t\treturn is_string( $this->get_action() )\n\t\t&& \\mb_strlen( $this->get_action() ) > 0;\n\t}",
"function url_parse_controllerAction(&$value)\n{\n if (!$value) {\n return false;\n } else {\n return preg_match('/^[a-z][a-z\\_0-9]{1,30}$/i', (string)$value);\n }\n}",
"public function testGetName() {\r\n $action = $this->_action->setName('name');\r\n $this->assertEquals('name', $action->getName());\r\n }",
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public function test_sanitized_action_name() {\n\t\t$actual = wp_create_user_request( self::$non_registered_user_email, 'export[_person*al_\\data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( self::$non_registered_user_email, $post->post_title );\n\t}",
"public function hasAction(string $name): bool;",
"function registerAction($group, $action) {\n if (!(checkit::isNoHTML($group, TRUE) && checkit::isNoHTML($action, TRUE))) {\n return NULL;\n }\n $group = trim($group);\n $action = trim($action);\n $groupId = $this->getGroupIdByName($group);\n if ($groupId === NULL) {\n $groupId = $this->databaseInsertRecord(\n $this->tableGroups,\n 'actiongroup_id',\n array('actiongroup_name' => $group)\n );\n if ($groupId === FALSE) {\n return NULL;\n }\n }\n $actionId = $this->databaseInsertRecord(\n $this->tableActions,\n 'action_id',\n array('action_group' => $groupId, 'action_name' => $action)\n );\n if ($actionId !== FALSE) {\n $this->logMsg(\n MSG_INFO,\n PAPAYA_LOGTYPE_SYSTEM,\n 'Action dispatcher registered new action',\n sprintf(\n 'Automatically registered action %s in group %s',\n $action,\n $group\n )\n );\n return $actionId;\n }\n return NULL;\n }",
"public function isAction($action)\n\t{\n\t\treturn strpos($this->getAction(TRUE), $action) !== FALSE;\n\t}",
"function gtags_action_clean( $action ) {\n\t$action = str_replace( ' started the discussion topic', ' started', $action );\n\t$action = str_replace( ' posted on the discussion topic', ' posted on', $action );\t\n\treturn $action;\n}",
"public function test_add_action_class_and_array() {\n $hook = rand_str();\n\n $this->assertFalse( yourls_has_action( $hook ) );\n\n yourls_add_action( $hook, array( 'Class', 'Method' ) );\n $this->assertSame( 10, yourls_has_action( $hook, array( 'Class', 'Method' ) ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'Class::Method' ) );\n\t}",
"public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }",
"public function testSetName() {\r\n $this->assertInstanceOf('PM\\Main\\Event\\Action\\Emit', $this->_action->setName('test'));\r\n $this->assertEquals('test', $this->_action->getName());\r\n }",
"private static function formatAsAction($str) {\n\t\tif (strpos($str, '_') !== false) {\n\t\t\tdo {\n\t\t\t\t$uPos = strpos($str, '_');\n\t\t\t\t$str = substr_replace($str, '', $uPos, 1);\n\t\t\t\t\n\t\t\t\t$str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1);\n\t\t\t}\n\t\t\twhile(strpos($str, '_') !== false);\n\t\t\t\n\t\t\treturn $str;\n\t\t}\n\t\telseif (strpos($str, '-') !== false) {\n\t\t\tdo {\n\t\t\t\t$uPos = strpos($str, '-');\n\t\t\t\t$str = substr_replace($str, '', $uPos, 1);\n\n\t\t\t\t$str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1);\n\t\t\t}\n\t\t\twhile(strpos($str, '-') !== false);\n\n\t\t\treturn $str;\n\t\t}\n\t\telse {\n\t\t\treturn $str;\n\t\t}\n\t}",
"function block_eventsengine_get_name($engineoraction) {\n $parts = explode(':', $engineoraction, 2);\n return get_string_manager()->string_exists($parts[1], $parts[0]) ? get_string($parts[1], $parts[0]) : '';\n}",
"public function testGetNameFail() {\r\n $this->_action->getName();\r\n }",
"function template_share_status($string){\n\n if($_POST['access']==$string){\n return true;\n }else{\n if(strpos($string,\"other-\"==0)){\n return true;\n }else{\t\t\n return false;\n }\n }\n\n}",
"function template_share_status($string){\n\n if($_POST['access']==$string){\n return true;\n }else{\n if(strpos($string,\"other-\"==0)){\n return true;\n }else{\t\t\n return false;\n }\n }\n\n}",
"function userAction( $actionKeyword, $actionRequest ) {\n\taddServerMessageToXML(\"ActionKeyword: $actionKeyword.\");\n\t$result = true;\n\tif( $actionKeyword == \"look\") {\n\t\tuserActionLook( $actionRequest );\n\t} else if( $actionKeyword == \"say\" || $actionKeyword == \"\\\\\\\"\" ) {\n\t\tuserActionSay( $actionRequest );\n\t} else if( $actionKeyword == \"go\" || $actionKeyword == \"goto\" ) {\n\t\tuserActionMove( $actionRequest);\n\t} else if( $actionKeyword == \"take\" ) {\n\t\tuserActionTake( $actionRequest );\n\t} else if( $actionKeyword == \"drop\" ) {\n\t\tuserActionDrop( $actionRequest );\n\t} else if( $actionKeyword == \"full-update\" ) {\n\t\tuserActionFullUpdate( $_SESSION['location'] );\n\t} else if( $actionKeyword == \"examine\" ) {\n\t\tuserActionExamine( $actionRequest );\n\t} else if( substr( $actionRequest, 0, 1) == \"@\" ) {\n\t\tuserBuildActions( $actionRequest );\n\t} else if( $actionKeyword == \"QUIT\" || $actionKeyword == \"SIGNOUT\" || $actionKeyword == \"LOGOUT\" ) {\n\t\t// Needs to be made case sensitive\n\t\tuserAccountSignOut();\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}",
"function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}",
"protected function addGroupNamespaceToStringUses($action)\n {\n $groupStack = last($this->router->getGroupStack());\n if (isset($groupStack['namespace']) && strpos($action, '\\\\') !== 0) {\n return $groupStack['namespace'].'\\\\'.$action;\n }\n return $action;\n }",
"public function test_add_action_within_class() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, 'Change_One_Global::change_it' );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"public function getAction($ucfirst=true){\r\n\t\tif(is_array($this->matchedRoute) && isset($this->matchedRoute['action_regex'])){\r\n\t\t\tif($this->matchedRoute['action_regex'] == true){\r\n\t\t\t\t$this->action = 'Reg'.sha1($this->matchedRoute['action']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($ucfirst){\r\n\t\t\t$o = ucfirst($this->action);\r\n\t\t} else {\r\n\t\t\t$o = strtolower($this->action);\r\n\t\t}\r\n\t\treturn $o;\r\n\t}",
"function map_action($action) {\n return $action . '_action';\n }",
"public function test_add_action_within_class_array() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, array( 'Change_One_Global', 'change_it' ) );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"public function hasAction($action)\n {\n if (method_exists($this, $action . 'Action')) {\n return $action . 'Action';\n }\n return false;\n }",
"function get_action() {\n \t\tglobal $argv;\n\t\treturn strtolower(trim($argv['1']));\n\t}",
"public function hasPermission($action = \"\");",
"function executeAction($group, $action) {\n $script = $this->getScriptByGroup($group);\n \n if($script instanceof AngieApplicationUpgradeScript) {\n return $script->$action();\n } else {\n return \"Invalid group\";\n } // if\n }",
"protected function addGroupNamespaceToStringUses($action)\n {\n $groupStack = end($this->router->getGroupStack());\n\n if (isset($groupStack['namespace']) && strpos($action, '\\\\') !== 0) {\n return $groupStack['namespace'] . '\\\\' . $action;\n }\n\n return $action;\n }",
"function isAllowedAction($action) {\n\t\t\treturn true;\n\t\t}",
"private function fetchaction($data)\n\t{\n\t\t$pattern = \"<input type=\\\"hidden\\\" name=\\\"Action\\\" id=\\\"Action\\\" value=\\\"\";\n\t\t$pos = strpos($data, $pattern);\n\t\tif($pos > -1)\n\t\t\t$this->action = substr($data, $pos + strlen($pattern), strpos(substr($data, $pos + strlen($pattern)), \"\\\"\"));\n\t}",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function getActionName();",
"public function getActionName();",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"public function fnRegexp_eatGroupName(&$oState) \n {\n $oState->sLastStringValue = \"\";\n if ($oState->fnEat(0x3C /* < */)) {\n if ($this->fnRegexp_eatRegExpIdentifierName($oState) && $oState->fnEat(0x3E /* > */)) {\n return true;\n }\n $oState->fnRaise(\"Invalid capture group name\");\n }\n return false;\n }",
"protected function parseAction($action) {\n if (is_string($action)) {\n return ['uses' => $action];\n } elseif (! is_array($action)) {\n return [$action];\n }\n\n return $action;\n }",
"public function test_admin_delete_all_user_actions_with_not_existent_user_id_in_string_format() {\n\n // Generate allowed actions\n factory(\\App\\UserAction::class, 3)->create(['user_id' => $this->user->id]);\n\n // Generate not allowed actions\n factory(\\App\\UserAction::class, 'not_allowed', 4)->create(['user_id' => $this->user->id]);\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/string' . rand() . '/delete-actions/all')\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.user_not_found')\n ]);\n }",
"public function testMacro() {\n Inflector::macro('caps', function($value) {\n return strtoupper($value);\n });\n\n $this->assertEquals('FOOBAR', Inflector::caps('foObAr'));\n\n try {\n Inflector::lowers('foObAr');\n $this->assertTrue(false);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }",
"public function testContains1()\n {\n $this->assertTrue(Str::contains('foo', 'oo'));\n }",
"function isSetName($input) {\n return (preg_match(\"~(^[[:alnum:] -]+$)~\", $input));\n }",
"public static function scheme_name(&$object, $action, $str) {\n\t\t\t$org = $object->scheme_name;\n\t\t\t\\uri\\actions::callback($object, $action, __FUNCTION__, $str);\n\t\t\tif (!(preg_match('/\\A[a-z]{1,10}\\Z/', $object->scheme_name) || empty($str))) {\n\t\t\t\t$object->scheme_name = $org;\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (empty($object->scheme_symbols)) {\n\t\t\t\t$object->scheme_symbols = '://';\n\t\t\t}\n\t\t\t\n\t\t\treturn \\uri\\generate::string($object);\n\t\t}",
"public function setExpectedAction($action);",
"public static function modify(&$object, $action, $section, $str) {\n\t\t\tsettype($section, 'string');\n\t\t\tsettype($str, 'string');\n\t\t\t$section = strtolower($section);\n\t\t\t\n\t\t\tif (is_callable(array('\\\\uri\\\\modify', $section))) {\n\t\t\t\treturn call_user_func_array(array('\\\\uri\\\\modify', $section), array(&$object, $action, $str));\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"function _name_check($str){\n }",
"public function getPermissionFromActionName($input)\n\t{\n\t\tif(($actions = $this->actions) != null){\n\t\t\tif(isset($actions[$input])){\n\t\t\t\treturn $actions[$input];\n\t\t\t} \n\t\t}\n\t\treturn false;\n\t}",
"function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }",
"private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }",
"public function test_get_actions() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $actions = yourls_get_actions( $hook );\n $this->assertTrue(isset($actions[10]['some_function']));\n $this->assertTrue(isset($actions[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_actions( rand_str() ) );\n }",
"abstract protected function setMainActionName();",
"private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}",
"public function isActionAllowed($section, $reference, $action = NULL) ;",
"public function action($strAction = \"\") {\r\n if ($strAction == \"\")\r\n $strActionName = $this->getAction();\r\n else\r\n $strActionName = $strAction;\r\n\r\n $this->strOriginalAction = $strActionName;\r\n\r\n if(!$this->checkMethodExistsInConcreteClass(\"action\".ucfirst($strActionName))) {\r\n\r\n foreach(self::$arrActionNameMapping as $strAutoMatchAction => $strAnnotation) {\r\n $this->autoMatchAction($strAutoMatchAction, $strAnnotation, $strActionName);\r\n }\r\n }\r\n\r\n return parent::action($strActionName);\r\n }",
"protected function getActionMethod(string $action): string\n {\n $sentence = preg_replace('/[\\W_]+/', ' ', $action);\n return lcfirst(str_replace(' ', '', ucwords($sentence)));\n }",
"public function testCreateUpdateActionsString()\n {\n $changedData = 'foobar';\n\n $cart = new Cart();\n\n /** @var CartSetShippingMethodAction[] $actions */\n $actions = $this->fixture->createUpdateActions(\n $changedData,\n $this->createMock(ClassMetadataInterface::class),\n [],\n [],\n $cart\n );\n\n static::assertCount(1, $actions);\n static::assertInstanceOf(CartSetShippingMethodAction::class, $actions[0]);\n static::assertEquals($changedData, $actions[0]->getShippingMethod()->getId());\n }",
"public function memberOf(string $groupName) : bool;",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"public function uses()\n {\n foreach (\\func_get_args() as $pattern) {\n if (Str::is($pattern, $this->currentRouteAction())) {\n return true;\n }\n }\n\n return false;\n }",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"public function test_add_action_within_class_instance() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, array( $this, 'change_one_global' ) );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"function Match($Type , $Var)\n{\n if($Type == \"SUBMIT\")\n {\n if($Var == \"Submit\")\n return true ;\n }\n\n\n return false ;\n}",
"function userActionSay( $actionRequest ) {\n\t$actionKeyword = strtok( $actionRequest, \" \" );\n\t$message = trim( strtok('') );\n\t\n\tif( insertLog(\"user\", $_SESSION['userID'], $_SESSION['location'], $_SESSION['username'] .\" says \\\"<span class='speech'>\".$message.\"</span>\\\"\") ) {\n\t\taddNarrativeToXML(\"Said.\");\n\t} else {\n\t\taddNarrativeToXML(\"Said failed.\");\n\t}\n\treturn;\n}",
"public function setAction($action)\n {\n $action = MySQLParser::Action($action);\n if($action) $this->action = $action;\n return (bool)($action);\n }",
"public function testDispatchAction() {\n\t\ttry {\n\t\t\t$this->object->dispatchAction(null); // wrong action name\n\t\t\t$this->object->dispatchAction('noAction'); // wrong action name\n\t\t\t$this->object->dispatchAction('_actionPseudoPrivate'); // underscored private action\n\t\t\t$this->object->dispatchAction('actionProtected'); // protected action\n\t\t\t$this->object->dispatchAction('actionPrivate'); // private action\n\t\t\t$this->object->dispatchAction('dispatchAction'); // method from parent\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs'));\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs', ['foo', 'bar']));\n\t\t$this->assertEquals(125, $this->object->dispatchAction('actionWithArgs'));\n\t\t$this->assertEquals(555, $this->object->dispatchAction('actionWithArgs', [505, 50]));\n\t\t$this->assertEquals(335, $this->object->dispatchAction('actionWithArgs', [335]));\n\t\t$this->assertEquals(0, $this->object->dispatchAction('actionWithArgs', ['foo', 'bar']));\n\t}",
"protected function _isAllowedAction($action)\n {\n return Mage::getSingleton('admin/session')->isAllowed('cms/magify_bannermanager/groups/' . $action);\n }",
"public function setAction(string $action) {\n $trimmed = trim($action);\n\n if (strlen($trimmed) != 0) {\n $this->action = $trimmed;\n }\n }",
"public static function handle(string &$value): bool\n {\n if (preg_match('/^([a-z0-9A-Z_\\/\\-\\.\\@]+)$/', $value)) {\n return true;\n }\n\n return false;\n }",
"function parseAction()\n {\n $action_regexs = array(\n 'REGEX_ACTION' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Folds|Checks|Calls|Bets|Raises|All-in|All-in\\(raise\\)|Hand result(-Side pot)?)( \\((auth|timeout|disconnect)\\))?( \\$(?<chips>[0-9.]+)( to \\$(?<to_chips>[0-9.]+))?)?$/',\n 'REGEX_RETURN' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Return) uncalled portion of bet \\$(?<chips>[0-9.]+)$/',\n 'REGEX_NOSHOW' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Does not show|Mucks|Folds)( & shows)? \\[(?<card1>[2-9TJQKA][cdhs]) (?<card2>[2-9TJQKA][cdhs])\\]( Show1 \\[(?<show1>[2-9TJQKA][cdhs])\\])?( \\((?<ranking>.*)\\))?$/',\n 'REGEX_SHOWDOWN' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Showdown) \\[(?<card1>[2-9TJQKA][cdhs]) (?<card2>[2-9TJQKA][cdhs]) (?<card3>[2-9TJQKA][cdhs]) (?<card4>[2-9TJQKA][cdhs]) (?<card5>[2-9TJQKA][cdhs])\\] \\((?<ranking>.*)\\)$/',\n // ignore, not an actual showdown\n 'REGEX_SHOWDOWN_NOT' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Showdown\\(High Card\\))$/',\n );\n\n $state_property = array(\n self::STATE_CARDS => 'preflop',\n self::STATE_FLOP => 'flop',\n self::STATE_TURN => 'turn',\n self::STATE_RIVER => 'river',\n );\n $prop_name = $state_property[$this->state];\n\n foreach ($action_regexs as $regex) {\n if (preg_match($regex, $this->line, $this->hand->{$prop_name}['action'][])) {\n return true;\n }\n }\n\n throw new IcFileException('Unexpected action line');\n }",
"private function testArgExists($string) {\n $arg_key = self::getChar($string, 1);\n $argtest = ($arg_key == 'd' || $arg_key == 't');\n return $argtest;\n }",
"#[@test, @ignore('Out of office assigned to :mime tag due to parser')]\n public function withMime() {\n $action= $this->parseCommandSetFrom('\n if true { \n vacation :mime \"Out of office\";\n }\n ')->commandAt(0)->commands[0];\n $this->assertClass($action, 'peer.sieve.action.VacationAction');\n $this->assertTrue($action->mime);\n $this->assertEquals('Out of office', $action->reason);\n }",
"public static function scheme_symbols(&$object, $action, $str) {\n\t\t\t$org = $object->scheme_symbols;\n\t\t\t\\uri\\actions::callback($object, $action, __FUNCTION__, $str);\n\t\t\tif (!(preg_match('/\\A(:)?([\\/]{2,3})?\\Z/', $object->scheme_symbols) || empty($str))) {\n\t\t\t\t$object->scheme_symbols = $org;\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\treturn \\uri\\generate::string($object);\n\t\t}",
"public function get_usable_action_name( $action_name ) {\n\n\t\t$action_name = sanitize_title_with_dashes( $action_name, false, 'save' );\n\t\t$action_name = str_replace( '-', '_', $action_name );\n\n\t\treturn $action_name;\n\n\t}",
"private function testSubArg($string) {\n if (strlen($string) >= 3) {\n $subarg = substr($string, 3);\n $pattern = \"+[ ]{2, }+\";\n if (preg_match($pattern, $string)) {\n return false;\n }\n return true;\n }\n \n return false;\n\n }",
"public function isController($action)\n {\n return (bool) preg_match(\"/^[A-Za-z0-9\\\\\\]+@[A-Za-z0-9_]+$/\", $action);\n }",
"function cd_ab_rel_activity_filter( $action, $activity ) {\n\tswitch ( $activity->component ) {\n\t\tcase 'groups' :\n\t\t\t$cd_ab = get_blog_option( bp_get_root_blog_id(), 'cd_ab' );\n\t\t\tif ( $cd_ab['groups']['status'] === 'on' ) {\n\t\t\t\t$reverse_content = strrev( $action );\n\t\t\t\t$position = strpos( $reverse_content, 'gmi<' );\n\t\t\t\tpreg_match( '~group-(\\d++)-avatar~', $action, $match );\n\t\t\t\t$replace = \"rel='group_{$match[1]}' \";\n\t\t\t\t$action = substr_replace( $action, $replace, - $position + 1, 0 );\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn $action;\n}",
"public function formatActionName($unformatted)\n {\n return strtolower(substr($this->_formatName($unformatted),0,1)) . substr($unformatted,1) . 'Action';\n }",
"public function globalStringConditionMatchesWildcardExpression() {}",
"public function globalStringConditionMatchesWildcardExpression() {}",
"public function testParsingCommandName()\n {\n $request = $this->parser->parse('foo');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals([], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }",
"abstract function getAction() : string;",
"public function checkAction($action, $format)\n\t{\n\t\tif(parent::checkAction($action, $format))\n\t\t{\n\t\t\t$this->setFormat($format);\n\t\t\treturn true;\n\t\t}elseif(parent::checkAction($action, 'Raw')){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function has_action($hook_name, $callback = \\false)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }",
"public function match($rule, $screen, $field_group)\n {\n }"
] | [
"0.62764764",
"0.6072664",
"0.58614385",
"0.5835428",
"0.56331867",
"0.5625111",
"0.55956304",
"0.5591387",
"0.5558081",
"0.5530192",
"0.5401893",
"0.5362032",
"0.53499806",
"0.5346619",
"0.5319621",
"0.53181386",
"0.530861",
"0.5278461",
"0.5267445",
"0.5175172",
"0.5149816",
"0.5149816",
"0.51460934",
"0.51301306",
"0.5109991",
"0.5106176",
"0.5100052",
"0.5098437",
"0.50880665",
"0.50723636",
"0.5068674",
"0.5035588",
"0.5034339",
"0.50328106",
"0.50326914",
"0.5017723",
"0.49990144",
"0.49972886",
"0.49972886",
"0.4996294",
"0.49950752",
"0.4994074",
"0.4978966",
"0.4971959",
"0.49588788",
"0.4950963",
"0.49392632",
"0.49362704",
"0.4935",
"0.4934799",
"0.49186078",
"0.49092185",
"0.4908064",
"0.4900288",
"0.48871577",
"0.48857298",
"0.48827666",
"0.48695228",
"0.4862145",
"0.48126143",
"0.48107162",
"0.4781099",
"0.47751725",
"0.4774964",
"0.47716966",
"0.4770741",
"0.47604555",
"0.47553882",
"0.47544137",
"0.47426602",
"0.47394636",
"0.47302443",
"0.47261432",
"0.47243035",
"0.47231293",
"0.4706521",
"0.47015736",
"0.47008425",
"0.46987966",
"0.46975303",
"0.46946484",
"0.46927592",
"0.46884444",
"0.46776074",
"0.46764073",
"0.4673454",
"0.46724734",
"0.46687934",
"0.4668428",
"0.46655467",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547",
"0.4663547"
] | 0.0 | -1 |
Tests a data reference in an action group, replaced by the user | public function testGetStepsWithCustomArgs()
{
$this->setEntityObjectHandlerReturn(function ($entityName) {
if ($entityName == "data2") {
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
}
});
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);
// entity.field as argument
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);
// String Data
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])
->withArguments([new ArgumentObject('simple', null, 'string')])
->build();
$steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function after_user_activate( $user_id, $user_data, $signup_meta ) {\n $group_id = !empty($_GET['group_id']) ? $_GET['group_id'] : $_POST['group_id'];\n \n if( absint( $group_id ) == $group_id ) {\n ld_update_group_access( $user_id, $group_id );\n }\n}",
"function grp_actions($type, $gid) {\n global $db;\n $gdetails = $this->get_details($gid);\n\n if (!$gdetails)\n e(lang(\"grp_exist_error\"));\n else {\n switch ($type) {\n case \"activate\":\n case \"active\": {\n $db->update(tbl($this->gp_tbl), array(\"active\"), array(\"yes\"), \" group_id='$gid' \");\n e(lang(\"grp_av_msg\"), \"m\");\n }\n break;\n case \"deactivate\":\n case \"deactive\": {\n\n $db->update(tbl($this->gp_tbl), array(\"active\"), array(\"no\"), \" group_id='$gid' \");\n e(lang(\"grp_da_msg\"), \"m\");\n }\n break;\n case \"featured\":\n case \"feature\": {\n $db->update(tbl($this->gp_tbl), array(\"featured\"), array(\"yes\"), \" group_id='$gid' \");\n e(lang(\"grp_fr_msg\"), \"m\");\n }\n break;\n case \"unfeatured\":\n case \"unfeature\": {\n $db->update(tbl($this->gp_tbl), array(\"featured\"), array(\"no\"), \" group_id='$gid' \");\n e(lang(\"grp_fr_msg2\"), \"m\");\n }\n break;\n case \"delete\": {\n $this->delete_group($gid);\n e(lang(\"grp_del_msg\"), \"m\");\n }\n break;\n }\n }\n }",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"function EditITEMPermissionCheck($link, $data){\n if ($data['admin'] == 1){\n //echo 'allowed';\n return;\n }\n $index = array_search ($data['club_year_id'], $data['permissions']['club_year_id_array']);\n if ( $index === FALSE ){\n $returnData['errcode'] = 4;\n //TODO proper code\n $returnData['errno'] = 4000;\n $returnData['errstr'] = \"User is not associated with Club\";\n exitfnc($returnData);\n }\n}",
"public function assignOrRemoveUserToGroup($user_id, $group_id, $action, $site_id=site_id) {\n if($action==='assign') {\n try {\n $stm = $this->uFunc->pdo('uAuth')->prepare('REPLACE INTO\n u235_usersinfo_groups (\n user_id,\n group_id,\n site_id\n ) VALUES (\n :user_id,\n :group_id,\n :site_id\n )\n ');\n $stm->bindParam(':user_id', $user_id, PDO::PARAM_INT);\n $stm->bindParam(':group_id', $group_id, PDO::PARAM_INT);\n $stm->bindParam(':site_id', $site_id, PDO::PARAM_INT);\n $stm->execute();\n } catch (PDOException $e) {\n $this->uFunc->error('1587236839'/*.$e->getMessage()*/,1);\n }\n }\n else {\n try {\n $stm = $this->uFunc->pdo('uAuth')->prepare('DELETE FROM\n u235_usersinfo_groups \n WHERE\n user_id=:user_id AND\n group_id=:group_id AND\n site_id=:site_id\n ');\n $stm->bindParam(':user_id', $user_id, PDO::PARAM_INT);\n $stm->bindParam(':group_id', $group_id, PDO::PARAM_INT);\n $stm->bindParam(':site_id', $site_id, PDO::PARAM_INT);\n $stm->execute();\n } catch (PDOException $e) {\n $this->uFunc->error('1587237190'/*.$e->getMessage()*/,1);\n }\n }\n }",
"public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }",
"public function testGroupContentEntityOperationAccessAlterHook(string $operation): void {\n // Check that our test user doesn't have access to edit or delete comments\n // in the group.\n // This is the default behavior for users that are not a group member.\n $this->assertFalse($this->userHasAccess($operation));\n\n // Now enable our hook which will alter the group content entity operation\n // access rules to allow moderators to edit and delete comments in all\n // groups. Since our user is a moderator they should now have access.\n \\Drupal::state()->set('og_test_group_content_entity_operation_access_alter', TRUE);\n $this->assertTrue($this->userHasAccess($operation));\n }",
"function set_userGroup($data, $oldId){\n $data_user = array();\n $data_group = array();\n $data_user['id'] = $data['id'];\n $data_user['username'] = $data['username'];\n $data_user['password'] = $data['password'];\n $data_user['email'] = $data['email'];\n\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $data_group['userId'] = $data['id'];\n $data_group['groupId'] = $data['group'];\n\n updateRecord(TAB_USR_ROLE, $data_group, \"userId = $oldId\");\n updateRecord(TAB_USERS, $data_user, \"id = $oldId\");\n $data_info = array();\n if($data['group'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}",
"function member_actions($gid, $memuid, $case, $deleting_group = FALSE) {\n global $db;\n\n //getting group details\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (!$this->is_member($memuid, $gid))\n e(lang(\"user_not_grp_mem\"));\n elseif (userid() != $group['userid'] && !has_access(\"admin_access\", true))\n e(lang(\"grp_owner_err1\"));\n elseif ($group['userid'] == $memuid && !$deleting_group)\n e(lang(\"you_cant_perform_actions_on_grp_own\"));\n else\n switch ($case) {\n case \"activate\":\n case \"active\": {\n $db->update(tbl($this->gp_mem_tbl), array(\"active\"), array(\"yes\"), \"userid='$memuid' AND group_id='$gid'\");\n e(lang(\"usr_ac_msg\"), \"m\");\n }\n break;\n\n case \"deactivate\":\n case \"deactive\":\n case \"unactivate\":\n case \"unactive\": {\n $db->update(tbl($this->gp_mem_tbl), array(\"active\"), array(\"no\"), \"userid='$memuid' AND group_id='$gid'\");\n e(lang(\"usr_dac_msg\"), \"m\");\n }\n break;\n\n case \"delete\": {\n\n //Delete All Videos oF member\n $db->delete(tbl($this->gp_vdo_tbl), array(\"userid\", \"group_id\"), array($memuid, gid));\n //Deleting ALl Topics Of \n $this->delete_user_topics($memuid, $gid);\n //Delete Member\n $db->delete(tbl($this->gp_mem_tbl), array(\"userid\", \"group_id\"), array($memuid, $gid));\n\n $total_members = $this->total_members($gid);\n $total_videos = $this->total_videos($gid);\n $count_topics = $this->count_group_topics($gid);\n\n //Update Stat\n $db->update(tbl($this->gp_tbl), array(\"total_topics\", \"total_members\", \"total_videos\"), array($count_topics, $total_members, $total_videos), \" group_id='\" . $gid . \"'\");\n\n e(lang(\"usr_del_msg\"), \"m\");\n }\n break;\n case \"ban\": {\n $db->update(tbl($this->gp_mem_tbl), array(\"ban\"), array(\"yes\"), \"userid='$memuid' AND group_id='$gid'\");\n e(lang(\"User has been banned from this group\"), \"m\");\n }\n break;\n case \"unban\": {\n $db->update(tbl($this->gp_mem_tbl), array(\"ban\"), array(\"no\"), \"userid='$memuid' AND group_id='$gid'\");\n e(lang(\"User ban has been removed\"), \"m\");\n }\n break;\n }\n }",
"function EditITEMRequestPermissionCheck($link, $data){\n if ($data['admin'] == 1){\n //echo 'allowed';\n return;\n }\n $index = array_search ($data['club_year_id'], $data['permissions']['club_year_id_array']);\n if ( $index === FALSE ){\n $returnData['errcode'] = 4;\n //TODO proper code\n $returnData['errno'] = 4000;\n $returnData['errstr'] = \"User is not associated with Club\";\n exitfnc($returnData);\n }\n}",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"public function testIndexGroupActionPostSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => ['2', '3']\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$this->checkFlashMessage(__('Processing of selected tasks put in queue...'));\n\t}",
"public static function userHasPermissionForGroupAction($group, $action)\n\t{\n\t\t// Get user roles\n\t\t$roles = self::getGroupMemberRoles(\n\t\t\t\\User::get('id'),\n\t\t\t$group->get('gidNumber')\n\t\t);\n\n\t\t// Check to see if any of our roles for user has permission for action\n\t\tforeach ($roles as $role)\n\t\t{\n\t\t\t$permissions = json_decode($role['permissions']);\n\t\t\t$permissions = (is_object($permissions)) ? $permissions : new \\stdClass;\n\t\t\tif (property_exists($permissions, $action) && $permissions->$action == 1)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function testSummary() {\n $this->assertEquals('Unblock a user', $this->action->summary());\n }",
"function performDataAction()\n{\n\tglobal $ajax;\n\n\t// XXX Set one and delete the other. This directly ties into\n\t// what HTTP method is being used: POST or GET.\n\t$key = getPostValue('assignment');\n\t$step = getPostValue('assignstep');\n\n\t// Render page.\n\t$html = formPage($key, $step);\t\n\t$ajax->sendCommand(ajaxClass::CMD_WMAINPANEL, $html);\n}",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => '2'\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"function save($data, $group_id = false, $permission_data = null, $permission_action_data = null)\n {\n $success = false;\n\n if (!$group_id) {\n if ($this->db->insert('groups', $data)) {\n\n $data['group_id'] = $this->db->insert_id();\n\n // We have either inserted or updated a new employee, now lets set permissions.\n if ($data['group_id'] && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $data['group_id']));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// $this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $data['group_id']));\n\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $data['group_id']));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $data['group_id'];\n }\n return $success;\n }\n\n /* Update Group */\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', $data);\n\n if ($success && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $group_id));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $group_id));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $group_id));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t// \t$this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $group_id));\n\t\t\t\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $group_id));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $success;\n }",
"public function test_sanitized_action_name() {\n\t\t$actual = wp_create_user_request( self::$non_registered_user_email, 'export[_person*al_\\data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( self::$non_registered_user_email, $post->post_title );\n\t}",
"public function test_delete_data_for_users() {\n global $DB;\n $dg = $this->getDataGenerator();\n $c1 = $dg->create_course();\n $u1 = $dg->create_user();\n $u2 = $dg->create_user();\n\n $cm1 = $dg->create_module('lesson', ['course' => $c1]);\n $cm2 = $dg->create_module('lesson', ['course' => $c1]);\n $cm3 = $dg->create_module('lesson', ['course' => $c1]);\n $context1 = context_module::instance($cm1->cmid);\n $context3 = context_module::instance($cm3->cmid);\n\n $this->create_attempt($cm1, $u1);\n $this->create_grade($cm1, $u1);\n $this->create_timer($cm1, $u1);\n $this->create_branch($cm1, $u1);\n $this->create_override($cm1, $u1);\n $this->create_attempt($cm1, $u2);\n $this->create_grade($cm1, $u2);\n $this->create_timer($cm1, $u2);\n $this->create_branch($cm1, $u2);\n $this->create_override($cm1, $u2);\n\n $this->create_attempt($cm2, $u1);\n $this->create_grade($cm2, $u1);\n $this->create_timer($cm2, $u1);\n $this->create_branch($cm2, $u1);\n $this->create_override($cm2, $u1);\n $this->create_attempt($cm2, $u2);\n $this->create_grade($cm2, $u2);\n $this->create_timer($cm2, $u2);\n $this->create_branch($cm2, $u2);\n $this->create_override($cm2, $u2);\n\n $assertnochange = function($user, $cm) use ($DB) {\n $this->assertTrue($DB->record_exists('lesson_attempts', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertTrue($DB->record_exists('lesson_grades', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertTrue($DB->record_exists('lesson_timer', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertTrue($DB->record_exists('lesson_branch', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertTrue($DB->record_exists('lesson_overrides', ['userid' => $user->id, 'lessonid' => $cm->id]));\n };\n\n $assertdeleted = function($user, $cm) use ($DB) {\n $this->assertFalse($DB->record_exists('lesson_attempts', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertFalse($DB->record_exists('lesson_grades', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertFalse($DB->record_exists('lesson_timer', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertFalse($DB->record_exists('lesson_branch', ['userid' => $user->id, 'lessonid' => $cm->id]));\n $this->assertFalse($DB->record_exists('lesson_overrides', ['userid' => $user->id, 'lessonid' => $cm->id]));\n };\n\n // Confirm existing state.\n $assertnochange($u1, $cm1);\n $assertnochange($u1, $cm2);\n $assertnochange($u2, $cm1);\n $assertnochange($u2, $cm2);\n\n // Delete another module: no change.\n $approveduserlist = new core_privacy\\local\\request\\approved_userlist($context3, 'mod_lesson', [$u1->id]);\n provider::delete_data_for_users($approveduserlist);\n\n $assertnochange($u1, $cm1);\n $assertnochange($u1, $cm2);\n $assertnochange($u2, $cm1);\n $assertnochange($u2, $cm2);\n\n // Delete cm1 for u1: no change for u2 and in cm2.\n $approveduserlist = new core_privacy\\local\\request\\approved_userlist($context1, 'mod_lesson', [$u1->id]);\n provider::delete_data_for_users($approveduserlist);\n\n $assertdeleted($u1, $cm1);\n $assertnochange($u1, $cm2);\n $assertnochange($u2, $cm1);\n $assertnochange($u2, $cm2);\n }",
"public function canActOnTarget($action,$target) {\n // owner of target -> always yes, except for verification\n // all other situatons -> check role action targets\n // - matching globals -> yes\n // - specifics\n // + gets messy\n // - otherwise -> no\n\n if (is_string($action)) {\n global $ACTIONS;\n $action = $ACTIONS[$action];\n }\n\n // system admin -> always yes\n if ($this->flag_is_system_admin) {\n return true;\n }\n\n// util_prePrintR($action);\n// util_prePrintR($target);\n\n // owner of target -> always yes, except for verification\n if ($target->user_id == $this->user_id) {\n if ($action->name != 'verify') { return true; }\n }\n\n\n // view & list is controlled by flags on the object rather than explicit permissions / access records\n if (($action->name == 'view') || ($action->name == 'list')) {\n if (array_key_exists('flag_active',$target->fieldValues)) {\n if ($target->flag_active) {\n return true;\n }\n } elseif (array_key_exists('flag_workflow_published',$target->fieldValues)) {\n if (($target->flag_workflow_published) && (($target->flag_workflow_validated))) {\n return true;\n }\n }\n }\n\n // all other situatons -> check role action targets\n $this->cacheRoleActionTargets();\n\n // - matching globals -> yes\n $target_global_type = Role_Action_Target::getGlobalTargetTypeForObject($target);\n if (in_array($target_global_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_global_type] as $glob_rat) {\n if ($glob_rat->action_id == $action->action_id) {\n return true;\n }\n }\n }\n\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n // - specifics\n // + gets messy\n\n // if the allowed target types do not contain the specific type of the target in question, then no need to go further\n\n // get a list of all the specific ids to check. This gets a bit messy as we have to climb or include a hierarchy depending on what exactly the target is\n\n// util_prePrintR($target);\n\n $ids_to_check = array();\n\n $target_class = get_class($target);\n switch ($target_class) {\n case 'Authoritative_Plant':\n $ids_to_check = array($target->authoritative_plant_id);\n break;\n case 'Authoritative_Plant_Extra':\n // can act on this if can act on the plant\n return $this->canActOnTarget($action,$target->getAuthoritativePlant());\n break;\n case 'Metadata_Structure':\n // can edit this if can edit itself or any parent\n $ids_to_check = Db_Linked::arrayOfAttrValues($target->getLineage(),'metadata_structure_id');\n break;\n case 'Metadata_Term_Set':\n // can edit if can edit any structure that uses this term set\n $structures = Metadata_Structure::getAllFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection);\n $ids_to_check = array();\n foreach ($structures as $s) {\n $ids_to_check = array_merge($ids_to_check,Db_Linked::arrayOfAttrValues($s->getLineage(),'metadata_structure_id'));\n }\n break;\n case 'Metadata_Term_Value':\n // can edit if can edit any structure that uses the term set for which this is a value\n return $this->canActOnTarget($action,Metadata_Term_Set::getOneFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection));\n break;\n case 'Metadata_Reference':\n // can edit if can edit anything to which this refers\n return $this->canActOnTarget($action,$target->getReferrent());\n break;\n case 'Notebook':\n $ids_to_check = array($target->notebook_id);\n break;\n case 'Notebook_Page':\n // can act on if can act on the notebook that contains this page\n return $this->canActOnTarget($action,$target->getNotebook());\n break;\n case 'Notebook_Page_Field':\n // can act on if can act on the notebook that contains the notebook page that this page field\n return $this->canActOnTarget($action,$target->getNotebookPage()->getNotebook());\n break;\n case 'Specimen':\n $ids_to_check = array($target->specimen_id);\n break;\n case 'Specimen_Image':\n // can act on if can act on the specimen\n return $this->canActOnTarget($action,$target->getSpecimen());\n break;\n default:\n break;\n }\n\n// util_prePrintR($ids_to_check);\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n $target_specific_type = Role_Action_Target::getSpecificTargetTypeForObject($target);\n if (! in_array($target_specific_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n return false;\n }\n\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_specific_type] as $spec_rat) {\n if (($spec_rat->action_id == $action->action_id) && (in_array($spec_rat->target_id,$ids_to_check))) {\n if ($action->name == 'view') {\n $actual_target = $spec_rat->getTargets()[0];\n if (array_key_exists('flag_workflow_published',$actual_target->fieldValues)) {\n return $actual_target->flag_workflow_published && $actual_target->flag_workflow_validated;\n }\n }\n return true;\n }\n }\n\n return false;\n }",
"function executeAction($group, $action) {\n $script = $this->getScriptByGroup($group);\n \n if($script instanceof AngieApplicationUpgradeScript) {\n return $script->$action();\n } else {\n return \"Invalid group\";\n } // if\n }",
"abstract public function check($userId, $permission, array $data = []);",
"function groupApplyHandler1() {\n global $inputs;\n\n updateDb('member_group_apply',[\n 'status' => $inputs['type'],\n 'handle_time' => date('Y-m-d H:i:s'),\n ], [\n 'id' => $inputs['id']\n ]);\n\n if ($inputs['type'] == 'agree') {\n insert('member_group',[\n 'member_id' => $inputs['member_id'],\n 'group_id' => $inputs['group_id']\n ]);\n }\n\n formatOutput(true, 'update success');\n}",
"function process_action($db, &$data) {\n\n\t/*\n\t\tIn \"real\" version this would validate the form, sending\n\t\tthe message if valid, and sending the appropriate handler.\n\t\t\n\t\tHandlers such as:\n\t\t\tactions/%s/%s_invalidForm\n\t\t\tactions/%s/%s_failed\n\t\t\tactions/%s/%s_success\n\t*/\n\t\n\t$data = [\n\t\t'contentFilePath' => 'actions/%s/%s.success',\n\t\t'pageName' => 'contact',\n\t\t'pageTitle' => 'Contact Us'\n\t];\n\n}",
"public function call($data, $action)\n {\n }",
"function GetITEMEditRequestByClubPermissionCheck($link, $data){\n if ($data['admin'] == 1){\n //echo 'allowed';\n return;\n }\n $index = array_search ($data['club_year_id'], $data['permissions']['club_year_id_array']);\n if ( $index === FALSE ){\n $returnData['errcode'] = 4;\n //TODO proper code\n $returnData['errno'] = 4000;\n $returnData['errstr'] = \"User is not associated with Club\";\n exitfnc($returnData);\n }\n}",
"public function test_manual_field_is_view_or_editable_with_edit_permissions_on_userset() {\n global $DB, $CFG;\n\n // Skip test if elis/program doesn't exist.\n if (!file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n $this->markTestSkipped('Requires elis/program to be installed.');\n }\n\n $this->resetAfterTest(true);\n $this->load_libraries_for_additional_tests();\n // Load CSV data.\n $this->load_csv_data();\n\n // Setup place holders for capabilities.\n $editcap = 'elis/program:user_edit';\n $viewcap = 'elis/program:user_view';\n\n // Retrieve the PM user id to be assigned to a userset.\n $param = array('id' => 103);\n $pmuserinusersetid = $DB->get_field('crlm_user', 'id', $param);\n\n // Retrieve the user who will be assigned a role in the user set.\n $param = array('id' => 101);\n $userroleinuserset = $DB->get_record('user', $param);\n // Set user with role as logged in user\n $this->setUser($userroleinuserset);\n\n // Get the userset context.\n $usersetcontext = context_elis_userset::instance(1);\n // System context.\n $syscontext = context_system::instance();\n\n // Create role and assign capabilites to it.\n $roleid = create_role('testrole', 'testrole', 'testrole');\n assign_capability($editcap, CAP_ALLOW, $roleid, $syscontext->id);\n\n // Assin role to user in the userset context.\n role_assign($roleid, $userroleinuserset->id, $usersetcontext->id);\n\n // Add user to cluster/userset.\n $usersetassign = new clusterassignment(array('clusterid' => 1, 'userid' => $pmuserinusersetid, 'plugin' => 'manual'));\n $usersetassign->save();\n\n $field = new field(array('id' => 101));\n $field->load();\n\n $result = manual_field_is_view_or_editable($field, $syscontext, $editcap, $viewcap, 'user', $pmuserinusersetid);\n\n $this->assertEquals(MANUAL_FIELD_EDITABLE, $result);\n }",
"function GetAttachedClubsByUserPermissionCheck($link, $data){\n}",
"public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }",
"public function test_manual_field_is_view_or_editable_with_view_permissions_on_userset() {\n global $DB, $CFG;\n\n // Skip test if elis/program doesn't exist.\n if (!file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n $this->markTestSkipped('Requires elis/program to be installed.');\n }\n\n $this->resetAfterTest(true);\n $this->load_libraries_for_additional_tests();\n // Load CSV data.\n $this->load_csv_data();\n\n // Setup place holders for capabilities.\n $editcap = 'elis/program:user_edit';\n $viewcap = 'elis/program:user_view';\n\n // Retrieve the PM user id to be assigned to a userset.\n $param = array('id' => 103);\n $pmuserinusersetid = $DB->get_field('crlm_user', 'id', $param);\n\n // Retrieve the user who will be assigned a role in the user set.\n $param = array('id' => 101);\n $userroleinuserset = $DB->get_record('user', $param);\n // Set user with role as logged in user\n $this->setUser($userroleinuserset);\n\n // Get the userset context.\n $usersetcontext = context_elis_userset::instance(1);\n // System context.\n $syscontext = context_system::instance();\n\n // Create role and assign capabilites to it.\n $roleid = create_role('testrole', 'testrole', 'testrole');\n assign_capability($viewcap, CAP_ALLOW, $roleid, $syscontext->id);\n\n // Assin role to user in the userset context.\n role_assign($roleid, $userroleinuserset->id, $usersetcontext->id);\n\n // Add user to cluster/userset.\n $usersetassign = new clusterassignment(array('clusterid' => 1, 'userid' => $pmuserinusersetid, 'plugin' => 'manual'));\n $usersetassign->save();\n\n $field = new field(array('id' => 101));\n $field->load();\n\n $result = manual_field_is_view_or_editable($field, $syscontext, $editcap, $viewcap, 'user', $pmuserinusersetid);\n\n $this->assertEquals(MANUAL_FIELD_VIEWABLE, $result);\n }",
"public function setUserAction($user_action){\r\n\t\t$this->userAction = $user_action;\r\n\t}",
"function _wp_personal_data_handle_actions()\n {\n }",
"function store($id, $group, $data)\n {\n return true;\n }",
"public function test_manual_field_is_view_or_editable_with_no_permissions_on_userset() {\n global $DB, $CFG;\n\n // Skip test if elis/program doesn't exist.\n if (!file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n $this->markTestSkipped('Requires elis/program to be installed.');\n }\n\n $this->resetAfterTest(true);\n $this->load_libraries_for_additional_tests();\n // Load CSV data.\n $this->load_csv_data();\n\n // Setup place holders for capabilities.\n $editcap = 'elis/program:user_edit';\n $viewcap = 'elis/program:user_view';\n\n // Retrieve the PM user id to be assigned to a userset.\n $param = array('id' => 103);\n $pmuserinusersetid = $DB->get_field('crlm_user', 'id', $param);\n\n // Retrieve the user who will be assigned a role in the user set.\n $param = array('id' => 101);\n $userroleinuserset = $DB->get_record('user', $param);\n // Set user with role as logged in user\n $this->setUser($userroleinuserset);\n\n // Get the userset context.\n $usersetcontext = context_elis_userset::instance(1);\n // System context.\n $syscontext = context_system::instance();\n\n // Create role and assign capabilites to it.\n $roleid = create_role('testrole', 'testrole', 'testrole');\n\n // Assin role to user in the userset context.\n role_assign($roleid, $userroleinuserset->id, $usersetcontext->id);\n\n // Add user to cluster/userset.\n $usersetassign = new clusterassignment(array('clusterid' => 1, 'userid' => $pmuserinusersetid, 'plugin' => 'manual'));\n $usersetassign->save();\n\n $field = new field(array('id' => 101));\n $field->load();\n\n $result = manual_field_is_view_or_editable($field, $syscontext, $editcap, $viewcap, 'user', $pmuserinusersetid);\n\n $this->assertEquals(MANUAL_FIELD_NO_VIEW_OR_EDIT, $result);\n }",
"public function test_do_action_funcname( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"function GetITEMRequstByClubPermissionCheck($link, $data){\n if ($data['admin'] == 1){\n //echo 'allowed';\n return;\n }\n $index = array_search ($data['club_year_id'], $data['permissions']['club_year_id_array']);\n if ( $index === FALSE ){\n $returnData['errcode'] = 4;\n //TODO proper code\n $returnData['errno'] = 4000;\n $returnData['errstr'] = \"User is not associated with Club\";\n exitfnc($returnData);\n }\n}",
"public function test_manual_field_is_view_or_editable_with_view_edit_permissions_on_userset() {\n global $DB, $CFG;\n\n // Skip test if elis/program doesn't exist.\n if (!file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n $this->markTestSkipped('Requires elis/program to be installed.');\n }\n\n $this->resetAfterTest(true);\n $this->load_libraries_for_additional_tests();\n // Load CSV data.\n $this->load_csv_data();\n\n // Setup place holders for capabilities.\n $editcap = 'elis/program:user_edit';\n $viewcap = 'elis/program:user_view';\n\n // Retrieve the PM user id to be assigned to a userset\n $param = array('id' => 103);\n $pmuserinusersetid = $DB->get_field('crlm_user', 'id', $param);\n\n // Retrieve the user who will be assigned a role in the user set.\n $param = array('id' => 101);\n $userroleinuserset = $DB->get_record('user', $param);\n // Set user with role as logged in user\n $this->setUser($userroleinuserset);\n\n // Get the userset context.\n $usersetcontext = context_elis_userset::instance(1);\n // System context.\n $syscontext = context_system::instance();\n\n // Create role and assign capabilites to it.\n $roleid = create_role('testrole', 'testrole', 'testrole');\n assign_capability($editcap, CAP_ALLOW, $roleid, $syscontext->id);\n assign_capability($viewcap, CAP_ALLOW, $roleid, $syscontext->id);\n\n // Assin role to user in the userset context.\n role_assign($roleid, $userroleinuserset->id, $usersetcontext->id);\n\n // Add user to cluster/userset.\n $usersetassign = new clusterassignment(array('clusterid' => 1, 'userid' => $pmuserinusersetid, 'plugin' => 'manual'));\n $usersetassign->save();\n\n $field = new field(array('id' => 101));\n $field->load();\n\n $result = manual_field_is_view_or_editable($field, $syscontext, $editcap, $viewcap, 'user', $pmuserinusersetid);\n\n $this->assertEquals(MANUAL_FIELD_EDITABLE, $result);\n }",
"public function test_ouwiki_core_calendar_provide_event_action_for_user() {\n // Create the activity.\n $course = $this->getDataGenerator()->create_course();\n $ouwiki = $this->getDataGenerator()->create_module('ouwiki', ['course' => $course->id]);\n\n // Enrol a student in the course.\n $student = $this->getDataGenerator()->create_and_enrol($course, 'student');\n\n // Create a calendar event.\n $event = $this->create_action_event($course->id, $ouwiki->id,\n \\core_completion\\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED);\n\n // Now, log out.\n $this->setUser($student);\n\n // Create an action factory.\n $factory = new \\core_calendar\\action_factory();\n\n // Decorate action event for the student.\n $actionevent = mod_ouwiki_core_calendar_provide_event_action($event, $factory, $student->id);\n\n // Confirm the event was decorated.\n $this->assertInstanceOf('\\core_calendar\\local\\event\\value_objects\\action', $actionevent);\n $this->assertEquals(get_string('view'), $actionevent->get_name());\n $this->assertInstanceOf('moodle_url', $actionevent->get_url());\n $this->assertEquals(1, $actionevent->get_item_count());\n $this->assertTrue($actionevent->is_actionable());\n }",
"public function hasPermission($action = \"\");",
"public function test_admin_delete_all_user_actions_with_not_existent_user_id() {\n\n // Generate allowed actions\n factory(\\App\\UserAction::class, 3)->create(['user_id' => $this->user->id]);\n\n // Generate info actions\n factory(\\App\\UserAction::class, 'info', 4)->create(['user_id' => $this->user->id]);\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/' . rand(1000, 9999) . '/delete-actions/all')\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.user_not_found')\n ]);\n }",
"public function testPostUpdatePermissionKeys() {\n // Login using root user.\n $this->drupalLogin($this->rootUser);\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that before updates the permission keys are in camelcase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertTrue($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertFalse($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertTrue($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertFalse($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n\n $this->runUpdates();\n\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that after updates the permission keys are in lowercase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertFalse($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertTrue($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertFalse($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertTrue($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n }",
"public function test_delete_data_for_users() {\n $component = 'core_tag';\n\n list($user1, $user2) = $this->set_up_tags();\n $usercontext1 = context_user::instance($user1->id);\n $user3 = $this->getDataGenerator()->create_user();\n $systemcontext = context_system::instance();\n\n $this->setUser($user2);\n useredit_update_interests($user2, ['basketball']);\n\n $this->setUser($user3);\n useredit_update_interests($user3, ['soccer']);\n\n $userlist = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(3, $userlist);\n $this->assertTrue(in_array($user1->id, $userlist->get_userids()));\n $this->assertTrue(in_array($user2->id, $userlist->get_userids()));\n $this->assertTrue(in_array($user3->id, $userlist->get_userids()));\n\n // Data should not be deleted in contexts other than system context.\n // Convert $userlist into an approved_contextlist.\n $approvedlist = new approved_userlist($usercontext1, $component, $userlist->get_userids());\n // Delete using delete_data_for_user.\n provider::delete_data_for_users($approvedlist);\n // Re-fetch users in systemcontext.\n $userlist = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist);\n // The user data in systemcontext should not be deleted.\n $this->assertCount(3, $userlist);\n\n // Add user1 and user2 into an approved_contextlist.\n $approvedlist = new approved_userlist($systemcontext, $component, [$user1->id, $user2->id]);\n // Delete using delete_data_for_user.\n provider::delete_data_for_users($approvedlist);\n // Re-fetch users in systemcontext.\n $userlist = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist);\n // The approved user data in systemcontext should be deleted.\n // The user list should return user3.\n $this->assertCount(1, $userlist);\n $this->assertTrue(in_array($user3->id, $userlist->get_userids()));\n }",
"public function testFilters_byUserNameAndGroupId()\n {\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 0);\n\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=m&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=2\");\n $this->assertEqual(count($this->vars['users']), 1);\n }",
"private function fetchaction($data)\n\t{\n\t\t$pattern = \"<input type=\\\"hidden\\\" name=\\\"Action\\\" id=\\\"Action\\\" value=\\\"\";\n\t\t$pos = strpos($data, $pattern);\n\t\tif($pos > -1)\n\t\t\t$this->action = substr($data, $pos + strlen($pattern), strpos(substr($data, $pos + strlen($pattern)), \"\\\"\"));\n\t}",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Log' => [\n\t\t\t\t\t\t\t'id' => '1'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"function user_action_user_edit($env, $vars) {\n $response_json = UserFactory::requestAction($env, $vars['data']['action'], $vars['data']);\n exit($response_json);\n}",
"public function getUserActionOccurrences($user, $actionCode);",
"public function groupContentEntityOperationAccessAlterHookTestProvider(): array {\n return [\n ['update'],\n ['delete'],\n ];\n }",
"public function isActionAllowed($section, $reference, $action = NULL) ;",
"public function testActions() {\n // Test default actions.\n $this->assertEntity('node_publish_action', 'Publish post', 'node', []);\n $this->assertEntity('node_make_sticky_action', 'Make post sticky', 'node', []);\n $this->assertEntity('user_block_user_action', 'Block current user', 'user', []);\n $this->assertEntity('comment_publish_action', 'Publish comment', 'comment', []);\n\n // Test advanced actions.\n $this->assertEntity('unpublish_comment_containing_keyword_s_', 'Unpublish comment containing keyword(s)', 'comment', [\"keywords\" => [0 => \"drupal\"]]);\n $this->assertEntity('change_the_author_of_a_post', 'Change the author of a post', 'node', [\"owner_uid\" => \"2\"]);\n $this->assertEntity('unpublish_post_containing_keyword_s_', 'Unpublish post containing keyword(s)', 'node', [\"keywords\" => [0 => \"drupal\"]]);\n $this->assertEntity('display_a_message_to_the_user', 'Display a message to the user', 'system', [\"message\" => \"Drupal migration test\"]);\n $this->assertEntity('send_e_mail', 'Send e-mail', 'system', [\n \"recipient\" => \"[email protected]\",\n \"subject\" => \"Drupal migration test\",\n \"message\" => \"Drupal migration test\",\n ]);\n $this->assertEntity('redirect_to_url', 'Redirect to URL', 'system', [\"url\" => \"https://www.drupal.org\"]);\n\n }",
"function userActionExamine( $actionRequest ) {\n\t$actionKeyword = strtok( $actionRequest, \" \" );\n\t$name = trim( strtok('') );\n\t\n\t$locations[]=$_SESSION['location'];\n\t$locations[]=$_SESSION['userID'];\n\t\n\tif( $name == \"here\" ) {\n\t\t$name = \"#\".$_SESSION['location'];\n\t}\n\t\n\t$entity = getEntity( $name );\n\t\n\tif( $entity ) {\n\t\t$response = $entity['name'] . \" (id #\" . $entity['id'] . \")\";\n\t\tforeach( $entity as $name=>$value ) {\n\t\t\tif( $name != \"id\" && $name != \"name\" ) {\n\t\t\t\t$response .= \"<br> \";\n\t\t\t\tif( empty($value) ) {\n\t\t\t\t\t$response.=$name;\n\t\t\t\t} else {\n\t\t\t\t\t$response.=$name.\" is \".$value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\taddNarrativeToXML($response);\n\t}\n\n}",
"function checkTeamAccess() {\n global $nkAction;\n\n if ($nkAction['actionType'] == 'edit') {\n require_once 'Includes/nkForm.php';\n\n $dministratorList = nkForm_loadSelectOptions(array(\n 'optionsName' => array('User', 'administrator')\n ));\n\n if (! $dministratorList) {\n printNotification(__('NO_ADMIN'), 'error');\n return false;\n }\n\n $teamList = nkForm_loadSelectOptions(array(\n 'optionsName' => array('Team', 'team')\n ));\n\n if (! $teamList) {\n printNotification(__('NO_TEAM'), 'error');\n return false;\n }\n }\n\n return true;\n}",
"function hook_permission_check($data) {\n\t\treturn false;\n\t}",
"public function testActionUseCase3()\n {\n\n // person, user, and target\n $user = factory(UserEloquent::class)->create();\n $person = factory(PersonEloquent::class)->create([\n 'is_pre_approved' => 0,\n 'is_primary' => 0,\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $stageId = StageEloquent::where('label', 'prospect')->where('user_id', null)->first()->getKey();\n $stageLeadId = StageEloquent::where('label', 'lead')->where('user_id', null)->first()->getKey();\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $stageId,\n 'lead_type_id' => $leadTypeId,\n ]);\n $tag = TagEloquent::find(10);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n\n // workflow, rule, action and object\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_pre_approved',\n 'value' => '1',\n ]);\n $action2 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'person_contexts',\n 'target_field' => 'stage_id',\n 'value' => $stageLeadId,\n ]);\n $workflow->actions()->sync([$action1->getKey(), $action2->getKey()]); //\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $tag->getKey(),\n ]);\n\n\n // // parent rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'not preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '0'\n ]);\n\n // dependent rule\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'is prospect person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $stageId,\n 'parent_id' => $rule1->getKey(),\n ]);\n $action1->rules()->sync([ $rule1->getKey()]);\n $action2->rules()->sync([ $rule2->getKey()]);\n\n\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n //// check should failed /////\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n 'info' => 'Dependent rule(s) not meet!',\n ]);\n $this->notSeeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n //// second run, run action 1 first /////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //echo $output->fetch();\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(),\n 'object_id' => $person->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('persons',[\n 'id' => $person->getKey(),\n $action1->target_field => $action1->value,\n ]);\n\n //// second run, run action 2 then ///\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $person);\n }",
"function check_userGroup($data, $op){\n $error = \"\";\n $id = $data['id'];\n\n if($op){\n if($id == 0){\n $error = \"Id cannot be 0!\";\n return $error;\n }\n\n if(strlen($data['username']) < 6 || strlen($data['username']) > 24 || strlen($data['password']) < 8 || strlen($data['password']) > 24){\n $error = \"Username and password must be at least 8 characters length and up to 24.\";\n return $error;\n }\n\n $username = $data['username'];\n $DB_check = selectQuery(TAB_USERS, \"id = $id OR username = '$username' OR email = '$email'\", \"\");\n if(count($DB_check) > 0){\n $error = \"User already exist!\";\n return $error;\n }\n\n }else{\n if(strlen($data['username']) < 6 || strlen($data['username']) > 24){\n $error = \"Username must be at least 6 characters length and up to 24.\";\n return $error;\n }\n\n if($data['password'] == \"\"){ // Password not modified\n $data['password'] = selectRecord(TAB_USERS, \"id = $id\")['password'];\n }else{\n if(strlen($data['password']) < 8 || strlen($data['password']) > 24){\n $error = \"Password must be at least 8 characters length and up to 24.\";\n return $error;\n }\n }\n }\n\n if(!(field_validation($data['username']) && field_validation($data['password'])) ){ // check the special characters\n $error = \"Username and password can not contain special characters or blank spaces\";\n return $error;\n }\n\n if(filter_var($data['email'], FILTER_VALIDATE_EMAIL)){\n $email = $data['email'];\n }else{\n $error = \"Email format is invalid.\";\n return $error;\n }\n\n return $data;\n}",
"public function __checkAuthentication($user, $action) {\n $action = $this->action;\n $authFlag = false;\n $role = $this->UserAuth->user(\"user_role\");\n switch ($role) {\n case 1001:\n if (in_array($action, $this->superadminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1002:\n if (in_array($action, $this->adminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1003:\n if (in_array($action, $this->instituteAdminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1004:\n if (in_array($action, $this->branchActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1005:\n if (in_array($action, $this->teacherActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1006:\n if (in_array($action, $this->accountantActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1007:\n if (in_array($action, $this->parentActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break; \n default:\n if (in_array($action, $this->guestActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n }\n\n if (!$authFlag) {\n $this->_setFlashMsgs(__('You are not authorized for this action'), 'danger');\n $this->redirect($this->UserAuth->redirect());\n return false;\n } else {\n return true;\n }\n return self::isAuthorized($user);\n }",
"public function testIndexGroupActionPostSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_LOG_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Log' => [\n\t\t\t\t\t\t\t'id' => ['1', '3']\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/logs/index', $opt);\n\t\t$this->checkFlashMessage(__('Selected tasks has been processed.'));\n\n\t\t$result = $this->Controller->Log->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}",
"public function testModifyData() {\n // Add\n $userId = $this->json('POST', self::USERS_RESOURCE . \"/\", ['name' => 'Alex'])\n ->assertResponseStatus(200)\n ->seeJsonStructure(['id', 'name'])\n ->decodeResponseJson()['id'];\n\n // Check\n $this->json('GET', self::USERS_RESOURCE . \"/$userId\")\n ->seeJson([\n 'id' => $userId,\n 'name' => 'Alex'\n ]);\n $this->seeInDatabase(self::USERS_TABLE, [\n 'name' => 'Alex'\n ]);\n\n // Modify\n $this->json('PATCH', self::USERS_RESOURCE . \"/$userId\", ['name' => 'Peter'])\n ->assertResponseStatus(200)\n ->seeJson(['name' => 'Peter']);\n\n // Check\n $this->json('GET', self::USERS_RESOURCE . \"/$userId\")\n ->seeJson(['name' => 'Peter']);\n $this->seeInDatabase(self::USERS_TABLE, [\n 'name' => 'Peter'\n ]);\n\n // Delete\n $this->json('DELETE', self::USERS_RESOURCE . \"/$userId\")\n ->assertResponseStatus(204);\n\n // Check\n $this->get(self::USERS_RESOURCE . \"/$userId\")->assertResponseStatus(404);\n $this->notSeeInDatabase(self::USERS_TABLE, ['id' => $userId]);\n }",
"public function testEditUser()\n {\n }",
"public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"function process_action($target, $action) {\n //implement if needed\n }",
"public function testAccess() {\n $this->initializePurgersService(['c']);\n $this->drupalGet(Url::fromRoute($this->route, ['id' => 'id0']));\n $this->assertResponse(403);\n $this->drupalLogin($this->adminUser);\n $this->drupalGet(Url::fromRoute($this->route, ['id' => 'id0']));\n $this->assertResponse(200);\n // Non-existing ID's also need to get passed through to the form because\n // else the submit would break exactly after the purger was deleted.\n $this->drupalGet(Url::fromRoute($this->route, ['id' => \"doesnotexist\"]));\n $this->assertResponse(200);\n }",
"public function testDeleteSupplierGroup()\n {\n }",
"function editGroupHandler1() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n ]);\n\n formatOutput(true, 'update success');\n}",
"public function testRenameGroup(){\n jAcl2DbUserGroup::updateGroup(self::$grpId3, 'newgroup3');\n self::$groups[2]['name']='newgroup3';\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n }",
"public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function testFilters_byUserNameOrGroupId()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 2); \n }",
"function forum_check_text_access($path, $itemtype, $this_id, $user, $group_id, $context_id){\n global $CFG, $USER;\n \n include_once(\"{$CFG->dirroot}/{$path}/lib.php\");\n\n // get the forum post and all related stuff\n $post = get_record('forum_posts', 'id', $this_id);\n $discussion = get_record('forum_discussions', 'id', $post->discussion);\n $context = get_record('context', 'id', $context_id);\n $cm = get_record('course_modules', 'id', $context->instanceid);\n // $cm = get_coursemodule_from_instance('forum', $discussion->forum, $discussion->course);\n // $context = get_context_instance(CONTEXT_MODULE, $cm->id);\n if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : hidden forum resource \";\n return false;\n }\n \n // approval check : entries should be approved for being viewed, or belongs to the user \n if (($post->userid != $USER->id) && !$post->mailed && !has_capability('mod/forum:viewhiddentimeposts', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : time hidden forum item\";\n return false;\n }\n\n // group check : entries should be in accessible groups\n $current_group = get_current_group($discussion->course);\n $course = get_record('course', 'id', $discussion->course);\n if ($group_id >= 0 && (groupmode($course, $cm) == SEPARATEGROUPS) && ($group_id != $current_group) && !has_capability('mod/forum:viewdiscussionsfromallgroups', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : separated grouped forum item\";\n return false;\n }\n \n return true;\n}",
"public function testShowSupplierGroup()\n {\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"function user_can_edit_user($user_id, $other_user)\n {\n }",
"function editGroupHandler() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n 'admin_id' => getLogin()['uid']\n ]);\n\n formatOutput(true, 'update success');\n}",
"function check_and_add_to_group($userid, $group_id)\r\n{\r\n if ( !BP_Groups_Member::check_is_member( $userid, $group_id ) ) {\r\n // make sure the user isn't banned from the group!\r\n if ( !groups_is_user_banned( $userid, $group_id ) ) {\r\n // add the group already!\r\n $user_id = $userid;\r\n\r\n if ( groups_check_user_has_invite( $user_id, $group_id ) ) {\r\n groups_delete_invite( $user_id, $group_id );\r\n }\r\n\r\n $new_member = new bp_groups_member;\r\n $new_member->group_id = $group_id;\r\n $new_member->inviter_id = 0;\r\n $new_member->user_id = $user_id;\r\n $new_member->is_admin = 0;\r\n $new_member->user_title = '';\r\n $new_member->date_modified = time();\r\n $new_member->is_confirmed = 1;\r\n\r\n if ( !$new_member->save() ) {\r\n return false;\r\n }\r\n\r\n // Should I add this to the activity stream? left off for now\r\n\r\n /* Modify group meta */\r\n groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );\r\n groups_update_groupmeta( $group_id, 'last_activity', time() );\r\n }\r\n }\r\n\r\n return false;\r\n}",
"public function testGetStepsWithOuterScopePersistence()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);\n }",
"private function permissionCheck($action){\n\n\t\tglobal $checkgroup, $checkmod;\n\t\t\n\t\t#autmatically fail check if user is a guest, and its not set to public.\n\t\tif(($this->user == \"guest\") AND ($action != 0)){\n\t\t $permissionChk = false;\n\t\t}else{\n\t\t\tif($checkmod == 1){\n\t\t\t\t$permissionChk = true;\n\t\t\t}else{\n\t\t\t\tif(($action == 1) AND ($this->groupAccessLevel() == 1)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif(($action == 2) AND ($this->groupAccessLevel() == 1) or ($this->groupAccessLevel() == 2)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif(($action == 3) AND ($this->groupAccessLevel() == 3) or ($this->groupAccessLevel() == 2) or ($this->groupAccessLevel() == 1)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif($action == 4){\n\t\t\t\t\t$permissionChk = false;\n\t\t\t\t}elseif(($action == 5) and ($checkgroup == 1) or ($this->groupAccessLevel() == 1) or ($checkmod == 1)){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}elseif($action == 0){\n\t\t\t\t\t$permissionChk = true;\n\t\t\t\t}else{\n\t\t\t\t\t$permissionChk = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn($permissionChk);\n\t}",
"function actions_add($user, $actiontype_name, $replace = array(), $action_media = array(), $timeframe = 0, $replace_media = false, $action_object_owner = \"\", $action_object_owner_id = 0, $action_object_privacy = 0)\n {\n\t global $database, $setting;\n \n\t // GET CURRENT DATE\n\t $nowdate = time();\n \n\t // GET ACTIONTYPE INFO\n\t $actiontype_info = $database->database_fetch_assoc($database->database_query(\"SELECT * FROM se_actiontypes WHERE actiontype_name='$actiontype_name' LIMIT 1\"));\n \n\t // DONT PUBLISH IF PRIVACY IS TURNED ON AND USER DISALLOWED THIS ACTION TYPE, OR IS NOT ENABLED BY ADMIN\n\t $user->user_settings();\n\t $dontpublish_array = array_filter(explode(\",\", $user->usersetting_info['usersetting_actions_dontpublish']));\n \n $publish = ( $actiontype_info['actiontype_enabled'] && ( ($setting['setting_actions_privacy'] == 1 && !in_array($actiontype_info['actiontype_id'], $dontpublish_array)) || !$setting['setting_actions_privacy'] ) );\n \n\t // PUBLISH ACTION\n\t if( !$publish ) return;\n \n // DELETE OLDEST ACTION(S) FOR THIS USER IF MAX ACTIONS STORED PER USER IS REACHED\n $totalactions = $database->database_num_rows($database->database_query(\"SELECT action_id FROM se_actions WHERE action_user_id='{$user->user_info['user_id']}'\"));\n if( $totalactions>$setting['setting_actions_actionsonprofile'] )\n {\n $database->database_query(\"DELETE FROM se_actions WHERE action_user_id='{$user->user_info['user_id']}' ORDER BY action_id ASC LIMIT \".($totalactions-$setting['setting_actions_actionsonprofile']));\n \n // CLEANUP THE ACTION MEDIA TABLE\n $database->database_query(\"DELETE se_actionmedia.* FROM se_actionmedia LEFT JOIN se_actions ON se_actions.action_id=se_actionmedia.actionmedia_action_id WHERE action_id IS NULL\");\n }\n \n // GET PREVIOUS ACTION OF THE SAME TYPE WITH TIMEFRAME SPECIFICATIONS\n $difference = ( ($nowdate < $timeframe) ? 0 : $nowdate - $timeframe );\n \n $prev_query = $database->database_query(\"SELECT action_id FROM se_actions WHERE action_user_id='{$user->user_info['user_id']}' AND action_actiontype_id='{$actiontype_info['actiontype_id']}' AND action_date>'{$difference}' ORDER BY action_actiontype_id DESC LIMIT 1\");\n $update = (bool) $database->database_num_rows($prev_query);\n if( $update ) $prev = $database->database_fetch_assoc($prev_query);\n \n // SERIALIZE APPROPRIATE VARS\n $replace = array_map('stripslashes', $replace);\n $action_text = addslashes(serialize($replace));\n \n // UPDATE OLD ACTION\n if( $update )\n {\n $database->database_query(\"\n UPDATE se_actions\n SET action_date='{$nowdate}', \n action_text='{$action_text}',\n action_object_privacy='{$action_object_privacy}'\n WHERE action_id='{$prev['action_id']}' AND\n action_user_id='{$user->user_info['user_id']}' AND\n action_actiontype_id='{$actiontype_info['actiontype_id']}'\n \");\n \n // DELETE OLD MEDIA IF NECESSARY\n if( $replace_media )\n {\n $database->database_query(\"DELETE FROM se_actionmedia WHERE actionmedia_action_id='{$prev['action_id']}'\");\n }\n \n $action_id = $prev['action_id'];\n }\n \n // INSERT NEW ACTION\n else\n {\n $database->database_query(\"\n INSERT INTO se_actions (\n action_actiontype_id,\n action_date, \n action_user_id, \n action_text,\n action_object_owner,\n action_object_owner_id,\n action_object_privacy\n ) VALUES (\n '{$actiontype_info['actiontype_id']}',\n '{$nowdate}', \n '{$user->user_info['user_id']}', \n '{$action_text}',\n '{$action_object_owner}',\n '{$action_object_owner_id}',\n '{$action_object_privacy}'\n )\n \");\n \n $action_id = $database->database_insert_id();\n }\n \n // INSERT MEDIA\n if( is_array($action_media) && !empty($action_media) && $action_id )\n {\n foreach( $action_media as $action_media_index=>$action_media_data )\n {\n $database->database_query(\"\n INSERT INTO se_actionmedia (\n actionmedia_action_id,\n actionmedia_path, \n actionmedia_link,\n actionmedia_width,\n actionmedia_height\n ) VALUES (\n '{$action_id}',\n '{$action_media_data['media_path']}', \n '{$action_media_data['media_link']}', \n '{$action_media_data['media_width']}',\n '{$action_media_data['media_height']}'\n )\n \");\n }\n }\n\t}",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }",
"public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function test_delete_data_for_users() {\n $this->resetAfterTest();\n\n $component = 'core_enrol';\n\n $user1 = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n $user3 = $this->getDataGenerator()->create_user();\n $course1 = $this->getDataGenerator()->create_course();\n $course2 = $this->getDataGenerator()->create_course();\n $coursecontext1 = context_course::instance($course1->id);\n $coursecontext2 = context_course::instance($course2->id);\n $systemcontext = context_system::instance();\n\n // Enrol user1 into course1.\n $this->getDataGenerator()->enrol_user($user1->id, $course1->id, null, 'manual');\n // Enrol user2 into course1.\n $this->getDataGenerator()->enrol_user($user2->id, $course1->id, null, 'manual');\n // Enrol user3 into course2.\n $this->getDataGenerator()->enrol_user($user3->id, $course2->id, null, 'manual');\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext1, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(2, $userlist1);\n\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext2, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n\n // Convert $userlist1 into an approved_contextlist.\n $approvedlist1 = new approved_userlist($coursecontext1, $component, $userlist1->get_userids());\n // Delete using delete_data_for_user.\n provider::delete_data_for_users($approvedlist1);\n // Re-fetch users in coursecontext1.\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext1, $component);\n provider::get_users_in_context($userlist1);\n // The user data in coursecontext1 should be deleted.\n $this->assertCount(0, $userlist1);\n\n // Re-fetch users in coursecontext2.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext2, $component);\n provider::get_users_in_context($userlist2);\n // The user data in coursecontext2 should be still present.\n $this->assertCount(1, $userlist2);\n\n // Convert $userlist2 into an approved_contextlist in the system context.\n $approvedlist2 = new approved_userlist($systemcontext, $component, $userlist2->get_userids());\n // Delete using delete_data_for_user.\n provider::delete_data_for_users($approvedlist2);\n // Re-fetch users in coursecontext1.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext2, $component);\n provider::get_users_in_context($userlist2);\n // The user data in systemcontext should not be deleted.\n $this->assertCount(1, $userlist2);\n }",
"function GetITEMByClubPermissionCheck($link, $data){\n if ($data['admin'] == 1){\n //echo 'allowed';\n return;\n }\n $index = array_search ($data['club_year_id'], $data['permissions']['club_year_id_array']);\n if ( $index === FALSE ){\n $returnData['errcode'] = 4;\n //TODO proper code\n $returnData['errno'] = 4000;\n $returnData['errstr'] = \"User is not associated with Club\";\n exitfnc($returnData);\n }\n}",
"function insert_userGroup($data){\n $user = array();\n $user_group = array();\n\n // Insert user\n $user['id'] = $data['id'];\n $user['username'] = $data['username'];\n $user['password'] = md5($data['password']);\n $user['email'] = $data['email'];\n insertRecord(TAB_USERS, $user);\n\n // Insert user-role\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $user_group['userId'] = $data['id'];\n $user_group['groupId'] = $data['group'];\n insertRecord(TAB_USR_ROLE, $user_group);\n if($group['id'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}",
"function isAuthorized($type = null, $object = null, $user = null)\n {\n $valid = parent::isAuthorized($type, $object, $user);\n \n if(!$valid && $type == 'actions' && $this->user($this->parentModel))\n {\n // get the groups from the Session, and set the proper Aro path\n $otherRoles = $this->user($this->parentModel);\n $valid = $this->Acl->check(array($this->parentModel => array('id' => $otherRoles)), $this->action()); \n\t\t} \n return $valid;\n }",
"public function testGroupContentRespectUnpublishedArgument() {\n $view = Views::getView('test_moderated_group_content');\n $view->setDisplay();\n\n /** @var \\Drupal\\user\\UserInterface$user1 */\n $user1 = $this->container->get('current_user')->getAccount();\n\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group1 */\n $group1 = Group::create([\n 'type' => 'default',\n 'label' => $this->randomMachineName(),\n ]);\n $group1->save();\n\n /** @var \\Drupal\\node\\Entity\\Node $node1 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node1',\n 'moderation_state' => 'draft',\n ])->save();\n $node1 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node1']\n );\n $node1 = current($node1);\n\n /** @var \\Drupal\\node\\Entity\\Node $node2 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node2',\n 'moderation_state' => 'published',\n ])->save();\n $node2 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node2']\n );\n $node2 = current($node2);\n $group1->addContent($node1, 'group_node:default');\n $group1->addContent($node2, 'group_node:default');\n $group1->addMember($user1);\n\n $view->preview();\n $this->assertEquals(0, count($view->result), 'No results when group id argument is not present.');\n $view->destroy();\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Member can see their own unpublished content.');\n\n $user2 = User::create(['name' => $this->randomString()]);\n $user2->save();\n $this->container->get('current_user')->setAccount($user2);\n\n /** @var \\Drupal\\node\\Entity\\Node $node3 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node3',\n 'moderation_state' => 'draft',\n ])->save();\n $node3 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node3']\n );\n $node3 = current($node3);\n $group1->addContent($node3, 'group_node:default');\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Outsider can see their own unpublished content.');\n $view->destroy();\n\n $this->container->get('current_user')->setAccount($user1);\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(2, count($view->result), 'Member can see any (own + outsiders) unpublished content.');\n $view->destroy();\n\n }",
"function group_membership_menu_setup($hook, $type, $return, $params) {\n\n\t$user = elgg_extract('entity', $params);\n\t$group = elgg_extract('group', $params, elgg_get_page_owner_entity());\n\n\tif (!$user instanceof ElggUser || !$group instanceof ElggGroup) {\n\t\treturn;\n\t}\n\n\t$identifier = is_callable('group_subtypes_get_identifier') ? group_subtypes_get_identifier($group) : 'groups';\n\n\tif ($group->isMember($user)) {\n\t\tif ($group->canEdit()) {\n\t\t\tif (($admin = check_entity_relationship($user->guid, 'group_admin', $group->guid)) || $group->owner_guid == $user->guid) {\n\t\t\t\t// subtitle element will be added identifying group administrator\n\t\t\t\tif ($admin && $user->guid != elgg_get_logged_in_user_guid()) {\n\t\t\t\t\t$return[] = ElggMenuItem::factory(array(\n\t\t\t\t\t\t\t\t'name' => \"$identifier:removeadmin\",\n\t\t\t\t\t\t\t\t'href' => \"action/groups/remove_admin?user_guid={$user->guid}&group_guid={$group->guid}\",\n\t\t\t\t\t\t\t\t'text' => elgg_echo(\"$identifier:removeadmin\"),\n\t\t\t\t\t\t\t\t'confirm' => true,\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$return[] = ElggMenuItem::factory(array(\n\t\t\t\t\t\t\t'name' => \"$identifier:removeuser\",\n\t\t\t\t\t\t\t'href' => \"action/groups/remove?user_guid={$user->guid}&group_guid={$group->guid}\",\n\t\t\t\t\t\t\t'text' => elgg_echo(\"$identifier:removeuser\"),\n\t\t\t\t\t\t\t'confirm' => true,\n\t\t\t\t));\n\t\t\t\t$return[] = ElggMenuItem::factory(array(\n\t\t\t\t\t\t\t'name' => \"$identifier:makeadmin\",\n\t\t\t\t\t\t\t'href' => \"action/groups/make_admin?user_guid={$user->guid}&group_guid={$group->guid}\",\n\t\t\t\t\t\t\t'text' => elgg_echo(\"$identifier:makeadmin\"),\n\t\t\t\t\t\t\t'confirm' => true,\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t} else if (check_entity_relationship($user->guid, 'membership_request', $group->guid)) {\n\n\t\t$return[] = ElggMenuItem::factory(array(\n\t\t\t'name' => \"$identifier:request:accept\",\n\t\t\t'href' => $url = \"action/groups/addtogroup?user_guid={$user->guid}&group_guid={$group->guid}\",\n\t\t\t'text' => elgg_echo(\"$identifier:request:accept\"),\n\t\t));\n\n\t\t$return[] = ElggMenuItem::factory(array(\n\t\t\t\t'name' => \"$identifier:request:decline\",\n\t\t\t\t'href' => \"action/groups/killrequest?user_guid={$user->guid}&group_guid={$group->guid}\",\n\t\t\t\t'confirm' => elgg_echo('groups:joinrequest:remove:check'),\n\t\t\t\t'text' => elgg_echo(\"$identifier:request:decline\"),\n\t\t));\n\t} else if (check_entity_relationship($group->guid, 'invited', $user->guid)) {\n\n\t\t$return[] = ElggMenuItem::factory(array(\n\t\t\t'name' => \"$identifier:invitation:revoke\",\n\t\t\t'text' => elgg_echo(\"$identifier:invitation:revoke\"),\n\t\t\t'href' => \"action/groups/killinvitation?user_guid={$user->guid}&group_guid={$group->guid}\",\n\t\t\t'confirm' => true,\n\t\t));\n\t}\n\n\treturn $return;\n}",
"private function modelCheckHelper(User $user, $action,Model $model=null){\n //Check at the model level\n $source=Source::where('type','model')->where('name',UserGroup::class)->first();\n if($source){\n //$access_string=Source::getTypeKey().':'.$source->id;\n if(!$this->perm->can($user,Source::class,$source->id,$action,$model)){\n return false;\n }\n }\n\n return true;\n }",
"function make_new_user_action_of_type($user_id, $action_type, $action_body) {\n global $db_actions;\n return sql_query(\"SELECT a.* FROM $db_actions as a WHERE a.action_type = '$action_type' AND a.user_id = $user_id\");\n}",
"function testGroupBySave() {\n $this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit');\n\n $edit = array(\n 'group_by' => TRUE,\n );\n $this->drupalPost('admin/structure/views/nojs/display/test_views_groupby_save/default/group_by', $edit, t('Apply'));\n\n $this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit');\n $this->drupalPost('admin/structure/views/view/test_views_groupby_save/edit', array(), t('Save'));\n\n $this->drupalGet('admin/structure/views/nojs/display/test_views_groupby_save/default/group_by');\n }",
"function flag_resource_user_follow($uid , $data){\n if($data[\"action\"] === \"follow\") $action = 1;\n elseif($data[\"action\"] === \"unfollow\") $action = 0;\n else return services_error(\"Unknown Action!\" , 406);\n $parameter = array(\n \"entity_id\" => $uid,\n \"entity_type\" => \"user\",\n \"table\" => \"users\",\n \"fid\" => 3,\n \"action\" => $action,\n \"entity\" => \"user\"\n );\n return flag_function($parameter);\n}",
"protected function _isAllowedAction($action)\n {\n return Mage::getSingleton('admin/session')->isAllowed('cms/magify_bannermanager/groups/' . $action);\n }",
"public function assign_to_manager($action) {\n\n\t\t$this->load->model('users');\n\n\t\t$post = $this->input->post();\n\n\t\t$user_id = $post['user_id'];\n\n\t\tswitch ($action) {\n\t\t\tcase 'assign':\n\t\t\t\t$manager_id = $post['manager'];\n\t\t\t\tbreak;\n\t\t\tcase 'unassign':\n\t\t\t\t$manager_id = NULL;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->users->assign_user_to_manager($manager_id,$user_id);\n\t\treturn true;\n\t}",
"public function test_delete_data_for_user() {\n global $DB;\n\n $this->resetAfterTest();\n $user1 = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n $user3 = $this->getDataGenerator()->create_user();\n $course1 = $this->getDataGenerator()->create_course();\n $course2 = $this->getDataGenerator()->create_course();\n $this->getDataGenerator()->enrol_user($user1->id, $course1->id, null, 'manual');\n $this->getDataGenerator()->enrol_user($user2->id, $course1->id, null, 'manual');\n $this->getDataGenerator()->enrol_user($user3->id, $course1->id, null, 'manual');\n $this->getDataGenerator()->enrol_user($user1->id, $course2->id, null, 'manual');\n\n // Get all user enrolments.\n $userenrolments = $DB->get_records('user_enrolments', array());\n $this->assertCount(4, $userenrolments);\n // Get all user enrolments match with user1.\n $userenrolments = $DB->get_records('user_enrolments', array('userid' => $user1->id));\n $this->assertCount(2, $userenrolments);\n // Delete everything for the user1 in the context course 1.\n $coursecontext1 = \\context_course::instance($course1->id);\n $approvedlist = new approved_contextlist($user1, 'core_enrol', [$coursecontext1->id]);\n provider::delete_data_for_user($approvedlist);\n // Get all user enrolments match with user.\n $userenrolments = $DB->get_records('user_enrolments', ['userid' => $user1->id]);\n $this->assertCount(1, $userenrolments);\n // Get all user enrolments accounts.\n $userenrolments = $DB->get_records('user_enrolments', array());\n $this->assertCount(3, $userenrolments);\n }",
"private function accessVaildator($permissionAction){\n\n\t\tglobal $db, $lang;\n\t\t\n\t\t#see if user is guest, if so, deny any requests.\n\t\tif($this->user == \"guest\"){\n\t\t\treturn (false);\n\t\t}else{\n\t\t\t#first lets make sure the permission profile used is valid.\n\t\t\t$db->SQL= \"SELECT id FROM ebb_permission_profile WHERE id='\".$this->getGroupProfile().\"'\";\n\t\t\t$permissionProfileChk = $db->affectedRows();\n\n\t\t\t#see if user ID is incorrect or Null.\n\t\t\tif(($permissionProfileChk == 0) and ($this->user !== \"guest\")){\n\t\t\t\t$error = new notifySys($lang['invalidprofile'], false, true, __FILE__, __LINE__);\n\t\t\t\t$error->genericError();\n\t\t\t}\n\n\t\t\t#lets also check to make sure the action requested is valid.\n\t\t\t$db->SQL = \"SELECT id FROM ebb_permission_actions WHERE id='$permissionAction'\";\n\t\t\t$permissionActionChk = $db->affectedRows();\n\n\t\t\tif($permissionActionChk == 0){\n\t\t\t\t$error = new notifySys($lang['invalidaction'], false, true, __FILE__, __LINE__);\n\t\t\t\t$error->genericError();\n\t\t\t}\n\n\t\t\t#see if user has correct permission to access requested permission.\n\t\t\t$db->SQL = \"SELECT set_value FROM ebb_permission_data WHERE profile='\".$this->getGroupProfile().\"' and permission='$permissionAction'\";\n\t\t\t$validatePermission = $db->fetchResults();\n\n\t\t\t#output value in script.\n\t\t\tif($validatePermission['set_value'] == 1){\n\t\t\t return(true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}",
"function friendGroupHandler() {\n global $inputs;\n\n insert('member_group_apply',[\n 'member_id' => getLogin()['mid'],\n 'group_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'apply success');\n}",
"public function matchUser( $data ){\n\t\t$success = parent::matchUser( $data );\n\n\t\tif ( $success ) {\n\t\t\treturn $this->createAnswer( 0, array(\"user\"=>$_SESSION,\"msg\"=>\"Do you have access\"));\n\t\t}else{\n\t\t\treturn $this->createAnswer( 1,\"Something went wrong\",403 );\n\t\t}\n\t}",
"public function dataAction() {\n parent::dataAction();\n }",
"public function testModificarCorrecto(){\n $user=User::find(1);\n $this->actingAs($user)\n ->visit('administracion/usuarios/modificar/2')\n ->type(\"prueba\",\"nombre\")\n ->select(1,'tipoUsuario')\n ->press('Modificar')\n ->see(\"El usuario ha sido modificado\");\n }",
"public function isAuthorized($user) {\n if ($this->action === 'apply' || $this->action === 'saveProject'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n } \n }\n \n if ($this->action === 'applied' || $this->action === 'saved'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n }\n }\n \n if ($this->action === 'add' || $this->action === 'applicants') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n \n if ($this->action === 'projects') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n\n if (in_array($this->action, array('edit', 'delete'))) {\n $projectId = (int) $this->request->params['pass'][0];\n if ($this->Project->isOwnedBy($projectId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}",
"function editMemberGroup($msg='', $group_id = null)\n {\n // ------------------------------------\n // Only super admins can administrate member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1) {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n $clone_id = Request::input('clone_id');\n\n // Incoming from a continue editing button?\n if (empty($group_id)) {\n $group_id = Request::input('group_id');\n }\n\n $id = (!empty($clone_id)) ? $clone_id : $group_id;\n\n // ------------------------------------\n // Fetch the Group's Data\n // ------------------------------------\n\n if (!empty($id)) {\n $group_data = (array) DB::table('member_groups')->where('group_id', $id)->first();\n $preferences = DB::table('member_group_preferences')->where('group_id', $id)->get();\n\n foreach($preferences as $row) {\n $group_data[$row->handle] = $row->value;\n }\n }\n\n if(empty($group_data['is_locked'])) {\n $group_data['is_locked'] = 'y';\n }\n\n // ------------------------------------\n // Group title\n // ------------------------------------\n\n $group_name = ($group_id == '') ? '' : $group_data['group_name'];\n $group_description = ($group_id == '') ? '' : $group_data['group_description'];\n\n if ($msg != '') {\n Cp::$body .= Cp::quickDiv('successMessage', $msg);\n }\n\n Cp::$body_props .= ' onload=\"showHideMenu(\\'group_name\\');\"';\n\n // ------------------------------------\n // Declare form and page heading\n // ------------------------------------\n\n $js = <<<EOT\n<script type=\"text/javascript\">\n var lastShownObj = '';\n var lastShownColor = '';\n function showHideMenu(objValue)\n {\n if (lastShownObj != '') {\n $('#' + lastShownObj+'_pointer a').first().removeAttr('style');\n\n $('#' + lastShownObj + '_on').css('display', 'none');\n }\n\n lastShownObj = objValue;\n lastShownColor = $('#' + lastShownObj+'_pointer a').first().css('color');\n\n $('#' + objValue + '_on').css('display', 'block');\n lastShownColor = $('#' + lastShownObj+'_pointer a').first().css('color', '#000')\n }\n</script>\nEOT;\n\n Cp::$body .= $js;\n\n $r = Cp::formOpen(\n [\n 'action' => 'C=Administration'.AMP.'M=members'.AMP.'P=updateMemberGroup'\n ]\n );\n\n if ($clone_id != '')\n {\n $group_name = '';\n $group_description = '';\n $r .= Cp::input_hidden('clone_id', $clone_id);\n }\n\n $r .= Cp::input_hidden('group_id', $group_id);\n\n // ------------------------------------\n // Group name form field\n // ------------------------------------\n\n $r .= '<div id=\"group_name_on\" style=\"display: none; padding:0; margin: 0;\">'.\n Cp::table('tableBorder', '0', '', '100%').\n '<tr>'.PHP_EOL.\n \"<td class='tableHeadingAlt' colspan='2'>\".\n NBS.__('members.group_name').\n '</tr>'.PHP_EOL.\n '<tr>'.PHP_EOL.\n Cp::td('', '40%').\n Cp::quickDiv('defaultBold', __('members.group_name')).\n '</td>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::input_text('group_name', $group_name, '50', '70', 'input', '100%').\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '<tr>'.PHP_EOL.\n Cp::td('', '40%', '', '', 'top').\n Cp::quickDiv('defaultBold', __('members.group_description')).\n '</td>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::input_textarea('group_description', $group_description, 10).\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</table>'.PHP_EOL.\n Cp::quickDiv('defaultSmall', '');\n\n // ------------------------------------\n // Top section of page\n // ------------------------------------\n\n if ($group_id == 1)\n {\n $r .= Cp::quickDiv('box', __('members.super_admin_edit_note'));\n }\n else\n {\n $r .= Cp::quickDiv('box', Cp::quickSpan('alert', __('members.warning')).' '.__('members.be_careful_assigning_groups'));\n }\n\n $r .= Cp::quickDiv('defaultSmall', '');\n\n $r .= '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Group lock\n // ------------------------------------\n\n $r .= '<div id=\"group_lock_on\" style=\"display: none; padding:0; margin: 0;\">';\n\n $r .= Cp::table('tableBorder', '0', '', '100%');\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('tableHeadingAlt', '', '2').__('members.group_lock').\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL;\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::quickDiv('alert', __('members.enable_lock')).\n Cp::quickDiv('littlePadding', __('members.lock_description')).\n '</td>'.PHP_EOL.\n Cp::td('', '40%');\n\n $selected = ($group_data['is_locked'] == 'y') ? true : false;\n\n $r .= __('members.locked').NBS.\n Cp::input_radio('is_locked', 'y', $selected).' ';\n\n $selected = ($group_data['is_locked'] == 'n') ? true : false;\n\n $r .= __('members.unlocked').NBS.\n Cp::input_radio('is_locked', 'n', $selected).' ';\n\n $r .= '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</table>'.PHP_EOL.\n '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Fetch the names and IDs of all weblogs\n // ------------------------------------\n\n $blog_names = [];\n $blog_ids = [];\n\n $query = DB::table('weblogs')\n ->orderBy('blog_title')\n ->select('weblog_id', 'site_id', 'blog_title')\n ->get();\n\n if ($id != 1)\n {\n foreach($query as $row)\n {\n $field = 'weblog_id_'.$row->weblog_id;\n\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n\n $blog_names[$field] = $row->blog_title;\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Fetch the names and IDs of all plugins\n // ------------------------------------\n\n $plugins = Plugins::list();\n $plugin_names = [];\n $plugin_ids = [];\n\n if ($id != 1)\n {\n foreach(Plugins::list() as $plugin)\n {\n $name = __(strtolower($plugin->plugin_name . '_plugin_name'));\n $name = str_replace('_', ' ', $name);\n $name = ($name == '' ? $plugin->plugin_name : $name);\n\n $field = 'plugin_name_'.$plugin->plugin_name;\n\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n\n $plugin_names[$field] = $name;\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Fetch the names and IDs of all Sites\n // ------------------------------------\n\n $site_cp_names = [];\n $site_offline_names = [];\n $site_ids = []; // Figure out where I am storing these\n\n if ($id != 1) {\n foreach(Site::sitesList() as $site) {\n\n $field = 'can_access_offline_site_id_'.$site->site_id;\n $site_offline_names[$field] = $site->site_name;\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n $group_data[$field] = $status;\n\n $field = 'can_access_cp_site_id_'.$site->site_id;\n $site_cp_names[$field] = $site->site_name;\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Assign clusters of member groups\n // - The associative value (y/n) is the default setting\n // ------------------------------------\n\n $G = static::$group_preferences;\n\n $G['cp_site_cp_access_privs'] = $site_cp_names;\n $G['cp_site_offline_privs'] = $site_offline_names;\n $G['cp_weblog_post_privs'] = $blog_names;\n $G['cp_plugin_access_privs'] = $plugin_names;\n\n // ------------------------------------\n // Super Admin Group cannot be edited\n // ------------------------------------\n\n if ($group_id == 1) {\n $G = ['mbr_account_privs' => ['include_in_authorlist' => 'n']];\n }\n\n // ------------------------------------\n // Assign items we want to highlight\n // ------------------------------------\n\n $alert = [\n 'can_view_offline_system',\n 'can_access_cp',\n 'can_admin_weblogs',\n 'can_admin_templates',\n 'can_delete_members',\n 'can_admin_mbr_groups',\n 'can_ban_users',\n 'can_admin_members',\n 'can_admin_preferences',\n 'can_admin_plugins',\n 'can_admin_utilities',\n 'can_edit_categories',\n 'can_delete_self'\n ];\n\n // ------------------------------------\n // Items that should be shown in an input box\n // ------------------------------------\n\n $tbox = [\n 'search_flood_control',\n 'mbr_delete_notify_emails'\n ];\n\n // ------------------------------------\n // Render the group matrix\n // ------------------------------------\n\n $special = ['cp_plugin_access_privs', 'cp_site_offline_privs', 'cp_site_cp_access_privs'];\n\n foreach ($G as $g_key => $g_val)\n {\n // ------------------------------------\n // Start the Table\n // ------------------------------------\n\n $r .= '<div id=\"'.$g_key.'_on\" style=\"display: none; padding:0; margin: 0;\">';\n $r .= Cp::table('tableBorder', '0', '', '100%');\n $r .= '<tr>'.PHP_EOL;\n\n $r .= \"<td class='tableHeadingAlt' id='\".$g_key.\"2' colspan='2'>\";\n $r .= NBS.__($g_key);\n $r .= '</tr>'.PHP_EOL;\n\n $i = 0;\n\n foreach($g_val as $key => $val)\n {\n if ( !in_array($g_key, $special) && ! isset($group_data[$key])) {\n $group_data[$key] = $val;\n }\n\n $line = __($key);\n\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_')\n {\n $line = __('members.can_post_in').Cp::quickSpan('alert', $blog_names[$key]);\n }\n\n if (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_')\n {\n\n $line = __('members.can_access_plugin').Cp::quickSpan('alert', $plugin_names[$key]);\n }\n\n if (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_')\n {\n $line = __('members.can_access_offline_site').Cp::quickSpan('alert', $site_offline_names[$key]);\n }\n\n if (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_')\n {\n $line = __('members.can_access_cp').Cp::quickSpan('alert', $site_cp_names[$key]);\n }\n\n $mark = (in_array($key, $alert)) ? Cp::quickSpan('alert', $line) : Cp::quickSpan('defaultBold', $line);\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('', '60%').\n $mark;\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '40%');\n\n if (in_array($key, $tbox))\n {\n $width = ($key == 'mbr_delete_notify_emails') ? '100%' : '100px';\n $length = ($key == 'mbr_delete_notify_emails') ? '255' : '5';\n $r .= Cp::input_text($key, $group_data[$key], '15', $length, 'input', $width);\n }\n else\n {\n $r .= __('cp.yes').NBS.\n Cp::input_radio($key, 'y', ($group_data[$key] == 'y') ? 1 : '').' ';\n\n $r .= __('cp.no').NBS.\n Cp::input_radio($key, 'n', ($group_data[$key] == 'n') ? 1 : '').' ';\n }\n\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n\n $r .= '</table>'.PHP_EOL;\n $r .= '</div>'.PHP_EOL;\n }\n\n // ------------------------------------\n // Submit button\n // ------------------------------------\n\n if (empty($group_id))\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::input_submit(__('cp.submit'))\n .NBS.\n Cp::input_submit(__('cp.submit_and_return'),'return')\n );\n }\n else\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::input_submit(__('members.update')).\n NBS.\n Cp::input_submit(__('members.update_and_return'), 'return')\n );\n }\n\n $r .= '</form>'.PHP_EOL;\n\n // ------------------------------------\n // Create Our All Encompassing Table of Weblog Goodness\n // ------------------------------------\n\n Cp::$body .= Cp::table('', '0', '', '100%');\n\n $menu = '';\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"group_name_pointer\">• '.\n Cp::anchor(\"#\", __('members.group_name'),'onclick=\"showHideMenu(\\'group_name\\');\"').\n '</span>');\n\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"group_lock_pointer\">• '.\n Cp::anchor(\"#\", __('members.security_lock'), 'onclick=\"showHideMenu(\\'group_lock\\');\"').\n '</span>');\n }\n\n // Sites Access\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_site_cp_access_privs_pointer\">• '.\n Cp::anchor(\"#\", __('members.cp_site_cp_access_privs'), 'onclick=\"showHideMenu(\\'cp_site_cp_access_privs\\');\"').\n '</span>'\n );\n }\n\n // Sites Access\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_site_offline_privs_pointer\">• '.\n Cp::anchor(\"#\", __('members.cp_site_offline_privs'), 'onclick=\"showHideMenu(\\'cp_site_offline_privs\\');\"').\n '</span>'\n );\n }\n\n\n foreach ($G as $g_key => $g_val)\n {\n if (in_array($g_key, $special)) {\n continue;\n }\n\n $menu .= Cp::quickDiv(\n 'navPad',\n ' <span id=\"'.$g_key.'_pointer\">• '.\n Cp::anchor(\n \"#\",\n __($g_key),\n 'onclick=\"showHideMenu(\\''.$g_key.'\\');\"'\n ).\n '</span>');\n }\n\n // Plugins\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_plugin_access_privs_pointer\">• '.\n Cp::anchor(\"#\", __('members.cp_plugin_access_privs'), 'onclick=\"showHideMenu(\\'cp_plugin_access_privs\\');\"').\n '</span>'\n );\n }\n\n // ------------------------------------\n // Compile all of it into output\n // ------------------------------------\n\n $title = (!empty($id)) ? __('members.edit_member_group') : __('members.create_member_group');\n\n $first_text = Cp::div('tableHeadingAlt').\n $title.\n '</div>'.PHP_EOL.\n Cp::div('profileMenuInner', '', 'membersMenu').\n $menu.\n '</div>'.PHP_EOL;\n\n // Create the Table\n $table_row = [\n 'first' => ['valign' => \"top\", 'width' => \"220px\", 'text' => $first_text],\n 'second' => ['class' => \"default\", 'width' => \"8px\"],\n 'third' => ['valign' => \"top\", 'text' => $r]\n ];\n\n Cp::$body .= Cp::tableRow($table_row).\n '</table>'.PHP_EOL;\n\n Cp::$title = $title;\n\n if ($group_id != '')\n {\n Cp::$crumb =\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'area=members_and_groups',\n __('admin.members_and_groups')\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=mbr_group_manager',\n __('admin.member_groups')\n )\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=edit_mbr_group'.\n AMP.'group_id='.$group_data['group_id'],\n $title\n )\n ).\n Cp::breadcrumbItem($group_data['group_name']);\n }\n else\n {\n Cp::$crumb =\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'area=members_and_groups',\n __('admin.members_and_groups')\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=mbr_group_manager',\n __('admin.member_groups')\n )\n ).\n Cp::breadcrumbItem($title);\n }\n }",
"public function setActionState($data) {\n $this->checkActionState($data);\n $this->changeActionState($data);\n $this->refreshAuthWithAction($data->param1);\n }",
"public function testProfilePrototypeUpdateByIdOwnedGroups()\n {\n\n }",
"function handleAction($id,$action,$data, $con){\n switch ($action) {\n case \"recover_password\":\n // retreive user's email and password\n $result = mysqli_query(\n $con,\n \"SELECT `email`, `password` FROM `users` where username='$data'\");\n\n if($result->num_rows==1) {\n \n //send email to the user\n $row = $result->fetch_row();\n $email = $row[0];\n $password = $row[1];\n\n $msg = \"You may use this password in order to log in: $password\";\n $subject = \"Password Retrieval\";\n mail($email, $subject, $msg);\n\n // remove that record from the queue\n $result = mysqli_query(\n $con,\n \"DELETE FROM `queue` where id=$id\");\n }\n break;\n default:\n break;\n }\n }"
] | [
"0.56415707",
"0.560767",
"0.55470955",
"0.5546388",
"0.55276227",
"0.551038",
"0.5495411",
"0.5478038",
"0.54304695",
"0.54186237",
"0.53151965",
"0.5307277",
"0.53015924",
"0.5266049",
"0.5256501",
"0.5240287",
"0.5219782",
"0.52105296",
"0.51954484",
"0.5177729",
"0.515314",
"0.51523376",
"0.5136639",
"0.51234716",
"0.5117487",
"0.5117063",
"0.51128596",
"0.51078767",
"0.5105834",
"0.50854385",
"0.50767356",
"0.50752145",
"0.50615954",
"0.50531626",
"0.50490373",
"0.5044711",
"0.50422823",
"0.502988",
"0.5027576",
"0.50231916",
"0.50225407",
"0.50139",
"0.50092554",
"0.5007887",
"0.5003683",
"0.50032836",
"0.49994165",
"0.4998047",
"0.49979523",
"0.49973944",
"0.49898833",
"0.49892133",
"0.49832782",
"0.49829563",
"0.49807417",
"0.49798095",
"0.4977356",
"0.4976489",
"0.4975128",
"0.4974978",
"0.4973034",
"0.49689537",
"0.49687096",
"0.49621898",
"0.49599096",
"0.49594903",
"0.4956939",
"0.4952638",
"0.4950967",
"0.49467537",
"0.49462473",
"0.49409106",
"0.49407676",
"0.4940209",
"0.49322143",
"0.492777",
"0.4923697",
"0.49213937",
"0.49198407",
"0.4917228",
"0.49152288",
"0.49136308",
"0.49132723",
"0.49122956",
"0.4909736",
"0.489967",
"0.48919654",
"0.4891737",
"0.4890454",
"0.4889498",
"0.4884173",
"0.4884143",
"0.48837465",
"0.48761022",
"0.48647583",
"0.48639974",
"0.486197",
"0.48611757",
"0.48601",
"0.48600352",
"0.48556504"
] | 0.0 | -1 |
Tests a data reference in an action group replaced with a persisted reference. | public function testGetStepsWithPersistedArgs()
{
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);
// Simple Data
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])
->withArguments([new ArgumentObject('simple', null, 'string')])
->build();
$steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replace( $id, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( $this->get( $id, $group ) === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->set( $id, $data, $group, $expire );\n\t}",
"public function replace($key, $data, $group = 'default', $expire = 0)\n {\n $previousData = $this->get($key, $group);\n $key = $this->getInstanceKey($key, $group);\n $expire = $this->getExpirationTime($expire);\n\n $success = true;\n foreach ($this->mc as $mc) {\n if (!$mc->replace($key, $data, $expire)) {\n $success = false;\n }\n }\n\n // If success, set cache locally and return with success info\n if ($success) {\n $this->cache[$key] = $data;\n return true;\n }\n\n // If not, rollback to previous (ignoring errors for good)\n foreach ($this->mc as $mc) {\n $mc->set($key, $previousData, $expire);\n }\n\n return false;\n }",
"public function replace( $key, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( ! $this->_exists( $this->_key( $key, $group ) ) )\n\t\t\treturn false;\n\n\t\treturn $this->set( $key, $data, $group, (int) $expire );\n\t}",
"public function testRelatedGroupsAreSaved(): void\n {\n $items = Category::factory()->count(1)->create();\n $group = Group::factory()->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.groups', [$group->id])\n ->emit('save')\n ->assertOk()\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'success';\n });\n\n $this->assertEquals(1, $items[0]->groups()->count());\n }",
"function store($id, $group, $data)\n {\n return true;\n }",
"public function store($id, $group, $data)\n\t{\n\t\treturn true;\n\t}",
"function testObjReference() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n \r\n\t\t// Create an object to reference\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testGenSave\");\r\n\t\t$oid = $obj->save(false);\r\n\r\n\t\t// Create an activity with the reference\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", null, $this->user);\r\n\t\t$objAct->setValue(\"obj_reference\", \"customer:$oid\");\r\n\t\t$aid = $objAct->save(false);\r\n\t\t$this->assertTrue($aid > 0 );\r\n\t\tunset($objAct);\r\n\r\n\t\t// Close and then open again\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", $aid, $this->user);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n\t\tunset($objAct);\r\n\r\n\t\t// Test with the list cache\r\n\t\t$list = new CAntObjectList($dbh, \"activity\", $this->user);\r\n\t\t$list->addCondition(\"and\", \"id\", \"is_equal\", $aid);\r\n\t\t$list->getObjects();\r\n\t\t$this->assertEquals($list->getNumObjects(), 1);\r\n\t\t$objAct = $list->getObject(0);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n \r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\t$objAct->removeHard();\r\n\t}",
"public function testSaveDataScopeStore()\n {\n $this->entityModel->expects($this->once())->method('getNewSku')->will($this->returnValue([\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ]));\n $this->entityModel->expects($this->once())->method('getOldSku')->will($this->returnValue([\n 'sku_assoc2' => ['entity_id' => 3]\n ]));\n $attributes = ['position' => ['id' => 0], 'qty' => ['id' => 0]];\n $this->links->expects($this->once())->method('getAttributes')->will($this->returnValue($attributes));\n\n $bunch = [[\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]];\n $this->entityModel->expects($this->at(2))->method('getNextBunch')->will($this->returnValue($bunch));\n $this->entityModel->expects($this->any())->method('isRowAllowedToImport')->will($this->returnValue(true));\n $this->entityModel->expects($this->at(4))->method('getRowScope')->will($this->returnValue(\n \\Magento\\CatalogImportExport\\Model\\Import\\Product::SCOPE_DEFAULT\n ));\n $this->entityModel->expects($this->at(5))->method('getRowScope')->will($this->returnValue(\n \\Magento\\CatalogImportExport\\Model\\Import\\Product::SCOPE_STORE\n ));\n\n $this->links->expects($this->once())->method('saveLinksData');\n $this->grouped->saveData();\n }",
"public function testReplace()\n {\n $value = uniqid();\n $metaInfo = Metainfo::fromValue('test', $value);\n $metaInfo->setPackage($this->package);\n \n $this->repo->save($metaInfo, true);\n \n $remaining = $this->repo->findAll();\n $this->assertCount(1, $remaining);\n $info = current($remaining);\n $this->assertEquals($value, $info->getValue());\n }",
"public function replace($key, $data, $group = 'default', $expire = 0)\n {\n }",
"public function testOverwriteExistingImport()\n {\n $existinggroup = new Group();\n $existinggroup->Title = 'Old Group Title';\n $existinggroup->Code = 'newgroup1';\n $existinggroup->write();\n\n $loader = new GroupCsvBulkLoader();\n $results = $loader->load(__DIR__ . '/GroupCsvBulkLoaderTest/GroupCsvBulkLoaderTest.csv');\n\n $created = $results->Created()->toArray();\n $this->assertEquals(1, count($created));\n $this->assertEquals('newchildgroup1', $created[0]->Code);\n $this->assertEquals('New Child Group 1', $created[0]->Title);\n\n // This overrides the group because the code matches, which takes precedence over the ID.\n $updated = $results->Updated()->toArray();\n $this->assertEquals(1, count($updated));\n $this->assertEquals('newgroup1', $updated[0]->Code);\n $this->assertEquals('New Group 1', $updated[0]->Title);\n }",
"public function setReferenceFor(sfActions $action, $override_route_object=false, $override_key=false )\n {\n $key = $override_key!==false? $override_key:$action->getModuleName();\n $id = $override_route_object!==false? $override_route_object: $action->getRoute()->getObject()->getId();\n return $this->setAttribute(sprintf(self::$reference_key,$key),$id);\n }",
"function update( string $_group_key, IIndexedEntity $_entity ): bool;",
"public function testChangingReferenceName(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->setAlias('FavoritePost');\n $table->addBehavior(\n 'Translate',\n ['fields' => ['body'], 'referenceName' => 'Posts']\n );\n\n $items = $table->associations();\n $association = $items->getByProperty('body_translation');\n $this->assertNotEmpty($association, 'Translation association not found');\n\n $found = false;\n foreach ($association->getConditions() as $key => $value) {\n if (strpos($key, 'body_translation.model') !== false) {\n $found = true;\n $this->assertSame('Posts', $value);\n break;\n }\n }\n\n $this->assertTrue($found, '`referenceName` field condition on a Translation association was not found');\n }",
"public function testReplace()\n {\n $documentHandler = new DocumentHandler($this->connection);\n $result = $documentHandler->save($this->collection1->getName(), [ '_key' => 'test', 'value' => 'test' ]);\n static::assertEquals('test', $result);\n\n $trx = new StreamingTransaction($this->connection, [\n TransactionBase::ENTRY_COLLECTIONS => [\n TransactionBase::ENTRY_WRITE => [ $this->collection1->getName() ]\n ]\n ]);\n\n $trx = $this->transactionHandler->create($trx);\n $this->_shutdown[] = $trx;\n static::assertInstanceOf(StreamingTransaction::class, $trx);\n \n static::assertTrue(is_string($trx->getId()));\n\n $trxCollection = $trx->getCollection($this->collection1->getName());\n static::assertEquals($this->collection1->getName(), $trxCollection->getName());\n\n // document should be present inside transaction\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n\n // replace document inside transaction\n unset($doc->value);\n $doc->hihi = 'hoho';\n $result = $documentHandler->replaceById($trxCollection, 'test', $doc);\n static::assertTrue($result);\n\n // transactional lookup should find the modified document\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('hoho', $doc->hihi);\n static::assertObjectNotHasAttribute('value', $doc);\n \n // non-transactional lookup should still see the old document\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n static::assertObjectNotHasAttribute('hihi', $doc);\n \n // now commit\n static::assertTrue($this->transactionHandler->commit($trx->getId()));\n\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('hoho', $doc->hihi);\n static::assertObjectNotHasAttribute('value', $doc);\n }",
"public function testRenameGroup(){\n jAcl2DbUserGroup::updateGroup(self::$grpId3, 'newgroup3');\n self::$groups[2]['name']='newgroup3';\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n }",
"public function testGetStepsWithOuterScopePersistence()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);\n }",
"public function populateAsReference()\n {\n\n $orm = $this->db->getOrm();\n\n // Reference Container zum befüllen der Referenz Datensätze\n $refContainers = array();\n\n // Sicher stelle, das keine unerwarteten Daten in der Tabelle sind\n $orm->cleanResource('WbfsysRoleGroup');\n\n // Leeren des Caches\n $orm->clearCache();\n\n // global\n $orm->import\n (\n 'WbfsysRoleGroup',\n array\n (\n array\n (\n 'name' => 'name_1',\n 'access_key' => 'access_key_1',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisici elit,\nsed eiusmod tempor incidunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\naliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit\nesse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt\nmollit anim id est laborum.'\n ),\n )\n );\n\n }",
"function save($data, $group_id = false, $permission_data = null, $permission_action_data = null)\n {\n $success = false;\n\n if (!$group_id) {\n if ($this->db->insert('groups', $data)) {\n\n $data['group_id'] = $this->db->insert_id();\n\n // We have either inserted or updated a new employee, now lets set permissions.\n if ($data['group_id'] && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $data['group_id']));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// $this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $data['group_id']));\n\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $data['group_id']));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $data['group_id'];\n }\n return $success;\n }\n\n /* Update Group */\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', $data);\n\n if ($success && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $group_id));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $group_id));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $group_id));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t// \t$this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $group_id));\n\t\t\t\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $group_id));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $success;\n }",
"public function testReplace()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://original/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n $this->assertEquals(\n [\n 'http://original/'\n ],\n $this->getGraphs()\n );\n\n // replace graph\n $returnVal = $this->fixture->replace(false, 'http://original/', 'http://replacement/');\n\n // check triples\n $res = $this->fixture->query('SELECT * FROM <http://original/> WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // get available graphs\n $this->assertEquals(0, \\count($this->getGraphs()));\n\n $res = $this->fixture->query('SELECT * FROM <http://replacement/> WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // check return value\n $this->assertEquals(\n [\n [\n 't_count' => 2,\n 'delete_time' => $returnVal[0]['delete_time'],\n 'index_update_time' => $returnVal[0]['index_update_time']\n ],\n false\n ],\n $returnVal\n );\n }",
"public function saveRef($data)\n {\n $dispatcher = JDispatcher::getInstance();\n $table = $this->getTable('LabelRef');\n $key = $table->getKeyName();\n $pk = (!empty($data[$key])) ? $data[$key] : (int) $this->getState($this->getName() . '.id');\n $isNew = true;\n\n // Include the content plugins for the on save events.\n JPluginHelper::importPlugin('content');\n\n // Allow an exception to be thrown.\n try {\n // Load the row if saving an existing record.\n if ($pk > 0) {\n $table->load($pk);\n $isNew = false;\n }\n\n // Bind the data.\n if (!$table->bind($data)) {\n $this->setError($table->getError());\n return false;\n }\n\n // Prepare the row for saving\n $this->prepareTable($table);\n\n // Check the data.\n if (!$table->check()) {\n $this->setError($table->getError());\n return false;\n }\n\n // Trigger the onContentBeforeSave event.\n $result = $dispatcher->trigger($this->event_before_save, array($this->option . '.' . $this->name, &$table, $isNew));\n\n if (in_array(false, $result, true)) {\n $this->setError($table->getError());\n return false;\n }\n\n // Store the data.\n if (!$table->store()) {\n $this->setError($table->getError());\n return false;\n }\n\n // Clean the cache.\n $this->cleanCache();\n\n // Trigger the onContentAfterSave event.\n $dispatcher->trigger($this->event_after_save, array($this->option . '.' . $this->name, &$table, $isNew));\n }\n catch (Exception $e) {\n $this->setError($e->getMessage());\n return false;\n }\n\n $pkName = $table->getKeyName();\n\n if (isset($table->$pkName)) {\n $this->setState($this->getName() . '.id', $table->$pkName);\n }\n\n $this->setState($this->getName() . '.new', $isNew);\n\n return true;\n }",
"public function save()\n {\n // Do not save children, because they are fake objects\n if (false === $this->parent_target_group) {\n $pre_save_object = new self($this->target_group_id);\n\n $query = 'INSERT INTO ';\n if ($this->target_group_id > 0) {\n $query = 'UPDATE ';\n }\n $query .= rex::getTablePrefix().'d2u_courses_target_groups SET '\n .'`name` = \"'. addslashes($this->name) .'\", '\n .'picture = \"'. $this->picture .'\", '\n .'updatedate = CURRENT_TIMESTAMP ';\n if (rex_plugin::get('d2u_courses', 'kufer_sync')->isAvailable()) {\n $query .= ', kufer_categories = \"'. implode(PHP_EOL, $this->kufer_categories) .'\"'\n .', kufer_target_group_name = \"'. $this->kufer_target_group_name .'\"';\n }\n if ($this->target_group_id > 0) {\n $query .= ' WHERE target_group_id = '. $this->target_group_id;\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n\n if (0 === $this->target_group_id) {\n $this->target_group_id = (int) $result->getLastId();\n }\n\n if ($this->priority !== $pre_save_object->priority) {\n $this->setPriority();\n }\n\n if (!$result->hasError() && $pre_save_object->name !== $this->name) {\n d2u_addon_backend_helper::generateUrlCache('target_group_id');\n d2u_addon_backend_helper::generateUrlCache('target_group_child_id');\n }\n\n return !$result->hasError();\n }\n\n return false;\n\n }",
"function store($data, $id, $group = null)\n {\n // Get the default group\n $group = ($group) ? $group : $this->_options['defaultgroup'];\n\n // Get the storage handler and store the cached data\n $handler = $this->_getStorage();\n if ($handler != null && $this->_options['caching']) {\n return $handler->store($id, $group, $data);\n }\n return false;\n }",
"public function testSetWithReferenceNumber()\n {\n // Test default values\n $this->assertEquals('', $this->slipData->getReferenceNumber());\n $this->assertTrue($this->slipData->getWithReferenceNumber());\n\n // Set data when enabled, also check for returned instance\n $returned = $this->slipData->setReferenceNumber('0123456789');\n $this->assertInstanceOf('SwissPaymentSlip\\SwissPaymentSlip\\OrangePaymentSlipData', $returned);\n $this->assertEquals('0123456789', $this->slipData->getReferenceNumber());\n\n // Disable feature, also check for returned instance\n $returned = $this->slipData->setWithReferenceNumber(false);\n $this->assertInstanceOf('SwissPaymentSlip\\SwissPaymentSlip\\OrangePaymentSlipData', $returned);\n $this->assertFalse($this->slipData->getWithReferenceNumber());\n\n // Re-enable feature, using no parameter\n $this->slipData->setWithReferenceNumber();\n $this->assertTrue($this->slipData->getWithReferenceNumber());\n $this->assertEquals('', $this->slipData->getReferenceNumber());\n }",
"function set( $id, $data, $group = 'transient', $expire = 0 ) {\n\t\t$key = $this->_get_cache_key( $id );\n\n\t\tif ( is_object( $data ) ) {\n\t\t\t$data = clone $data;\n\t\t}\n\n\t\tlist( $fragment_group, $fragment_group_expiration, $fragment_group_global ) =\n\t\t\t$this->_fragment_group( $id, $group );\n\t\tif ( is_int( $fragment_group_expiration ) )\n\t\t\t$expire = $fragment_group_expiration;\n\n\t\t$this->cache[$fragment_group][$key] = $data;\n\n\t\tif ( $this->_caching &&\n\t\t\t!in_array( $group, $this->nonpersistent_groups ) ) {\n\t\t\t$cache = $this->_get_cache( $fragment_group_global );\n\n\t\t\t$v = array( 'content' => $data );\n\t\t\treturn $cache->set( $key, $v,\n\t\t\t\t( $expire ? $expire : $this->_lifetime ), $fragment_group );\n\t\t}\n\n\t\treturn true;\n\t}",
"public function testEdit() {\n\t\t$result = $this->CreditNote->edit('creditnote-1', null);\n\n\t\t$expected = $this->CreditNote->read(null, 'creditnote-1');\n\t\t$this->assertEqual($result['CreditNote'], $expected['CreditNote']);\n\n\t\t// put invalidated data here\n\t\t$data = $this->record;\n\t\t//$data['CreditNote']['title'] = null;\n\n\t\t$result = $this->CreditNote->edit('creditnote-1', $data);\n\t\t$this->assertEqual($result, $data);\n\n\t\t$data = $this->record;\n\n\t\t$result = $this->CreditNote->edit('creditnote-1', $data);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->CreditNote->read(null, 'creditnote-1');\n\n\t\t// put record specific asserts here for example\n\t\t// $this->assertEqual($result['CreditNote']['title'], $data['CreditNote']['title']);\n\n\t\ttry {\n\t\t\t$this->CreditNote->edit('wrong_id', $data);\n\t\t\t$this->fail('No exception');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t}",
"function wp_cache_replace($key, $data, $group = '', $expire = 0)\r\n\t{\r\n\t\tglobal $wp_object_cache;\r\n\t\tif (empty($group)) { $group = 'default'; }\r\n\t\treturn $wp_object_cache->replace($key, $data, $group, $expire);\r\n\t}",
"public function testUpdatingData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // new dummy data\n $new_dummy = array(\n 'label' => 'test update',\n 'message' => 'let me update this old data',\n );\n\n // do update our data\n $store->update($id, $new_dummy);\n\n // fetch single item from data by id\n $item = $store->read($id);\n\n // testing data\n $test = array($item['label'], $item['message']);\n\n // here we make a test that count diff values from data between 2 array_values\n $diff_count = count(array_diff(array_values($new_dummy), $test));\n $this->assertEquals(0, $diff_count);\n }",
"public function testEdit() {\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', null);\r\n\r\n\t\t$expected = $this->ShopProductAttribute->read(null, 'shopproductattribute-1');\r\n\t\t$this->assertEqual($result['ShopProductAttribute'], $expected['ShopProductAttribute']);\r\n\r\n\t\t// put invalidated data here\r\n\t\t$data = $this->record;\r\n\t\t//$data['ShopProductAttribute']['title'] = null;\r\n\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', $data);\r\n\t\t$this->assertEqual($result, $data);\r\n\r\n\t\t$data = $this->record;\r\n\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', $data);\r\n\t\t$this->assertTrue($result);\r\n\r\n\t\t$result = $this->ShopProductAttribute->read(null, 'shopproductattribute-1');\r\n\r\n\t\t// put record specific asserts here for example\r\n\t\t// $this->assertEqual($result['ShopProductAttribute']['title'], $data['ShopProductAttribute']['title']);\r\n\r\n\t\ttry {\r\n\t\t\t$this->ShopProductAttribute->edit('wrong_id', $data);\r\n\t\t\t$this->fail('No exception');\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->pass('Correct exception thrown');\r\n\t\t}\r\n\t}",
"public function replaceReferences($replaced, $replacement)\n\t{\n\t\t$table_name = $this->storeNameOf(get_class($replaced));\n\t\t$replaced_id = $this->getObjectIdentifier($replaced);\n\t\t$replacement_id = $this->getObjectIdentifier($replacement);\n\t\tif ($replaced_id && $replacement_id && $table_name) {\n\t\t\tforeach (Foreign_Key::buildReferences($this->connection, $table_name) as $foreign_key) {\n\t\t\t\t$foreign_table_name = lParse($foreign_key->getConstraint(), DOT);\n\t\t\t\t$foreign_field_name = $foreign_key->getFields()[0];\n\t\t\t\t$query = 'UPDATE ' . BQ . $foreign_table_name . BQ\n\t\t\t\t\t. LF . 'SET ' . BQ . $foreign_field_name . BQ . ' = ' . $replacement_id\n\t\t\t\t\t. LF . 'WHERE ' . BQ . $foreign_field_name . BQ . ' = ' . $replaced_id;\n\t\t\t\t$this->query($query);\n\t\t\t\tif ($this->connection->last_errno) {\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn isset($error) ? false : true;\n\t\t}\n\t\treturn false;\n\t}",
"private function __replaceReference($DBObject) {\n\t\tglobal $connect;\n\t\trequire_once('CORE/extensionManager.inc.php');\n\t\t$class_list = getReferenceTablesList($this->__table);\n\t\tforeach($class_list as $table=>$fieldname) {\n\t\t\trequire_once($this->getTableName($table));\n\t\t\t$class_name=\"DBObj_\".$table;\n\t\t\t$DBObjRefTarget=new $class_name;\n\t\t\t$item = $DBObjRefTarget->__DBMetaDataField[$fieldname];\n\t\t\tif (isset($item['params']['CascadeMerge']) && $item['params']['CascadeMerge']) {\n\t\t\t\t$DBObjRefTarget->$fieldname=$this->id;\n\t\t\t\t$nb1=$DBObjRefTarget->find();\n\t\t\t\t$DBObjRefTarget->fetch();\n\t\t\t\t\n\t\t\t\t$DBObjRefOther=new $class_name;\n\t\t\t\t$DBObjRefOther->$fieldname=$DBObject->id;\n\t\t\t\t$nb2=$DBObjRefOther->find();\n\t\t\t\t$DBObjRefOther->fetch();\n\n\t\t\t\tif (($nb1==1) && ($nb2==1) && ($DBObjRefTarget->id>0) && ($DBObjRefOther->id)) {\n\t\t\t\t\t$DBObjRefTarget->merge($DBObjRefOther);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trequire_once(\"CORE/Lucterios_Error.inc.php\");\n\t\t\t\t\tthrow new LucteriosException(IMPORTANT,\"Fusion impossible.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$q=\"UPDATE $table SET $fieldname=$this->id WHERE $fieldname=$DBObject->id\";\n\t\t\t\t$connect->execute($q,true);\n\t\t\t}\n\t\t}\n\t\tif($this->Heritage != \"\")\n\t\t\t$this->Super->__replaceReference($DBObject->Super);\n\t}",
"public function set($key, $data, $group = 'default', $expire = 0)\n {\n $key = $this->getInstanceKey($key, $group);\n\n // Cache for this request locally\n $this->cache[$key] = $data;\n\n // If the group is a non-memcached group we should'nt save it but return success\n if (in_array($group, $this->no_mc_groups)) {\n return true;\n }\n\n $expire = $this->getExpirationTime($expire);\n\n foreach ($this->mc as $mc) {\n if (!$mc->set($key, $data, $expire)) {\n $this->deleteByKey($key);\n return false;\n }\n }\n\n return true;\n }",
"public function saveEditedGroupData($group) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\n\t\t\tif($group instanceof iUmiFieldsGroup) {\n\t\t\t\t$group->setName($name);\n\t\t\t\t$group->setTitle($title);\n\t\t\t\t$group->setIsVisible($is_visible);\n\t\t\t\t$group->setIsActive(true);\n\t\t\t\t$group->setTip($tip);\n\t\t\t\t$group->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiFieldsGroup\");\n\t\t\t}\n\t\t}",
"public function set( $key, $data, $group = 'default', $expire = 0 ) {\n\t\t$id = $this->_key( $key, $group );\n\n\t\tif ( is_object( $data ) )\n\t\t\t$data = clone $data;\n\n\t\t$this->cache[ $id ] = $data;\n\n\t\tif ( $this->_should_persist( $group ) ) {\n\t\t\t# If this is an integer, store it as such. Otherwise, serialize it.\n\t\t\tif ( ! is_numeric( $data ) || intval( $data ) != $data ) {\n\t\t\t\t$data = serialize( $data );\n\t\t\t}\n\n\t\t\tif ( empty( $expire ) ) {\n\t\t\t\t$this->redis->set( $id, $data );\n\t\t\t} else {\n\t\t\t\t$this->redis->setex( $id, $expire, $data );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function testSavedExisting() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$cust = CAntObject::factory($dbh, \"customer\", null, $this->user);\r\n\t\t$grpd = $cust->addGroupingEntry(\"groups\", \"Unit Test Group\", \"e3e3e3\");\r\n\t\t$statd = $cust->addGroupingEntry(\"status_id\", \"Unit Test Status\", \"e3e3e3\");\r\n\t\t\r\n\t\t$g1 = $grpd['id'];\r\n\t\t$s1 = $statd['id'];\r\n\r\n\t\t// Manually insert a customer\r\n\t\t$result = $dbh->Query(\"insert into customers(name, status_id) values('big unit test', '$s1');select currval('customers_id_seq') as id;\");\r\n\t\t$cid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t\r\n\t\tif ($dbh->GetNumberRows($result))\r\n\t\t{\r\n\t\t\t$cid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t\t$dbh->Query(\"insert into customer_label_mem(customer_id, label_id) VALUES('$cid', '$g1');\");\r\n\t\t}\r\n\t\t\r\n\t\t// Save customer groups using CAntObject\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testSavedExisting\");\r\n\t\t$savedId = $obj->save(); \r\n\t\t$this->assertEquals($savedId, $cid);\r\n\t\tunset($obj);\r\n\t\t\r\n\t\t// Open and make sure the object has a value, then save it\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertEquals($obj->getForeignValue(\"groups\"), \"Unit Test Group\");\r\n\t\t$this->assertEquals($obj->getValue(\"status_id\"), $s1);\r\n\t\t$this->assertEquals($obj->getForeignValue(\"status_id\"), \"Unit Test Status\");\r\n\t\t$obj->save();\r\n\t\tunset($obj);\r\n\r\n\t\t// Open again and make sure the object has a value for groups\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$obj->save();\r\n\r\n\r\n\t\t// Now test with object references both with and with subtypes\r\n\t\t$act = CAntObject::factory($dbh, \"activity\", null, $this->user);\r\n\r\n\t\t// Manually insert an activity\r\n\t\t$result = $dbh->Query(\"insert into objects_activity_act(name, user_id) values('big unit test', '\".$this->user->id.\"');\r\n\t\t\t\t\t\t\t\tselect currval('objects_id_seq') as id;\");\r\n\t\t$aid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$field = $act->def->getField('obj_reference');\r\n\t\t$fieldUser = $act->def->getField('user_id');\r\n\t\t$dbh->Query(\"insert into object_associations(type_id, object_id, assoc_type_id, assoc_object_id, field_id) \r\n\t\t\t\t\t\tVALUES('\".$act->object_type_id.\"', '$aid', '\".$obj->object_type_id.\"', \r\n\t\t\t\t\t\t'$cid', '\".$field->id.\"');\");\r\n\t\t$dbh->Query(\"insert into object_associations(type_id, object_id, assoc_type_id, assoc_object_id, field_id) \r\n\t\t\t\t\t\tVALUES('\".$act->object_type_id.\"', '$aid', '\".$this->user->userObj->object_type_id.\"', \r\n\t\t\t\t\t\t'\".$this->user->id.\"', '\".$fieldUser->id.\"');\");\r\n\r\n\t\t$obj2 = new CAntObject($dbh, \"activity\", null, $this->user);\r\n $obj2->id = $aid;\r\n $obj2->load();\r\n\t\t$this->assertEquals($obj2->getValue(\"obj_reference\"), \"customer:$cid\");\r\n\t\t$this->assertEquals($obj2->getForeignValue(\"obj_reference\"), \"testSavedExisting\");\r\n\t\t$this->assertEquals($obj2->getValue(\"user_id\"), $this->user->id);\r\n\t\t$this->assertEquals($obj2->getForeignValue(\"user_id\"), $this->user->name);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->deleteGroupingEntry(\"groups\", $grpd['id']);\r\n\t\t$obj->deleteGroupingEntry(\"status_id\", $statd['id']);\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$act->removeHard();\r\n\t}",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"function isReferenceTo ( &$anObject ) {\n \t\t// Store the value of $anObject\n \t\t$temp = $anObject;\n \t\t\n \t\t// Set the value of $anObject to something unique and see if $this\n \t\t// has changed as well.\n\t\t$anObject = uniqid(\"test_ref\");\n\t\t$is_ref = ($anObject === $this);\n\t\t\n\t\t// Put back the original value.\n\t\t$anObject = $temp;\n \t\treturn $is_ref;\n \t}",
"public function testDereferenceBasic()\n {\n $src = 'success';\n $ref = &$src;\n $this->debug->log('ref', $ref);\n $src = 'fail';\n $output = $this->debug->output();\n $this->assertContains('success', $output);\n }",
"public function testReplaceAssociationsByObjects()\n {\n $this->fixtures('users', 'articles');\n\n $user = User::find($this->users('derek')->id);\n $this->assertTrue(count($user->articles) > 0);\n\n $article1 = Article::find($this->articles('testing_js')->id);\n $article2 = Article::find($this->articles('xml_rpc')->id);\n $user->replaceArticles(array($article1, $article2));\n\n $this->assertEquals($article1, $user->articles[0]);\n $this->assertEquals($article2, $user->articles[1]);\n\n // save, and make sure the association object is created\n $user->save();\n\n // make sure both were created, and are associated\n $user = User::find($this->users('derek')->id);\n $this->assertTrue($user instanceof User);\n \n $this->assertEquals(2, count($user->articles));\n\n $article1 = Article::find($this->articles('testing_js')->id);\n $article2 = Article::find($this->articles('xml_rpc')->id);\n $this->assertTrue($article1 instanceof Article);\n $this->assertTrue($article2 instanceof Article);\n\n $this->assertEquals($article1->user_id, $user->id);\n $this->assertEquals($article2->user_id, $user->id);\n }",
"public function testSaveIfObjectNew()\n {\n $attributeSetId = 42;\n $groupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $attributeSetMock = $this->createMock(\\Magento\\Eav\\Api\\Data\\AttributeSetInterface::class);\n\n $groupMock->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId);\n\n $attributeSetMock->expects($this->any())->method('getAttributeSetId')->willReturn(10);\n $this->setRepositoryMock->expects($this->once())\n ->method('get')\n ->with($attributeSetId)\n ->willReturn($attributeSetMock);\n\n $this->groupResourceMock->expects($this->once())->method('save')->with($groupMock);\n $this->assertEquals($groupMock, $this->model->save($groupMock));\n }",
"public function testMergeActions() {\n $contact = $this->contact('testAnyone');\n $action = new Actions;\n $action->actionDescription = \"TEST\";\n $action->visibility = 1;\n $action->associationType = \"contacts\";\n $action->associationId = $contact->id;\n $action->save();\n\n $model = new Contacts;\n foreach ($contact->attributes as $key => $val) {\n if ($key != 'id' && $key != 'nameId') {\n $model->$key = $val;\n }\n }\n $model->save();\n\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n\n $mergeData = $model->mergeActions($contact, true);\n\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n\n $model->unmergeActions($contact->id, $mergeData);\n\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n }",
"protected function _should_persist( $group ) {\n\t\treturn empty( $this->non_persistent_groups[ $group ] );\n\t}",
"public function rebuild($group_id);",
"public function isReplaceRelationship();",
"function delete( string $_group_key, IIndexedEntity $_entity ): bool;",
"public function testSettingCodeRepeatedly()\n {\n $group = $this->objFromFixture(Group::class, 'group1');\n $previousCode = $group->Code;\n $group->Code = $previousCode;\n $group->write();\n $this->assertEquals($previousCode, $group->Code);\n\n // Setting the code to a new code does modify it\n $group->Code = 'new-code';\n $group->write();\n $this->assertEquals('new-code', $group->Code);\n\n // The old code can be reused\n $group->Code = $previousCode;\n $group->write();\n $this->assertEquals($previousCode, $group->Code);\n }",
"public function test_3_2()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_3();\n\n $address = $out['person']->get_addresses()[1];\n\n $is_removed = $out['person']->remove_from_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($is_removed, 'Removed OK');\n\n $this->assert($out['person']->size_addresses() === 2, 'Has many has 2 objects');\n\n $this->assert($address->person_addresses_back === NULL, 'Backlink of removed object is NULL');\n }",
"public function store($data, $id, $group = null)\n\t{\n\t\t// Get the default group\n\t\t$group = ($group) ? $group : $this->_options['defaultgroup'];\n\n\t\t// Get the storage and store the cached data\n\t\t$handler = $this->_getStorage();\n\t\tif (!($handler instanceof Exception) && $this->_options['caching'])\n\t\t{\n\t\t\t$handler->_lifetime = $this->_options['lifetime'];\n\t\t\treturn $handler->store($id, $group, $data);\n\t\t}\n\t\treturn false;\n\t}",
"public function testRevert(): void\n {\n $this->model->apply();\n $this->model->revert(new DataObject());\n $this->assertEquals('', getenv('sample_fixture_three'));\n }",
"public function test_1_2()\n {\n global $Address;\n\n $out = SetupTestData::hasmany_save_1();\n\n $address = $out['person']->get_addresses()[1];\n\n $is_removed = $out['person']->remove_from_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($is_removed, 'Removed OK');\n\n $this->assert($out['person']->size_addresses() === 2, 'Has many has 2 objects');\n\n $this->assert($address->person_addresses_back === NULL, 'Backlink of removed object is NULL');\n }",
"public function testPersistence()\n\t{\n\t\t// $factory->depot_id = $this->depot->depot_id;\n\t\t// $factory->factory_type_id = $this->factoryType->factory_type_id;\n\t\t// $factory->save();\n\n\t\t// $this->assertTrue(Factory::findOne($factory->depot_id) !== null);\n\n\t\t// $factory->remarks = \"Remarks\";\n\t\t// $factory->save();\n\n\t\t// $this->assertTrue(Factory::findOne($factory->depot_id)->remarks == 'Remarks');\n\n\t\t// $factoryId = $factory->depot_id;\n\t\t// $factory->delete();\n\n\t\t// $this->assertTrue(Factory::findOne($factoryId) === null);\n\t}",
"public function testCanReplace()\n {\n self::$apcu = [];\n $this->sut->add('myKey', 'myValue');\n $this->assertTrue($this->sut->replace('myKey', 'myNewValue'));\n $this->assertSame('myNewValue', self::$apcu['myKey']);\n }",
"function changeRecord($hookName, $params) {\n\t\t$record =& $params[0];\n\t\t$row = $params[1];\n\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t$journal = $journalDao->getJournal($row['journal_id']);\n\t\t$openAIREDao =& DAORegistry::getDAO('OpenAIREDAO');\n\t\tif ($openAIREDao->isOpenAIREArticle($row['article_id'])) {\n\t\t\t$record->sets[] = $journal->getPath() . ':ec_fundedresources';\n\t\t}\n\t\treturn false;\t\n\t}",
"public function testSetGeneRef2() {\n\t\techo (\"\\n********************Test SetGeneRef()*******************************************************\\n\");\n\t\n\t\t$this->gene->setGeneRef ( FALSE );\n\t\t$this->assertFalse( $this->gene->getGeneRef () );\n\t}",
"public function testGroupContentEntityOperationAccessAlterHook(string $operation): void {\n // Check that our test user doesn't have access to edit or delete comments\n // in the group.\n // This is the default behavior for users that are not a group member.\n $this->assertFalse($this->userHasAccess($operation));\n\n // Now enable our hook which will alter the group content entity operation\n // access rules to allow moderators to edit and delete comments in all\n // groups. Since our user is a moderator they should now have access.\n \\Drupal::state()->set('og_test_group_content_entity_operation_access_alter', TRUE);\n $this->assertTrue($this->userHasAccess($operation));\n }",
"public function testImmutable(): void\n {\n //Value is empty\n $this->category->setCustomAttribute('custom_layout_update', false);\n $this->category->setOrigData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n\n //New value\n $this->category->setCustomAttribute('custom_layout_update', 'test');\n $this->category->setOrigData('custom_layout_update', null);\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n $this->category->setCustomAttribute('custom_layout_update', 'testNew');\n $this->category->setOrigData('custom_layout_update', 'test');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n\n //Removing a value\n $this->category->setCustomAttribute('custom_layout_update', '');\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n $this->assertNull($this->category->getCustomAttribute('custom_layout_update')->getValue());\n\n //Using old stored value\n //Saving old value 1st\n $this->recreateCategory();\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->category->setData('custom_layout_update', 'test');\n $this->category->save();\n $this->recreateCategory();\n $this->category = $this->categoryFactory->create(['data' => $this->category->getData()]);\n\n //Trying the same value.\n $this->category->setData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n //Trying new value\n $this->category->setData('custom_layout_update', 'test2');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n //Empty value\n $this->category->setData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n }",
"public function testCustomSave() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r1');\");\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r2');\");\r\n\r\n\t\t$result = $dbh->Query(\"select id from customer_labels limit 2\");\r\n\t\t$g1 = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$g2 = $dbh->GetValue($result, 1, \"id\");\r\n\r\n\t\t// Test mValue\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$obj->setMValue(\"groups\", $g1);\r\n\t\t$obj->setMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->removeMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t// Make sure mvalues reload and that we are not using too many queries to load the object\r\n\t\t// TODO: work on the dacl to only allow one query when loading an object\r\n\t\t$statBefore = $dbh->statNumQueries;\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"Test Assoc\");\r\n\t\t$this->assertFalse($obj->getMValueExists(\"groups\", $g2));\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertTrue(($dbh->statNumQueries-$statBefore)<=2); // Loading an object should never take more than 2 queries\r\n\t\t//echo \"<pre>Num Queries: \".($dbh->statNumQueries-$statBefore).\"</pre>\";\r\n\r\n\t\t// Test object_multi\r\n\t\t$cont = new CAntObject($dbh, \"contact_personal\", null, $this->user);\r\n\t\t$cont->setValue(\"first_name\", \"Test Personal Contact\");\r\n\t\t$contactId = $cont->save();\r\n\t\t$this->assertTrue($contactId > 0);\r\n\t\t$obj->debug = true;\r\n\t\t$obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false);\r\n \r\n // Test remove the mvalue\r\n $obj->removeMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n unset($obj);\r\n \r\n // Test remove all mvalues\r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false); // Make sure the mvalue was set\r\n $obj->removeMValues(\"associations\"); // now remove the mvalues\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n\r\n\t\t// Test object (with no type)\r\n\t\t$com = new CAntObject($dbh, \"comment\", null);\r\n\t\t$com->setValue(\"obj_reference\", \"contact_personal:$cid\");\r\n\t\t$comid = $com->save(false);\r\n\t\tunset($com);\r\n\t\t$com = new CAntObject($dbh, \"comment\", $comid);\r\n\t\t$this->assertEquals($com->getValue(\"obj_reference\"), \"contact_personal:$cid\");\r\n\t\t$com->removeHard();\r\n\t\t\r\n\t\t// Cleanup\r\n\t\t$cont->removeHard();\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r1';\");\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r2';\");\r\n\t}",
"function testResetOfExistsOnCreate() {\n\t\t$this->loadFixtures('Article');\n\t\t$Article =& new Article();\n\t\t$Article->id = 1;\n\t\t$Article->saveField('title', 'Reset me');\n\t\t$Article->delete();\n\t\t$Article->id = 1;\n\t\t$this->assertFalse($Article->exists());\n\n\t\t$Article->create();\n\t\t$this->assertFalse($Article->exists());\n\t\t$Article->id = 2;\n\t\t$Article->saveField('title', 'Staying alive');\n\t\t$result = $Article->read(null, 2);\n\t\t$this->assertEqual($result['Article']['title'], 'Staying alive');\n\t}",
"public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }",
"public function testDeleteSupplierGroup()\n {\n }",
"function admin_ui_edit_save( $group_id ) {\n\t\t$checkins_ok = !empty( $_POST['_group_checkins_activate'] ) ? $_POST['_group_checkins_activate'] : false ;\n\t\t\n\t\tif( !empty($checkins_ok) ){\n\t\t\t$success = groups_update_groupmeta( $group_id, 'checkins_ok', $checkins_ok );\n\t\t}\n\t\telse $success = groups_delete_groupmeta( $group_id, 'checkins_ok' );\n\t\t\n\t\t/* we don't want activities to lead to 404 */\n\t\tif( groups_get_groupmeta( $group_id, 'checkins_ok' ) != 1 )\n\t\t\tbp_checkins_group_disabled_checkins( $group_id );\n\t}",
"public function upsert($scheme, $identifyingData, $data);",
"protected function saveGroup($group) {\n\t\t$link = $this->getLink();\n\t\t$link->set($this->prefix, $group);\n\t}",
"public function testSaveIfObjectNotNew()\n {\n $attributeSetId = 42;\n $groupId = 20;\n $groupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $existingGroupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $attributeSetMock = $this->createMock(\\Magento\\Eav\\Api\\Data\\AttributeSetInterface::class);\n\n $groupMock->expects($this->exactly(2))->method('getAttributeSetId')->willReturn($attributeSetId);\n $groupMock->expects($this->exactly(2))->method('getAttributeGroupId')->willReturn($groupId);\n\n $attributeSetMock->expects($this->any())->method('getAttributeSetId')->willReturn(10);\n $this->setRepositoryMock->expects($this->once())\n ->method('get')\n ->with($attributeSetId)\n ->willReturn($attributeSetMock);\n $this->groupFactoryMock->expects($this->once())->method('create')->willReturn($existingGroupMock);\n $this->groupResourceMock->expects($this->once())->method('load')->with($existingGroupMock, $groupId);\n\n $existingGroupMock->expects($this->any())->method('getId')->willReturn($groupId);\n $existingGroupMock->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId);\n\n $this->groupResourceMock->expects($this->once())->method('save')->with($groupMock);\n $this->assertEquals($groupMock, $this->model->save($groupMock));\n }",
"function groups_collections_update($item, $selected_groups, $existing_groups, $relationship) {\n\t$add_groups = array_diff($selected_groups , $existing_groups);\n\t$rem_groups = array_diff($existing_groups, $selected_groups);\n\t\n\t$add_groups = array_unique($add_groups);\n\t$add_groups = array_values($add_groups);\n\t$rem_groups = array_unique($rem_groups);\n\t$rem_groups = array_values($rem_groups);\n\t$guid_two = $item->getguid();\n\t\n\tforeach($add_groups as $group){\n\t\t$guid_one = $group;\n\t\tif(!check_entity_relationship($guid_one, $relationship, $guid_two)){\n\t\t\tadd_entity_relationship($guid_one, $relationship, $guid_two);\n\t\t}\t\t\n\t}\n\tforeach($rem_groups as $group){\n\t\t$guid_one = $group;\n\t\tremove_entity_relationship($guid_one, $relationship, $guid_two);\n\t}\n}",
"public function groupContentEntityOperationAccessAlterHookTestProvider(): array {\n return [\n ['update'],\n ['delete'],\n ];\n }",
"public function ADStaff_Group_Meta_Save($GroupData){\n\t \n\t $result_key = parent::Initial_Result();\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t\t\n\t\t$group_meta = json_decode(base64_decode(str_replace('*','/',rawurldecode($GroupData))),true); \n\t\t\n\t\t// 檢查參數\n\t if(!isset($group_meta['name']) || !isset($group_meta['code'])){\n\t\t throw new Exception('_SYSTEM_ERROR_PARAMETER_FAILS');\n\t\t}\n\t\t\n\t\t// 執行更新\n\t\t$DB_UPD= $this->DBLink->prepare(SQL_AdStaff::RENEW_GROUP_META());\n\t\t$DB_UPD->bindValue(':ug_code' , $group_meta['code']);\n\t\t$DB_UPD->bindValue(':ug_name' , $group_meta['name']);\n\t\t$DB_UPD->bindValue(':ug_info' , $group_meta['info']);\n\t\t$DB_UPD->bindValue(':creater' , $this->USER->UserID);\n\t\t\n\t\tif(!$DB_UPD->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL'); \n\t\t}\n\t\t\n\t\t$result['action'] = true;\t\t\n\t\t$result['data'] = $group_meta['code'];\t\t\n\t \n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\n\t return $result;\n\t}",
"public function setDataAsRef(array &$data)\n {\n $this->data = &$data;\n }",
"public function testUpdateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testDeleteOnDelete() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_delete', array(1), $Action);\n\t}",
"public function testBackupIsRefreshed(): void\n {\n $fixtures = [\n 'Liip\\Acme\\Tests\\App\\DataFixtures\\ORM\\LoadDependentUserData',\n ];\n\n $this->databaseTool->loadFixtures($fixtures);\n\n // Load data from database\n /** @var User $user1 */\n $user1 = $this->userRepository->findOneBy(['id' => 1]);\n\n // Store random data, in order to check it after reloading fixtures.\n $user1Salt = $user1->getSalt();\n\n $dependentFixtureFilePath = static::$kernel->locateResource(\n '@AcmeBundle/DataFixtures/ORM/LoadUserData.php'\n );\n\n $dependentFixtureFilemtime = filemtime($dependentFixtureFilePath);\n\n // The backup service provide the path of the backup file\n $databaseFilePath = $this->sqliteDatabaseBackup->getBackupFilePath();\n\n if (!is_file($databaseFilePath)) {\n $this->fail($databaseFilePath.' is not a file.');\n }\n\n $databaseFilemtime = filemtime($databaseFilePath);\n\n sleep(2);\n\n // Reload the fixtures.\n $this->databaseTool->loadFixtures($fixtures);\n\n // The mtime of the file has not changed.\n $this->assertSame(\n $dependentFixtureFilemtime,\n filemtime($dependentFixtureFilePath),\n 'File modification time of the fixture has been updated.'\n );\n\n // The backup has not been updated.\n $this->assertSame(\n $databaseFilemtime,\n filemtime($databaseFilePath),\n 'File modification time of the backup has been updated.'\n );\n\n $user1 = $this->userRepository->findOneBy(['id' => 1]);\n\n // Check that random data has not been changed, to ensure that backup was created and loaded successfully.\n $this->assertSame($user1Salt, $user1->getSalt());\n\n sleep(2);\n\n // Update the filemtime of the fixture file used as a dependency.\n touch($dependentFixtureFilePath);\n\n $this->databaseTool->loadFixtures($fixtures);\n\n // The mtime of the fixture file has been updated.\n $this->assertGreaterThan(\n $dependentFixtureFilemtime,\n filemtime($dependentFixtureFilePath),\n 'File modification time of the fixture has not been updated.'\n );\n\n // The backup has been refreshed: mtime is greater.\n $this->assertGreaterThan(\n $databaseFilemtime,\n filemtime($databaseFilePath),\n 'File modification time of the backup has not been updated.'\n );\n\n $user1 = $this->userRepository->findOneBy(['id' => 1]);\n\n // Check that random data has been changed, to ensure that backup was not used.\n $this->assertNotSame($user1Salt, $user1->getSalt());\n }",
"public static function replaceGift($data) {\n\t\tif (!is_array($data)) return false;\n\t\treturn self::_getDao()->replace($data);\n\t}",
"public function test_2_3()\n {\n $out = SetupTestData::hasmany_save_2();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }",
"public function testValidationDefault() {\n\n $goodData = $this->goodData;\n $goodData['title'] = 'titletestValidationDefault';\n $link = $this->Links->newEntity();\n $link = $this->Links->patchEntity($link, $goodData);\n $this->Links->save($link);\n $insertedData = $this->Links->find('all')\n ->where(['Links.title =' => $goodData['title']])\n ->toArray()[0];\n // FIXME Pass this test\n //$this->assertNotNull($insertedData->views,'views is not null');\n $this->assertEquals(0, $insertedData->views,'views counter is set to 0');\n }",
"function setReference( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Reference = $value;\n }",
"function testGroupBySave() {\n $this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit');\n\n $edit = array(\n 'group_by' => TRUE,\n );\n $this->drupalPost('admin/structure/views/nojs/display/test_views_groupby_save/default/group_by', $edit, t('Apply'));\n\n $this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit');\n $this->drupalPost('admin/structure/views/view/test_views_groupby_save/edit', array(), t('Save'));\n\n $this->drupalGet('admin/structure/views/nojs/display/test_views_groupby_save/default/group_by');\n }",
"public function testUpdateLanguageGroup() {\n foreach ($this->testCases['LanguageGroup'] as $key => $testCase) {\n $langGroup = new LanguageGroup();\n $langGroup->setGroupName($testCase['group_name']);\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('updateLanguageGroup')\n ->will($this->returnValue(TRUE));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->updateLanguageGroup($langGroup);\n $this->assertTrue($result);\n }\n }",
"public function beforeUpdate()\n {\n $product = self::find($this->id);\n self::$product_group = $product->group_id;\n }",
"public function testUpdateSupplierGroup()\n {\n }",
"public function testCopyWithInjectionData() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$customSettings = array(\n\t\t\t'merge' => array(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'title' => 'INJECT changed this',\n\t\t\t\t\t'published' => 'X',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'insert' => array(\n\t\t\t\t'Comment.{n}.user_id' => 0,\n\t\t\t\t'Comment.{n}.comment' => 'INJECT changed via Hash::insert()',\n\t\t\t),\n\t\t);\n\t\t$result = $this->Article->copy(1, $customSettings);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\n\t\t// Inject changed expectations via Hash::merge()\n\t\t$expected['Article']['title'] = $customSettings['merge']['Article']['title'];\n\t\t$expected['Article']['published'] = $customSettings['merge']['Article']['published'];\n\t\t// Inject changed expectations via Hash::insert()\n\t\tforeach ($expected['Comment'] as $i => $data) {\n\t\t\t$expected['Comment'][$i]['user_id'] = $customSettings['insert']['Comment.{n}.user_id'];\n\t\t\t$expected['Comment'][$i]['comment'] = $customSettings['insert']['Comment.{n}.comment'];\n\t\t}\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testPutWithExistingData() {\n $data = ['nid' => 1, 'delta' => 0];\n $r1 = new Redirect([\n 'label' => 'First',\n 'filters' => [['test' => 1, 'type' => 'test']],\n ] + $data);\n $r2 = new Redirect(['label' => 'Second', 'weight' => 1] + $data);\n $r3 = new Redirect(['label' => 'Third', 'weight' => 2] + $data);\n $r1->save(); $r2->save(); $r3->save();\n\n $redirect_ids = [$r1->id, $r2->id, $r3->id];\n\n $fakenode = (object) ['nid' => 1];\n $endpoint = new Endpoint($fakenode, 0);\n\n $answer = $endpoint->put([\n 'redirects' => [\n ['label' => 'New first'],\n [\n 'id' => $r1->id,\n 'label' => 'Was first is now second',\n 'filters' => [\n ['id' => $r1->filters[0]->id, 'test' => 1, 'type' => 'test'],\n ],\n ],\n ['id' => $r2->id, 'label' => 'Was second is now third'],\n ],\n ])['redirects'];\n\n $a_labels = [];\n foreach ($answer as $m) {\n $a_labels[] = $m['label'];\n }\n $this->assertEqual([\n 'New first',\n 'Was first is now second',\n 'Was second is now third',\n ], $a_labels);\n $this->assertEqual($r2->id, $answer[2]['id']);\n\n $new_rs = array_values(Redirect::byNid($fakenode->nid, 0));\n $s_labels = [];\n foreach ($new_rs as $m) {\n $s_labels[] = $m->label;\n }\n $this->assertEqual([\n 'New first',\n 'Was first is now second',\n 'Was second is now third',\n ], $s_labels);\n $this->assertEqual($r2->id, $new_rs[2]->id);\n }",
"public function testSetGeneRef1() {\n\t\techo (\"\\n********************Test SetGeneRef()*******************************************************\\n\");\n\t\t\n\t\t$this->gene->setGeneRef ( TRUE );\n\t\t$this->assertTrue( $this->gene->getGeneRef () );\n\t}",
"function wp_cache_replace($key, $data, $group = '', $expire = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->replace($key, $data, $group, (int) $expire);\n}",
"public function re()\n {\n $this->bean->deleted = false;\n try {\n R::store($this->bean);\n return true;\n } catch (Exception $e) {\n Cinnebar_Logger::instance()->log($e, 'exceptions');\n return false;\n }\n }",
"public function testSetExportedEntity() {\n $entity = (object) [\n 'entity_type' => 'node',\n 'entity_id' => 1,\n 'entity_uuid' => '00000000-0000-0000-0000-000000000000',\n 'modified' => '2016-12-09T20:51:45+00:00',\n 'origin' => '11111111-1111-1111-1111-111111111111',\n ];\n\n $this->contentHubEntitiesTracking = $this->getContentHubEntitiesTrackingService();\n $this->contentHubEntitiesTracking->setExportedEntity($entity->entity_type, $entity->entity_id, $entity->entity_uuid, $entity->modified, $entity->origin);\n\n // Running basic tests.\n $this->assertEquals($entity->entity_type, $this->contentHubEntitiesTracking->getEntityType());\n $this->assertEquals($entity->entity_id, $this->contentHubEntitiesTracking->getEntityId());\n $this->assertEquals($entity->entity_uuid, $this->contentHubEntitiesTracking->getUuid());\n $this->assertEquals($entity->modified, $this->contentHubEntitiesTracking->getModified());\n $this->assertEquals($entity->origin, $this->contentHubEntitiesTracking->getOrigin());\n $this->assertTrue($this->contentHubEntitiesTracking->isInitiated());\n $this->assertFalse($this->contentHubEntitiesTracking->isExported());\n\n $this->contentHubEntitiesTracking->setExported();\n $this->assertFalse($this->contentHubEntitiesTracking->isInitiated());\n $this->assertTrue($this->contentHubEntitiesTracking->isExported());\n\n $modified = '2017-11-04T20:51:45+00:00';\n $this->contentHubEntitiesTracking->setModified($modified);\n $this->assertEquals($modified, $this->contentHubEntitiesTracking->getModified());\n\n // Assigning a Database Entity.\n $database_entity = [\n 'entity_type' => 'node',\n 'entity_id' => 1,\n 'entity_uuid' => '00000000-0000-0000-0000-111111112222',\n 'modified' => '2016-12-09T20:51:45+00:00',\n 'origin' => '11111111-1111-1111-1111-111111111111',\n 'status_export' => ContentHubEntitiesTracking::INITIATED,\n 'status_import' => '',\n ];\n\n $this->contentHubEntitiesTracking = $this->getContentHubEntitiesTrackingService($database_entity);\n\n // Trying to load an imported entity should return false.\n $this->assertFalse($this->contentHubEntitiesTracking->loadImportedByUuid($database_entity['entity_uuid']));\n\n // Loading an exported entity should work.\n $this->contentHubEntitiesTracking->loadExportedByUuid($database_entity['entity_uuid']);\n $this->assertEquals($database_entity['entity_type'], $this->contentHubEntitiesTracking->getEntityType());\n $this->assertEquals($database_entity['entity_id'], $this->contentHubEntitiesTracking->getEntityId());\n $this->assertEquals($database_entity['entity_uuid'], $this->contentHubEntitiesTracking->getUuid());\n $this->assertEquals($database_entity['modified'], $this->contentHubEntitiesTracking->getModified());\n $this->assertEquals($database_entity['origin'], $this->contentHubEntitiesTracking->getOrigin());\n $this->assertTrue($this->contentHubEntitiesTracking->isInitiated());\n $this->assertFalse($this->contentHubEntitiesTracking->isExported());\n }",
"public function testSetRefImage() {\n\n $obj = new Materiels();\n\n $obj->setRefImage(\"refImage\");\n $this->assertEquals(\"refImage\", $obj->getRefImage());\n }",
"public function testQuarantineUpsert()\n {\n\n }",
"public function canReplaceAValueByAnother()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $expect = array($object0, $object1, $object0);\n $this->assertAttributeEquals($expect, 'content', $this->object);\n $this->object->searchAndReplace($object0, $object1);\n $expect = array($object1, $object1, $object1);\n $this->assertAttributeEquals($expect, 'content', $this->object);\n }",
"public function test_2_2()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_2();\n\n $address = $out['person']->get_addresses()[1];\n\n $is_removed = $out['person']->remove_from_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($is_removed, 'Removed OK');\n\n $this->assert($out['person']->size_addresses() === 2, 'Has many has 2 objects');\n\n $this->assert($address->person_addresses_back === NULL, 'Backlink of removed object is NULL');\n }",
"public function restore($id): bool;",
"public function testSaveThrowExceptionIfCannotSaveGroup()\n {\n $attributeSetId = 42;\n $groupId = 20;\n $groupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $existingGroupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $attributeSetMock = $this->createMock(\\Magento\\Eav\\Api\\Data\\AttributeSetInterface::class);\n $groupMock->expects($this->any())->method('getAttributeSetId')->willReturn($attributeSetId);\n $groupMock->expects($this->any())->method('getAttributeGroupId')->willReturn($groupId);\n $attributeSetMock->expects($this->any())->method('getAttributeSetId')->willReturn(10);\n $this->setRepositoryMock->expects($this->once())->method('get')->with($attributeSetId)\n ->willReturn($attributeSetMock);\n $this->groupFactoryMock->expects($this->once())->method('create')->willReturn($existingGroupMock);\n $this->groupResourceMock->expects($this->once())->method('load')->with($existingGroupMock, $groupId);\n $existingGroupMock->expects($this->any())->method('getId')->willReturn($groupId);\n $existingGroupMock->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId);\n $this->groupResourceMock->expects($this->once())\n ->method('save')\n ->will($this->throwException(new \\Exception()));\n $this->model->save($groupMock);\n }",
"function feed_group_save(&$feed_group, DatabaseTransaction $transaction = NULL) {\r\n if (!$transaction) {\r\n $transaction = db_transaction();\r\n }\r\n\r\n try {\r\n if (!$status = drupal_write_record('feed_group', $feed_group, isset($feed_group->fgid) ? 'fgid' : array())) {\r\n throw new Exception('Could not save feed group record');\r\n }\r\n db_ignore_slave();\r\n \r\n return $status;\r\n }\r\n catch (Exception $e) {\r\n $transaction->rollback();\r\n watchdog_exception('feed', $e);\r\n return FALSE;\r\n }\r\n}",
"public function testCrud() { \n $onFact = new onFact\\Api(ONFACT_TEST_KEY);\n $productgroup = array(\n 'Productgroup' => array( \n 'name' => 'Car parts', \n ) \n ); \n $id = $onFact->Productgroups->add($productgroup); \n $this->assertTrue(is_numeric($id));\n \n $productgroupApi = $onFact->Productgroups->view($id); \n $this->assertArrayContainsArray($productgroup, $productgroupApi);\n \n $updatedProductgroup = array(\n 'Productgroup' => array(\n 'name' => 'Car paint', \n )\n );\n $update = $onFact->Productgroups->update($id, $updatedProductgroup); \n $this->assertTrue($update);\n \n $productgroupApi = $onFact->Productgroups->view($id); \n $this->assertArrayContainsArray($updatedProductgroup, $productgroupApi);\n \n $delete = $onFact->Productgroups->delete($id);\n $this->assertTrue($delete);\n\n }",
"public function testDeReference3()\n {\n // dereferenced array into a string\n $str1 = '${test2}dd';\n $this->object->deReference($str1);\n }",
"function flush_group( $fragment_group ) {\n\t\tunset( $this->cache[$fragment_group] );\n\n\t\tif ( $this->_caching ) {\n\t\t\tlist( $f1, $f2, $fragment_group_global ) =\n\t\t\t\t$this->_fragment_group( $fragment_group, '' );\n\n\t\t\t$cache = $this->_get_cache( $fragment_group_global );\n\t\t\treturn $cache->flush( $fragment_group );\n\t\t}\n\t\treturn true;\n\t}",
"public function write( $key, $data, $group = '', $expire = 0 ) {\n\t\tif ( $this->_exists( $this->_key( $key, $group ) ) ) {\n\t\t\t$this->replace( $key, $data, $group, $expire );\n\t\t} else {\n\t\t\t$this->add( $key, $data, $group, $expire );\n\t\t}\n\t}",
"public function testReplaceAssociationsByIds()\n {\n $this->fixtures('users', 'articles');\n\n $user = User::find($this->users('derek')->id);\n $this->assertTrue(count($user->articles) > 0);\n\n $user->replaceArticles(array($this->articles('testing_js')->id, \n $this->articles('xml_rpc')->id));\n\n $this->assertEquals($this->articles('testing_js')->id, $user->articleIds[0]);\n $this->assertEquals($this->articles('xml_rpc')->id, $user->articleIds[1]);\n\n // save, and make sure the association object is created\n $user->save();\n\n // make sure both were created, and are associated\n $user = User::find($this->users('derek')->id);\n $this->assertTrue($user instanceof User);\n \n $this->assertEquals(2, count($user->articles));\n\n $article1 = Article::find($this->articles('testing_js')->id);\n $article2 = Article::find($this->articles('xml_rpc')->id);\n $this->assertTrue($article1 instanceof Article);\n $this->assertTrue($article2 instanceof Article);\n\n $this->assertEquals($article1->user_id, $user->id);\n $this->assertEquals($article2->user_id, $user->id);\n }",
"public function edit($data = null)\n {\n $old_needle = $this->find('first', array('conditions' => array('Needle.id' => $data['Needle']['id'])));\n\n // Update data from the old model\n $new_needle['Needle']['previous_id'] = $old_needle['Needle']['id'];\n $new_needle['Needle']['original_id'] = $old_needle['Needle']['original_id'];\n $new_needle['Needle']['created'] = $old_needle['Needle']['created'];\n $old_needle['Needle']['product_count'] = $old_needle['Needle']['product_count'];\n\n // Update data from the view\n $new_needle['Needle']['name'] = $data['Needle']['name'];\n\n // Udate the belongsTo relations from the view\n $new_needle['Needle']['menu_id'] = $data['Needle']['menu_id'];\n $new_needle['Needle']['brand_id'] = $data['Needle']['brand_id'];\n $new_needle['Needle']['material_id'] = $data['Needle']['material_id'];\n\n\n // If the save went well\n if(!$this->saveAll($new_needle))\n {\n return false;\n }\n $new_id = $this->id;\n\n // Update relations from the old model\n // Make sure it has relations\n if(!empty($old_needle['NeedleVariant']))\n { \n // Run through every relation\n foreach ($old_needle['NeedleVariant'] as $i => $needle_variant)\n { \n // Check if the needle_variant is active\n if($needle_variant['is_active'] == 1)\n { \n $this->NeedleVariant->set($needle_variant);\n $this->NeedleVariant->saveField('needle_id', $new_id); \n }\n } \n }\n\n // Update the old model\n $this->set($old_needle);\n $this->saveField('parrent_id', $new_id);\n\n // Set the old version to inactive\n $this->deactivate($old_needle['Needle']['id'], true);\n\n // If the save went well\n if(empty($old_needle))\n {\n return false;\n }\n\n // It all went well\n return true;\n }",
"public function testConversion(){\n $objects = array(\n 'testUser' => array(\n 'userA',\n 'userB'\n ),\n 'CGroup' => array(\n 'group'\n )\n );\n \n foreach($objects as $type => $arr){\n foreach($arr as $alias){\n $$alias = new $type;\n $this->assertTrue($$alias->save());\n }\n }\n \n $group->alias = 'group';\n $this->assertTrue($group->save());\n \n /**\n * Give B some rights on the group and let userA join that group\n */\n $userB->grant('group', '*');\n $this->assertFalse($userB->may($userA, 'read'));\n \n $userA->beAco();\n $this->assertTrue($userA->join('group'));\n $this->assertTrue($userB->may($userA, 'read'));\n $this->assertTrue($userA->leave('group'));\n $this->assertFalse($userB->may($userA, 'read'));\n \n //And once more, directly\n $userB->grant($userA, 'read');\n $this->assertTrue($userB->may($userA, 'read'));\n \n //Remove all objects\n foreach($objects as $type=> $arr)\n foreach($arr as $obj)\n $this->assertTrue($$obj->delete()); \n }",
"function testUpdateGroups()\n {\n $data = array(3);\n $this->GroupEvent->updateGroups(1, $data);\n $searched = $this->GroupEvent->find('all', array('conditions' => array('event_id' => 1)));\n $this->assertEqual(count($searched), 1);\n $this->assertEqual($searched[0]['GroupEvent']['group_id'], 3);\n $this->assertEqual($searched[0]['GroupEvent']['event_id'], 1);\n\n // single group\n $this->GroupEvent->updateGroups(1, 1);\n $searched = $this->GroupEvent->find('all', array('conditions' => array('event_id' => 1)));\n $this->assertEqual(count($searched), 1);\n\n // invalid group\n $incorrectData = $this->GroupEvent->updateGroups(1, null);\n $this->assertFalse($incorrectData);\n }"
] | [
"0.57675016",
"0.55514055",
"0.547953",
"0.54131246",
"0.539861",
"0.5332833",
"0.53265536",
"0.52373135",
"0.5106801",
"0.5098673",
"0.5043351",
"0.50211614",
"0.5006713",
"0.49993357",
"0.4986347",
"0.49563968",
"0.4953056",
"0.4942727",
"0.49343452",
"0.4926767",
"0.48931518",
"0.48786032",
"0.48280182",
"0.48220798",
"0.48176306",
"0.4782662",
"0.4756494",
"0.47510868",
"0.47489628",
"0.47415632",
"0.47363508",
"0.47059667",
"0.47051412",
"0.46799767",
"0.46770683",
"0.46767995",
"0.46739134",
"0.46535805",
"0.46333724",
"0.4620621",
"0.46167067",
"0.4610948",
"0.46021625",
"0.46017265",
"0.45980564",
"0.4593462",
"0.45916432",
"0.45892096",
"0.45832908",
"0.45789188",
"0.45740694",
"0.45715782",
"0.45691502",
"0.45579463",
"0.45518264",
"0.45488182",
"0.45472237",
"0.45352128",
"0.4532055",
"0.45124263",
"0.44837967",
"0.44821173",
"0.44818366",
"0.44634974",
"0.44631",
"0.44621646",
"0.4460292",
"0.44494668",
"0.4446499",
"0.444445",
"0.44392198",
"0.4438716",
"0.44368526",
"0.4436318",
"0.4435807",
"0.4433388",
"0.44261843",
"0.44255322",
"0.44215012",
"0.44137928",
"0.44127566",
"0.44121507",
"0.44096112",
"0.44076762",
"0.44049922",
"0.43987668",
"0.4396852",
"0.43934578",
"0.43927386",
"0.43854335",
"0.43790504",
"0.43747133",
"0.4372167",
"0.4371934",
"0.4369587",
"0.4366895",
"0.4365821",
"0.4363407",
"0.4363288",
"0.43626955"
] | 0.4391592 | 89 |
Tests a data reference in an action group replaced with a data.field reference. | public function testGetStepsWithNoFieldArg()
{
$this->setEntityObjectHandlerReturn(function ($entityName) {
if ($entityName == "data2") {
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
}
});
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function acf_update_field_group($field_group)\n{\n}",
"public function update_field_group($field_group)\n {\n }",
"function acf_update_field_group( $field_group ) {\n\treturn acf_update_internal_post_type( $field_group, 'acf-field-group' );\n}",
"function acf_flush_field_group_cache($field_group)\n{\n}",
"function acf_get_field_group_edit_link($post_id)\n{\n}",
"function acf_upgrade_500_field_group($ofg)\n{\n}",
"function acf_prepare_field_group_for_import($field_group)\n{\n}",
"function acf_translate_field_group($field_group = array())\n{\n}",
"function acf_update_metaref($post_id = 0, $type = 'fields', $references = array())\n{\n}",
"public function testGetChangeField()\n {\n }",
"function upgrade_500_field_group($field_group, $ofg)\n {\n }",
"function acf_import_field_group($field_group)\n{\n}",
"public function group_data_change($fields)\r\n {\r\n $message = 'Function group_data_change not optimized and should not be called directly in ' .\r\n vB_Types::instance()->getContentTypeTitle($fields['contenttypeid']) .\r\n ' index controller. See vBSphinxSearch_Search_IndexController_Post for example.';\r\n vBSphinxSearch_Core::log_errors($message);\r\n \r\n $this->_content_type_id = $fields['contenttypeid'];\r\n if ($this->_fetch_object_id_list($fields['groupid'], true))\r\n {\r\n return $this->_write_to_queue();\r\n }\r\n return false;\r\n }",
"function acf_validate_field_group($field_group = array())\n{\n}",
"function acf_prepare_field_group_for_export($field_group = array())\n{\n}",
"function acf_get_field_group_edit_link( $post_id ) {\n\treturn acf_get_internal_post_type_edit_link( $post_id, 'acf-field-group' );\n}",
"function acf_translate_field_group( $field_group = array() ) {\n\treturn acf_translate_internal_post_type( $field_group, 'acf-field-group' );\n}",
"public function dataIsReference()\n {\n return [\n [\n '/* testBitwiseAndA */',\n false,\n ],\n [\n '/* testBitwiseAndB */',\n false,\n ],\n [\n '/* testBitwiseAndC */',\n false,\n ],\n [\n '/* testBitwiseAndD */',\n false,\n ],\n [\n '/* testBitwiseAndE */',\n false,\n ],\n [\n '/* testBitwiseAndF */',\n false,\n ],\n [\n '/* testBitwiseAndG */',\n false,\n ],\n [\n '/* testBitwiseAndH */',\n false,\n ],\n [\n '/* testBitwiseAndI */',\n false,\n ],\n [\n '/* testFunctionReturnByReference */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceC */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceD */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceE */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceF */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceG */',\n true,\n ],\n [\n '/* testForeachValueByReference */',\n true,\n ],\n [\n '/* testForeachKeyByReference */',\n true,\n ],\n [\n '/* testArrayValueByReferenceA */',\n true,\n ],\n [\n '/* testArrayValueByReferenceB */',\n true,\n ],\n [\n '/* testArrayValueByReferenceC */',\n true,\n ],\n [\n '/* testArrayValueByReferenceD */',\n true,\n ],\n [\n '/* testArrayValueByReferenceE */',\n true,\n ],\n [\n '/* testArrayValueByReferenceF */',\n true,\n ],\n [\n '/* testArrayValueByReferenceG */',\n true,\n ],\n [\n '/* testArrayValueByReferenceH */',\n true,\n ],\n [\n '/* testAssignByReferenceA */',\n true,\n ],\n [\n '/* testAssignByReferenceB */',\n true,\n ],\n [\n '/* testAssignByReferenceC */',\n true,\n ],\n [\n '/* testAssignByReferenceD */',\n true,\n ],\n [\n '/* testAssignByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceA */',\n true,\n ],\n [\n '/* testPassByReferenceB */',\n true,\n ],\n [\n '/* testPassByReferenceC */',\n true,\n ],\n [\n '/* testPassByReferenceD */',\n true,\n ],\n [\n '/* testPassByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceF */',\n true,\n ],\n [\n '/* testPassByReferenceG */',\n true,\n ],\n [\n '/* testPassByReferenceH */',\n true,\n ],\n [\n '/* testPassByReferenceI */',\n true,\n ],\n [\n '/* testPassByReferenceJ */',\n true,\n ],\n [\n '/* testNewByReferenceA */',\n true,\n ],\n [\n '/* testNewByReferenceB */',\n true,\n ],\n [\n '/* testUseByReference */',\n true,\n ],\n [\n '/* testArrowFunctionReturnByReference */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testClosureReturnByReference */',\n true,\n ],\n ];\n\n }",
"function acf_get_valid_field_group($field_group = \\false)\n{\n}",
"function acf_is_field_group($field_group = \\false)\n{\n}",
"function field_views_data_alter(&$data) {\n foreach (field_info_fields() as $field) {\n if ($field['storage']['type'] != 'field_sql_storage') {\n continue;\n }\n\n $function = $field['module'] . '_field_views_data_views_data_alter';\n if (function_exists($function)) {\n $function($data, $field);\n }\n }\n}",
"function _acf_apply_is_local_field_group_key($bool, $id)\n{\n}",
"protected static function filter_data($action, $data) {\n\t\t$formFields = static::form_fields($action);\n\t\tforeach ($data as $fieldName => $_) {\n\t\t\tif (!isset($formFields[ $fieldName ])) {\n\t\t\t\tunset($data[ $fieldName ]);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"protected function _evaluateDataRefBindings(\\DOMElement $fieldNode) {}",
"public function setFields ($mData, $dataAction = DataModel::REPLACE_DATA)\n {\n $this->requireWriteable();\n\n if ($mData instanceof DataModel)\n {\n \t$aData = $mData->getData();\n }\n else\n {\n \t$aData =& $mData;\n }\n constraint_mustBeArray($aData);\n constraint_mustBeGreaterThan($dataAction, DataModel::DATA_START);\n constraint_mustBeLessThan($dataAction, DataModel::DATA_END);\n\n switch ($dataAction)\n {\n case DataModel::REPLACE_DATA:\n $this->replaceDataWithArray($aData);\n break;\n\n case DataModel::MERGE_DATA:\n $this->mergeDataFromArray($aData);\n break;\n\n default:\n debug_unreachable(__FILE__, __LINE__);\n }\n\n $this->setNeedsSaving();\n }",
"function acf_get_reference($field_name, $post_id)\n{\n}",
"public function testRenameGroup(){\n jAcl2DbUserGroup::updateGroup(self::$grpId3, 'newgroup3');\n self::$groups[2]['name']='newgroup3';\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n }",
"function acf_get_field_group_visibility($field_group, $args = array())\n{\n}",
"function replace( $id, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( $this->get( $id, $group ) === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->set( $id, $data, $group, $expire );\n\t}",
"function acf_get_field_reference($field_name, $post_id)\n{\n}",
"public function replaceField($fieldName, $newField, $dataFieldOnly = true)\n {\n }",
"function acf_flush_field_group_cache( $field_group ) {\n\tacf_flush_internal_post_type_cache( $field_group, 'acf-field-group' );\n}",
"function acf_is_field_group_key($id = '')\n{\n}",
"function acf_validate_field_group( $field_group ) {\n\t\t\n\t\t// 5.5.6 - changed filter name\n\t\t$field_group = apply_filters('acf/get_valid_field_group', $field_group);\n\t\t\n\t\t\n\t\t// return\n\t\treturn $field_group;\n\t\t\n\t}",
"function acf_add_local_field_group($field_group)\n{\n}",
"function pre_load_reference($field_key, $field_name, $post_id)\n {\n }",
"function _acf_apply_get_local_field_groups($groups = array())\n{\n}",
"function acf_filter_field_groups($field_groups, $args = array())\n{\n}",
"function validate_field_group($field_group)\n {\n }",
"function render_data($field){\n \n $field_group = acf_get_field_group($field['value']);\n \n if(!$field_group){\n \n echo '<a href=\"#\" class=\"button disabled\" disabled>' . __('Data') . '</a>';\n return;\n \n }\n \n $field_group_key = $field_group['key'];\n $raw_field_group = get_post($field_group['ID']);\n \n ?>\n <a href=\"#\" class=\"acf-button button acfe_modal_open\" data-modal-key=\"<?php echo $field_group_key; ?>\"><?php _e('Data'); ?></a>\n <div class=\"acfe-modal\" data-modal-key=\"<?php echo $field_group_key; ?>\">\n <div style=\"padding:15px;\">\n <pre style=\"margin-bottom:15px;\"><?php print_r($field_group); ?></pre>\n <pre><?php print_r($raw_field_group); ?></pre>\n </div>\n </div>\n <?php\n \n }",
"public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }",
"public function testChangingReferenceName(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->setAlias('FavoritePost');\n $table->addBehavior(\n 'Translate',\n ['fields' => ['body'], 'referenceName' => 'Posts']\n );\n\n $items = $table->associations();\n $association = $items->getByProperty('body_translation');\n $this->assertNotEmpty($association, 'Translation association not found');\n\n $found = false;\n foreach ($association->getConditions() as $key => $value) {\n if (strpos($key, 'body_translation.model') !== false) {\n $found = true;\n $this->assertSame('Posts', $value);\n break;\n }\n }\n\n $this->assertTrue($found, '`referenceName` field condition on a Translation association was not found');\n }",
"function acf_is_local_field_group($key = '')\n{\n}",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"public function getShouldFieldBeOverlaidData() {}",
"function setField($data,$field,$table,$id,$chk_field)\n\t{\n\t\tif(strlen($field))\n\t\t{\n\t\t\tif(strlen($table))\n\t\t\t{\n\t\t\t\t$where=$this->WhereClause($chk_field,$id);\n\t\t\t\t$t_data=$this->sqlFormatField($data);\n // $t_field=$this->sqlFormatField($field);\n\t\t\t\tif(strlen($where))\n\t\t\t\t{\n\t\t\t\t\t$sql=\"update $table set $field=$t_data where $where\";\n\t\t\t\t\t$this->query($sql);\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t}",
"public function delete_field_group($field_group)\n {\n }",
"function acf_prepare_field_group_for_import( $field_group ) {\n\treturn acf_prepare_internal_post_type_for_import( $field_group, 'acf-field-group' );\n}",
"function assign($data) {\n\t\tunset($this->valid);\n\n\t\tforeach ($data as $field => $value) {\n\n\t\t\tif ($field == $this->id_field) {\n\t\t\t\t$this->id = $value;\n\t\t\t\t//continue;\n\t\t\t}\n\n\t\t\tif (!in_array($field, $this->protected_attributes()) && $this->field_exists($field) ) {\n\t\t\t\t$value = $this->cast($field, $value);\n\n\t\t\t\tif (method_exists($this, 'set_'.$field)) {\n\t\t\t\t\tcall_user_func(array(& $this, 'set_'.$field), $value);\n\t\t\t\t} else if (!$this->set_associated($field, $value)) {\n\t\t\t\t\t$this->data[$field] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"function cd_ab_rel_activity_filter( $action, $activity ) {\n\tswitch ( $activity->component ) {\n\t\tcase 'groups' :\n\t\t\t$cd_ab = get_blog_option( bp_get_root_blog_id(), 'cd_ab' );\n\t\t\tif ( $cd_ab['groups']['status'] === 'on' ) {\n\t\t\t\t$reverse_content = strrev( $action );\n\t\t\t\t$position = strpos( $reverse_content, 'gmi<' );\n\t\t\t\tpreg_match( '~group-(\\d++)-avatar~', $action, $match );\n\t\t\t\t$replace = \"rel='group_{$match[1]}' \";\n\t\t\t\t$action = substr_replace( $action, $replace, - $position + 1, 0 );\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn $action;\n}",
"public function test(&$element, $value, $group = null, &$input = null, &$form = null)\n {\n // Get the possible field actions and the ones posted to validate them.\n $fieldActions = self::getFieldActions($element);\n $valueActions = self::getValueActions($value);\n\n // Make sure that all posted actions are in the list of possible actions for the field.\n foreach ($valueActions as $action)\n {\n if (!in_array($action, $fieldActions))\n {\n return false;\n }\n }\n\n return true;\n }",
"function update( string $_group_key, IIndexedEntity $_entity ): bool;",
"function acf_delete_field_group($id = 0)\n{\n}",
"public function testStepKeyReplacementFilteredIn()\n {\n $createStepKey = \"createDataStepKey\";\n $updateStepKey = \"updateDataStepKey\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject(\n $updateStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[6],\n ['selector' => 'value']\n ),\n new ActionObject(\n $createStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[7],\n ['selector' => 'value']\n )\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertContains($updateStepKey, $result);\n $this->assertContains($createStepKey, $result);\n $this->assertCount(2, $result);\n }",
"function acf_is_field_group( $field_group = false ) {\n\treturn acf_is_internal_post_type( $field_group, 'acf-field-group' );\n}",
"function process_action($db, &$data) {\n\n\t/*\n\t\tIn \"real\" version this would validate the form, sending\n\t\tthe message if valid, and sending the appropriate handler.\n\t\t\n\t\tHandlers such as:\n\t\t\tactions/%s/%s_invalidForm\n\t\t\tactions/%s/%s_failed\n\t\t\tactions/%s/%s_success\n\t*/\n\t\n\t$data = [\n\t\t'contentFilePath' => 'actions/%s/%s.success',\n\t\t'pageName' => 'contact',\n\t\t'pageTitle' => 'Contact Us'\n\t];\n\n}",
"function editGroupHandler1() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n ]);\n\n formatOutput(true, 'update success');\n}",
"public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }",
"function acf_is_local_field_group_key($key = '')\n{\n}",
"public function updateDD3() {\n global $module;\n\n echo \"UPDATING!!!\";\n //iterate through the mapper\n //compare from and to_field : if different, then update all references to field:\n // field_name, select_choices_or_calculation, branching_logic\n //compare from and to_form : if different, update all references to field:\n // form_name\n\n //$this->mapper->printDictionary(); exit;\n //print \"<pre>\" . print_r($this->mapper->getMapper(),true). \"</pre>\";\n\n\n foreach ($this->mapper->getMap() as $key => $map) {\n $replacement = $map['to_field'];\n //echo \"<br> CHECKING: $key vs $replacement\";\n\n if ((strcasecmp(trim($key), trim($replacement)) !== 0) && (!empty(trim($replacement))) ) {\n echo '<br> ' .$key. ' is not equal to '.$replacement.' in a case insensitive string comparison<br>';\n if (array_key_exists($key, $this->data_dict)) {\n if ($key == 'symp_1') {\n// print \"<br> \" . $key . ' VS ' . strtolower(trim($replacement)) . \" UPDATING: <pre>\" . print_r($this->data_dict[$key], true) . \"</pre>\";\n }\n $this->data_dict[$key]['field_name'] = strtolower(trim($replacement));\n\n $this->reg_pattern[] = '/\\['.$key.'(\\]|\\()/';\n $this->reg_replace[]='['.$replacement.'$1';\n\n\n\n }\n }\n\n if (strcasecmp( trim($map['from_form']), trim($map['to_form'])) !== 0) {\n echo \"<br>$key: comparing FORMS: \". $map['from_form'].' is not equal to '.$map['to_form'].' in a case insensitive string comparison';\n if (array_key_exists($key, $this->data_dict)) {\n $this->data_dict[$key]['form_name'] = strtolower(trim($map['to_form']));\n //$module->emDebug($map['to_form']);\n }\n }\n }\n\n //Fix the branching logic\n $fixed_data_dict = $this->replaceReferences($this->data_dict, $this->reg_pattern, $this->reg_replace);\n //$module->emDEbug(\"NEW DICT\", $this->data_dict, $this->data_dict2);\n\n $this->downloadCSV($fixed_data_dict, \"from_original.csv\");\n\n }",
"function setDynamicDataField($surferId, $fieldName, $value) {\n return (1 == $this->setDynamicData($surferId, $fieldName, $value));\n }",
"function acf_untrash_field_group($id = 0)\n{\n}",
"function acf_validate_field_group( $field_group = array() ) {\n\treturn acf_validate_internal_post_type( $field_group, 'acf-field-group' );\n}",
"function updateDataField($value)\r\n {\r\n if ($this->_datafield!=\"\")\r\n {\r\n if ($this->_datasource!=null)\r\n {\r\n if ($this->_datasource->Dataset!=null)\r\n {\r\n //Checks for the index fields\r\n $keyfields=$this->Name.\"_key\";\r\n $keys=$this->input->$keyfields;\r\n // Checks if the keys were posted\r\n if (is_object($keys))\r\n {\r\n $fname=$this->DataField;\r\n\r\n //Sets to Edit State\r\n $this->_datasource->Dataset->edit();\r\n\r\n\r\n $values=$keys->asStringArray();\r\n\r\n //Sets the key values\r\n reset($values);\r\n while (list($k,$v)=each($values))\r\n {\r\n $this->_datasource->Dataset->fieldset($k,$v);\r\n }\r\n\r\n //Sets the field value\r\n $this->_datasource->Dataset->fieldset($fname,$value);\r\n }\r\n else $this->_datasource->Dataset->fieldset($this->_datafield,$value);\r\n }\r\n }\r\n }\r\n }",
"public function testUpdateSupplierGroup()\n {\n }",
"public function replace( $key, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( ! $this->_exists( $this->_key( $key, $group ) ) )\n\t\t\treturn false;\n\n\t\treturn $this->set( $key, $data, $group, (int) $expire );\n\t}",
"public function set_field( string $field, $data ) {\n\t\t$this->data[ $field ] = $data;\n\t}",
"function acf_prepare_field_group_for_export( $field_group = array() ) {\n\treturn acf_prepare_internal_post_type_for_export( $field_group, 'acf-field-group' );\n}",
"public function saveEditedGroupData($group) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\n\t\t\tif($group instanceof iUmiFieldsGroup) {\n\t\t\t\t$group->setName($name);\n\t\t\t\t$group->setTitle($title);\n\t\t\t\t$group->setIsVisible($is_visible);\n\t\t\t\t$group->setIsActive(true);\n\t\t\t\t$group->setTip($tip);\n\t\t\t\t$group->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiFieldsGroup\");\n\t\t\t}\n\t\t}",
"function acf_upgrade_500_field_groups()\n{\n}",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"public function saveAddedFieldData($inputData) {\n\n\t\t\t$group_id = $inputData['group-id'];\n\t\t\t$type_id = $inputData['type-id'];\n\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$field_type_id = getArrayKey($info, 'field_type_id');\n\t\t\t$guide_id = getArrayKey($info, 'guide_id');\n\t\t\t$in_search = getArrayKey($info, 'in_search');\n\t\t\t$in_filter = getArrayKey($info, 'in_filter');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\t\t\t$isRequired = getArrayKey($info, 'is_required');\n\t\t\t$restrictionId = getArrayKey($info, 'restriction_id');\n\t\t\t$isImportant = getArrayKey($info, 'is_important');\n\n\t\t\t$objectTypes = umiObjectTypesCollection::getInstance();\n\t\t\t$fields = umiFieldsCollection::getInstance();\n\t\t\t$fieldTypes = umiFieldTypesCollection::getInstance();\n\n\t\t\t//Check for non-unique field name\n\t\t\t$type = $objectTypes->getType($type_id);\n\t\t\tif($type instanceof umiObjectType) {\n\t\t\t\tif($type->getFieldId($name)) {\n\t\t\t\t\tthrow new publicAdminException(getLabel('error-non-unique-field-name'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$field_type_obj = $fieldTypes->getFieldType($field_type_id);\n\t\t\t$field_data_type = $field_type_obj->getDataType();\n\n\t\t\tif($field_data_type == \"relation\" && $guide_id == 0) {\n\t\t\t\t$guide_id = self::getAutoGuideId($title);\n\t\t\t}\n\n\t\t\tif($field_data_type == \"optioned\" && $guide_id == 0) {\n\t\t\t\t$parent_guide_id = $objectTypes->getTypeIdByGUID('emarket-itemoption');\n\t\t\t\t$guide_id = self::getAutoGuideId($title, $parent_guide_id);\n\t\t\t}\n\n\t\t\t$field_id = $fields->addField($name, $title, $field_type_id, $is_visible, false, false);\n\n\t\t\t$field = $fields->getField($field_id);\n\t\t\t$field->setGuideId($guide_id);\n\t\t\t$field->setIsInSearch($in_search);\n\t\t\t$field->setIsInFilter($in_filter);\n\t\t\t$field->setTip($tip);\n\t\t\t$field->setIsRequired($isRequired);\n\t\t\t$field->setRestrictionId($restrictionId);\n\t\t\t$field->setImportanceStatus($isImportant);\n\t\t\t$field->commit();\n\n\t\t\tif($type instanceof umiObjectType) {\n\t\t\t\t$group = $type->getFieldsGroup($group_id);\n\t\t\t\tif($group instanceof umiFieldsGroup) {\n\t\t\t\t\t$group->attachField($field_id);\n\t\t\t\t\t$group_name = $group->getName();\n\n\t\t\t\t\t$childs = $objectTypes->getChildTypeIds($type_id);\n\t\t\t\t\t$sz = count($childs);\n\n\t\t\t\t\tfor($i = 0; $i < $sz; $i++) {\n\t\t\t\t\t\t$child_type_id = $childs[$i];\n\t\t\t\t\t\t$child_type = $objectTypes->getType($child_type_id);\n\n\t\t\t\t\t\tif($child_type instanceof umiObjectType) {\n\n\t\t\t\t\t\t\tif($child_type->getFieldId($name) == $field_id) continue;\n\n\t\t\t\t\t\t\t$child_group = $child_type->getFieldsGroupByName($group_name);\n\t\t\t\t\t\t\tif($child_group instanceof umiFieldsGroup) {\n\t\t\t\t\t\t\t\t$child_group->attachField($field_id, true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$ignoreChildGroup = getRequest('ignoreChildGroup');\n\t\t\t\t\t\t\t\tif ($ignoreChildGroup) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthrow new publicAdminException(getLabel(\"error-no-child-group\", false, $group_name, $child_type->getName()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new publicAdminException(getLabel(\"error-no-object-type\", false, $child_type_id));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $field_id;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new coreException(getLabel(\"error-no-fieldgroup\", false, $group_id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new coreException(getLabel(\"error-no-object-type\", false, $type_id));\n\t\t\t}\n\t\t}",
"function acf_import_field_group( $field_group ) {\n\treturn acf_import_internal_post_type( $field_group, 'acf-field-group' );\n}",
"function acf_get_valid_field_group( $field_group = false ) {\n\treturn acf_validate_field_group( $field_group );\n}",
"private function replaceReferences($data_dict, $target, $replacement) {\n global $module;\n\n //$module->emDebug($target, $replacement);\n\n $foo = preg_replace($target, $replacement, json_encode($data_dict));\n return (json_decode($foo, true));\n\n\n /**\n foreach ($this->data_dict as $field => $dict_row) {\n //replace in calculated field\n $re = '/\\['.$target.'(\\]|\\()/m';\n $re2 = '/.*?(?<target>\\['.$target.'\\]|\\().*?/m';\n $str = '[yboc1] + [yboc2] + [yboc3] + [yboc4] + [yboc5]';\n\n\n echo \"<br><br>\";\n echo \"<br>REPLACED: \" . preg_replace($re, $replacement, $this->data_dict[$target]['select_choices_or_calculations']);\n\n echo \"<br>REPLACED: \" . preg_replace($re, $replacement, $this->data_dict[$target]['branching_logic']);\n\n }\n*/\n }",
"function extractActionData($data) {\n $fields = array(\n 'surfer_handle',\n 'surfer_givenname',\n 'surfer_surname',\n 'surfer_email',\n 'surfer_valid',\n 'surfergroup_id',\n 'surfer_gender',\n 'surfer_avatar'\n );\n $result = array();\n foreach ($fields as $field) {\n if (isset($data[$field])) {\n $result[$field] = $data[$field];\n }\n }\n return $result;\n }",
"function field_group_features_export_alter(&$export, $module_name) {\n // Make sure we have fresh data by loading directly.\n ctools_include('export');\n $field_groups = ctools_export_load_object('field_group');\n\n // Support the separate field base -vs- field instance structure that was\n // added in Features v7.x-2.0-beta2.\n if (function_exists('field_instance_features_export')) {\n $export_var = 'field_instance';\n }\n else {\n $export_var = 'field';\n }\n\n // Add fieldgroups based on the fields that are present.\n if (!empty($export['features'][$export_var])) {\n if (!isset($export['features']['field_group'])) {\n $export['features']['field_group'] = array();\n }\n foreach ($export['features'][$export_var] as $field) {\n list($entity_type, $bundle, $field_name) = explode('-', $field);\n\n foreach ($field_groups as $group_id => $group) {\n\n if ($group->entity_type == $entity_type && $group->bundle == $bundle && in_array($field_name, $group->data['children']) && !in_array($group->identifier, $export['features']['field_group'])) {\n if (isset($group->export_module) && $group->export_module != $module_name) {\n $export['dependencies'][$group->export_module] = $group->export_module;\n }\n else {\n $export['features']['field_group'][$group_id] = $group_id;\n }\n }\n }\n }\n }\n\n // Add any parent field groups that haven't been selected.\n if (!empty($export['features']['field_group'])) {\n foreach ($export['features']['field_group'] as $id) {\n $group = isset($field_groups[$id]) ? $field_groups[$id] : FALSE;\n\n if ($group && !empty($group->parent_name)) {\n $parent_id = $group->parent_name . '|' . $group->entity_type . '|' . $group->bundle . '|' . $group->mode;\n $parent_group = isset($field_groups[$parent_id]) ? $field_groups[$parent_id] : FALSE;\n\n if ($parent_group && !isset($export['features']['field_group'][$parent_id])) {\n if (isset($parent_group->export_module) && $parent_group->export_module != $module_name) {\n $export['dependencies'][$parent_group->export_module] = $parent_group->export_module;\n }\n else {\n $export['features']['field_group'][$parent_id] = $parent_id;\n }\n }\n }\n }\n if(empty($export['dependencies']['field_group'])) {\n $export['dependencies']['field_group'] = 'field_group';\n }\n }\n}",
"function db_update_group_info($gid, $fields)\n{\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_group($gid);\n\tif ($old === NULL)\n\t\t// No such feed\n\t\treturn FALSE;\n\n\t$new = $old;\n\t$updates = array();\n\t$bind_fmt = \"\";\n\t$bind_values = array();\n\n\tforeach (array('parent', 'name') as $f)\n\t{\n\t\tif (array_key_exists($f, $fields))\n\t\t{\n\t\t\t$new[$f] = $fields[$f];\n\t\t}\n\t}\n\n\t$query = \"UPDATE `groups` SET parent=?, name=? WHERE id=?\";\n\t$stmt = $dbh->prepare($query);\n\t$result = $stmt->bind_param(\"isi\",\n\t\t$new['parent'],\n\t\t$new['name'],\n\t\t$gid);\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t$result = $stmt->execute();\n\t$stmt->close();\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n}",
"function acf_delete_json_field_group($key)\n{\n}",
"function & getFieldRef (&$data, $key, $default = null, $createObj = false)\n{\n if (is_object ($data)) {\n if (!property_exists ($data, $key))\n $data->$key = $createObj ? new StdClass : $default;\n return $data->$key;\n }\n if (is_array ($data)) {\n if (!array_key_exists ($key, $data))\n $data[$key] = $default;\n return $data[$key];\n }\n throw new InvalidArgumentException (\"Not an object or array\");\n}",
"public function testDereferenceBasic()\n {\n $src = 'success';\n $ref = &$src;\n $this->debug->log('ref', $ref);\n $src = 'fail';\n $output = $this->debug->output();\n $this->assertContains('success', $output);\n }",
"public function testGroupContentEntityOperationAccessAlterHook(string $operation): void {\n // Check that our test user doesn't have access to edit or delete comments\n // in the group.\n // This is the default behavior for users that are not a group member.\n $this->assertFalse($this->userHasAccess($operation));\n\n // Now enable our hook which will alter the group content entity operation\n // access rules to allow moderators to edit and delete comments in all\n // groups. Since our user is a moderator they should now have access.\n \\Drupal::state()->set('og_test_group_content_entity_operation_access_alter', TRUE);\n $this->assertTrue($this->userHasAccess($operation));\n }",
"function acf_remove_local_field_group($key = '')\n{\n}",
"public function testImportAfterCompile($data)\n {\n $import = [];\n\n foreach($data as $field)\n {\n $import[$field['name']] = $field['value'];\n }\n\n $this->collection->importFromArray([$import]);\n $this->collection->compile();\n\n $routes = $this->collection->all();\n\n $this->assertCount(1, $routes);\n\n foreach($data as $field)\n {\n $this->assertEquals($field['value'], $routes[0][$field['name']], $field['name']);\n }\n }",
"public function add_annotation_field_to_group($group_name,$field_name,$field_length,$no_match_value,$lookup_query,$anchor) {\n foreach(array_keys($this->page_fields) as $i) {\n if ($this->page_fields[$i]['sub_heading']==$group_name) {\n $this->page_fields[$i]['fields'][]=array('field_name'=>$field_name,'field_type'=>'annotation','length'=>$field_length,'lookup_no_match'=>$no_match_value,'lookup_query'=>$lookup_query,'anchor'=>$anchor);\n error_log(print_r($this->page_fields[$i]['fields'],true));\n return true;\n }\n }\n error_log(\"BasicForm: add_annotation_field_to_group: Attempt was made to add an annotation field ($field_name) to a group which couldnt be found ($group_name)\");\n return false;\n }",
"function acf_duplicate_field_group($id = 0, $new_post_id = 0)\n{\n}",
"function acf_get_field_group_visibility( $field_group, $args = array() ) {\n\n\t// Check if active.\n\tif ( ! $field_group['active'] ) {\n\t\treturn false;\n\t}\n\n\t// Check if location rules exist\n\tif ( $field_group['location'] ) {\n\n\t\t// Get the current screen.\n\t\t$screen = acf_get_location_screen( $args );\n\n\t\t// Loop through location groups.\n\t\tforeach ( $field_group['location'] as $group ) {\n\n\t\t\t// ignore group if no rules.\n\t\t\tif ( empty( $group ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Loop over rules and determine if all rules match.\n\t\t\t$match_group = true;\n\t\t\tforeach ( $group as $rule ) {\n\t\t\t\tif ( ! acf_match_location_rule( $rule, $screen, $field_group ) ) {\n\t\t\t\t\t$match_group = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If this group matches, show the field group.\n\t\t\tif ( $match_group ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return default.\n\treturn false;\n}",
"public function testImportBeforeCompile($data)\n {\n $import = [];\n\n foreach($data as $field)\n {\n $import[$field['name']] = $field['value'];\n }\n\n $this->collection->importFromArray([$import]);\n\n $routes = $this->collection->all();\n\n $this->assertCount(1, $routes);\n\n foreach($data as $field)\n {\n $this->assertEquals($field['value'], $routes[0]->{$field['method']}(), $field['name']);\n }\n }",
"private function fetchaction($data)\n\t{\n\t\t$pattern = \"<input type=\\\"hidden\\\" name=\\\"Action\\\" id=\\\"Action\\\" value=\\\"\";\n\t\t$pos = strpos($data, $pattern);\n\t\tif($pos > -1)\n\t\t\t$this->action = substr($data, $pos + strlen($pattern), strpos(substr($data, $pos + strlen($pattern)), \"\\\"\"));\n\t}",
"public function test_updateReplenishmentProcessCustomFields() {\n\n }",
"function acf_is_field_group_key( $id = '' ) {\n\treturn acf_is_internal_post_type_key( $id, 'acf-field-group' );\n}",
"public function assign_values(&$action, $id = 0, $ref = '')\n {\n // phpcs:enable\n\t\tglobal $conf, $langs;\n\t\tglobal $form, $formcompany;\n\n\t\t$ret = $this->getObject($id, $ref);\n\n\t\tparent::assign_values($action);\n\n $this->tpl['title'] = load_fiche_titre($this->getTitle($action));\n\n\t\tif ($action == 'create' || $action == 'edit')\n\t\t{\n\t\t\t$this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civility_id'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Confirm delete third party\n\t\t\tif ($action == 'delete' || $conf->use_javascript_ajax)\n\t\t\t{\n\t\t\t\t$this->tpl['action_delete'] = $form->formconfirm($_SERVER[\"PHP_SELF\"].\"?socid=\".$this->object->id, $langs->trans(\"DeleteAnIndividual\"), $langs->trans(\"ConfirmDeleteIndividual\"), \"confirm_delete\", '', 0, \"1,action-delete\");\n\t\t\t}\n\t\t}\n }",
"function check_actions($observed_fields, $pas, $start_field_set = null) // {{{\n{\n // Set initial field set to empty if not given\n if ($start_field_set === null)\n $start_field_set = new FieldSet();\n else\n $start_field_set = $start_field_set->getClone();\n // Apply actions\n $pas->applyAll($start_field_set);\n // Compare result with extracted field set\n $diff = $observed_fields->differenceWith($start_field_set);\n return $diff;\n}",
"public function replace($key, $data, $group = 'default', $expire = 0)\n {\n }",
"function commerce_product_field_views_data_alter(array &$data, FieldStorageConfigInterface $field_storage) {\n if ($field_storage->getType() == 'entity_reference' && $field_storage->getSetting('target_type') == 'commerce_product_attribute_value') {\n // Due to their nature, attribute fields are always assumed to be limited\n // to a single attribute (== single target bundle).\n $entity_type_id = $field_storage->getTargetEntityTypeId();\n $bundles = $field_storage->getBundles();\n $bundle = reset($bundles);\n $field_name = $field_storage->getName();\n $field = FieldConfig::loadByName($entity_type_id, $bundle, $field_name);\n if (!$field) {\n // There is no field yet, probably because a migration is in progress.\n return;\n }\n $handler_settings = $field->getSetting('handler_settings');\n $target_bundles = array_values($handler_settings['target_bundles']);\n $attribute = reset($target_bundles);\n\n foreach ($data as $table_name => $table_data) {\n foreach ($table_data as $field_name => $field_data) {\n if (isset($field_data['filter']) && $field_name != 'delta') {\n $data[$table_name][$field_name]['filter']['id'] = 'commerce_product_attribute_value';\n $data[$table_name][$field_name]['filter']['attribute'] = $attribute;\n }\n }\n }\n }\n}",
"public function populateAsReference()\n {\n\n $orm = $this->db->getOrm();\n\n // Reference Container zum befüllen der Referenz Datensätze\n $refContainers = array();\n\n // Sicher stelle, das keine unerwarteten Daten in der Tabelle sind\n $orm->cleanResource('WbfsysRoleGroup');\n\n // Leeren des Caches\n $orm->clearCache();\n\n // global\n $orm->import\n (\n 'WbfsysRoleGroup',\n array\n (\n array\n (\n 'name' => 'name_1',\n 'access_key' => 'access_key_1',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisici elit,\nsed eiusmod tempor incidunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\naliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit\nesse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt\nmollit anim id est laborum.'\n ),\n )\n );\n\n }",
"public function setDataGroup($datagroup) {\n\t\t$this->datagroup = $datagroup;\n\t}",
"function editGroupHandler() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n 'admin_id' => getLogin()['uid']\n ]);\n\n formatOutput(true, 'update success');\n}",
"public function testConvertingInternalFields()\n {\n $parameters = [\n \"first\" => \"1\",\n \"MERGE||second\" => \"2\",\n \"third\" => \"3\",\n \"fourth\" => \"4\",\n \"MERGE||fifth\" => \"5\"\n ];\n $expected = [\n \"first\" => \"1\",\n \"MERGE||second\" => \"2\",\n \"third\" => \"3\",\n \"fourth\" => \"4\",\n \"MERGE||fifth\" => \"5\",\n \"merge_fields\" => [\n \"second\" => \"2\",\n \"fifth\" => \"5\"\n ]\n ];\n $result = $this->mailchimpDataUtils->convertMergeFieldsToMailchimpFields($parameters);\n $this->assertEquals($expected, $result);\n }",
"function acf_write_json_field_group($field_group)\n{\n}"
] | [
"0.57966816",
"0.5575952",
"0.5446534",
"0.53182226",
"0.5272316",
"0.5179195",
"0.51724285",
"0.5086318",
"0.5066295",
"0.50496334",
"0.5048249",
"0.5047149",
"0.5033409",
"0.502626",
"0.4991798",
"0.4972407",
"0.4972036",
"0.49545598",
"0.49514204",
"0.49490663",
"0.49478254",
"0.49434698",
"0.4927511",
"0.48761067",
"0.48748878",
"0.48683754",
"0.48676488",
"0.48623702",
"0.4861225",
"0.48577398",
"0.48357278",
"0.4831529",
"0.48241472",
"0.48237532",
"0.4812044",
"0.48100913",
"0.48077503",
"0.47972327",
"0.47909263",
"0.47856694",
"0.47800848",
"0.47798556",
"0.47767913",
"0.4757126",
"0.4752881",
"0.4751994",
"0.47448835",
"0.47191373",
"0.47115892",
"0.4707838",
"0.47007418",
"0.47007176",
"0.4681623",
"0.46703693",
"0.46647128",
"0.46640193",
"0.4659022",
"0.4651239",
"0.4649421",
"0.46473122",
"0.46441284",
"0.4634991",
"0.4630345",
"0.46289426",
"0.46137732",
"0.46115783",
"0.4598176",
"0.45966423",
"0.45904753",
"0.4590067",
"0.4586023",
"0.45847604",
"0.4570415",
"0.45703298",
"0.45593137",
"0.45589632",
"0.45586342",
"0.45563996",
"0.45544618",
"0.4553077",
"0.4549007",
"0.4546966",
"0.45332223",
"0.4531115",
"0.4517572",
"0.45095062",
"0.45057136",
"0.4503142",
"0.45000392",
"0.44991416",
"0.44867647",
"0.4482023",
"0.44809914",
"0.4470282",
"0.44598627",
"0.44571",
"0.44557112",
"0.44489786",
"0.44454375",
"0.44398835"
] | 0.48057598 | 37 |
Tests a data reference in an action group resolved with its default state. | public function testGetStepsWithNoArgs()
{
$this->setEntityObjectHandlerReturn(function ($entityName) {
if ($entityName == "data1") {
return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();
}
});
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])
->build();
$steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testDefaultGroup(){\n jAcl2DbUserGroup::setDefaultGroup(self::$grpId2,false);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n jAcl2DbUserGroup::setDefaultGroup(self::$grpId2,true);\n self::$defaultGroupId = self::$grpId2; // for next test method\n self::$groups[1]['grouptype']=1;\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n }",
"public function testGetStepsWithOuterScopePersistence()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);\n }",
"public function isValid($action, $default = TRUE) {\n //return $this->objDT->isValid($action, $default);\n return TRUE;\n }",
"function checkData($callable, $params = null, $group = null){\r\n \t\t$group = ($group) ? $group : $this->_options['defaultgroup'];\r\n \r\n \t\t// Get the storage handler\r\n \t\t$handler =& $this->_getStorage();\r\n \t\tif (!JError::isError($handler) && $this->_options['caching']) {\r\n \t\t\treturn !!$handler->get($this->_makeId($callable, $params), $group, (isset($this->_options['checkTime']))? $this->_options['checkTime'] : true);\r\n \t\t}\r\n \t\treturn false;\r\n }",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"public function testdefaultUserDataAvailable()\n {\n $logger = new Logger('error-log');\n $logger->pushHandler(new SentryMonologHandler());\n \n // Setup the \"fixture data\" for this test\n $this->logInWithPermission('admin');\n\n $userDataThatWasSet = $logger->getClient()->getData()['user'];\n\n // Cannot get Member data at by default at initialisation time\n $this->assertEquals('Unavailable', $userDataThatWasSet['ID']);\n $this->assertEquals('Unavailable', $userDataThatWasSet['Email']);\n }",
"public function verifyUpdateDefault($data) {\n if(isset($data['is_default'])) {\n return Language::where('status', '1')\n ->update(['is_default' => '0']);\n }\n\n return false;\n }",
"public function init( $data ){\n\t\t\t\n\t\t\t$this->data = $data;\n\t\t\t\n\t\t\t//If first position array entry is init?\n\t\t\t$action = key( $data );\n\t\t\t\n\t\t\tif( ( strpos( $action, 'action' ) === 0 ) && !empty( $data[ $action ] ) ){\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t$this->action = $data[ $action ];\n\t\t\t\t\n\t\t\t\t$isset = $this->set();\n\t\t\t\t\t\t\t\n\t\t\t\t//Is Data Valid, more checks? \n\t\t\t\tif( $isset )\n\t\t\t\t\t$this->valid = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//return false;\n\t\t}",
"final protected function runBasicAction( $sAction,\r\n array $asArgv = [] ){\r\n $bReturn = false;\r\n switch ( $sAction ){\r\n case \"default\":\r\n $bReturn = $this->oModel->runBasicDataAction( $sAction,\r\n $asArgv );\r\n break;\r\n\r\n case \"none\":\r\n $bReturn = true;\r\n break;\r\n } // switch ( $sAction )\r\n\r\n return $bReturn;\r\n }",
"public function testGetDefault() : void\n {\n $reflex = new \\ReflectionClass($this->getTestedInstance());\n $instance = $reflex->newInstanceWithoutConstructor();\n\n $default = $reflex->getProperty('default');\n $default->setAccessible(true);\n\n $this->getTestCase()->assertNull($instance->getDefault());\n $default->setValue($instance, true);\n $this->getTestCase()->assertTrue($instance->getDefault());\n $default->setValue($instance, new \\stdClass());\n $this->getTestCase()->assertInstanceOf(\\stdClass::class, $instance->getDefault());\n\n return;\n }",
"public function testValidationDefault() {\n\n $goodData = $this->goodData;\n $goodData['title'] = 'titletestValidationDefault';\n $link = $this->Links->newEntity();\n $link = $this->Links->patchEntity($link, $goodData);\n $this->Links->save($link);\n $insertedData = $this->Links->find('all')\n ->where(['Links.title =' => $goodData['title']])\n ->toArray()[0];\n // FIXME Pass this test\n //$this->assertNotNull($insertedData->views,'views is not null');\n $this->assertEquals(0, $insertedData->views,'views counter is set to 0');\n }",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function testSetData() {\r\n $this->assertInstanceOf('PM\\Main\\Event\\Action\\Emit', $this->_action->setData(array()));\r\n $this->assertEquals(array(), $this->_action->getData());\r\n }",
"public function setActionState($data) {\n $this->checkActionState($data);\n $this->changeActionState($data);\n $this->refreshAuthWithAction($data->param1);\n }",
"public function dataIsReference()\n {\n return [\n [\n '/* testBitwiseAndA */',\n false,\n ],\n [\n '/* testBitwiseAndB */',\n false,\n ],\n [\n '/* testBitwiseAndC */',\n false,\n ],\n [\n '/* testBitwiseAndD */',\n false,\n ],\n [\n '/* testBitwiseAndE */',\n false,\n ],\n [\n '/* testBitwiseAndF */',\n false,\n ],\n [\n '/* testBitwiseAndG */',\n false,\n ],\n [\n '/* testBitwiseAndH */',\n false,\n ],\n [\n '/* testBitwiseAndI */',\n false,\n ],\n [\n '/* testFunctionReturnByReference */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceC */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceD */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceE */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceF */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceG */',\n true,\n ],\n [\n '/* testForeachValueByReference */',\n true,\n ],\n [\n '/* testForeachKeyByReference */',\n true,\n ],\n [\n '/* testArrayValueByReferenceA */',\n true,\n ],\n [\n '/* testArrayValueByReferenceB */',\n true,\n ],\n [\n '/* testArrayValueByReferenceC */',\n true,\n ],\n [\n '/* testArrayValueByReferenceD */',\n true,\n ],\n [\n '/* testArrayValueByReferenceE */',\n true,\n ],\n [\n '/* testArrayValueByReferenceF */',\n true,\n ],\n [\n '/* testArrayValueByReferenceG */',\n true,\n ],\n [\n '/* testArrayValueByReferenceH */',\n true,\n ],\n [\n '/* testAssignByReferenceA */',\n true,\n ],\n [\n '/* testAssignByReferenceB */',\n true,\n ],\n [\n '/* testAssignByReferenceC */',\n true,\n ],\n [\n '/* testAssignByReferenceD */',\n true,\n ],\n [\n '/* testAssignByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceA */',\n true,\n ],\n [\n '/* testPassByReferenceB */',\n true,\n ],\n [\n '/* testPassByReferenceC */',\n true,\n ],\n [\n '/* testPassByReferenceD */',\n true,\n ],\n [\n '/* testPassByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceF */',\n true,\n ],\n [\n '/* testPassByReferenceG */',\n true,\n ],\n [\n '/* testPassByReferenceH */',\n true,\n ],\n [\n '/* testPassByReferenceI */',\n true,\n ],\n [\n '/* testPassByReferenceJ */',\n true,\n ],\n [\n '/* testNewByReferenceA */',\n true,\n ],\n [\n '/* testNewByReferenceB */',\n true,\n ],\n [\n '/* testUseByReference */',\n true,\n ],\n [\n '/* testArrowFunctionReturnByReference */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testClosureReturnByReference */',\n true,\n ],\n ];\n\n }",
"public function testIndexGroupActionPostSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => ['2', '3']\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$this->checkFlashMessage(__('Processing of selected tasks put in queue...'));\n\t}",
"public function testBasicAssignments() {\n\t\t$query = new Query();\n\t\t$group = ['key' => 'hits', 'reduce' => 'function() {}'];\n\t\t$calculate = 'count';\n\n\t\t$this->assertNull($query->group());\n\t\t$query->group($group);\n\t\t$this->assertEqual($group, $query->group());\n\n\t\t$this->assertNull($query->calculate());\n\t\t$query->calculate($calculate);\n\t\t$this->assertEqual($calculate, $query->calculate());\n\n\t\t$query = new Query(compact('calculate', 'group'));\n\t\t$this->assertEqual($group, $query->group());\n\t\t$this->assertEqual($calculate, $query->calculate());\n\n\t\t$query->group(false);\n\t\t$this->assertNull($query->group());\n\t}",
"public function can_do_default() {\n $id = $this->optional_param('id', 0, PARAM_INT);\n\n $schedule_id = 0;\n\n //try to obtain the workflow's report schedule id\n if (isset($this->workflow)) {\n $data = $this->workflow->unserialize_data();\n if ($data !== NULL && isset($data['schedule_id'])) {\n $schedule_id = (int)$data['schedule_id'];\n }\n }\n\n if ($id !== 0 || $schedule_id !== 0) {\n return $this->can_do_edit();\n } else {\n return $this->can_do_add();\n }\n }",
"function get_default_action()\r\n {\r\n return self :: DEFAULT_ACTION;\r\n }",
"function get_default_action()\r\n {\r\n return self :: DEFAULT_ACTION;\r\n }",
"function get_default_action()\r\n {\r\n return self :: DEFAULT_ACTION;\r\n }",
"static function get_default_state();",
"public function call($data, $action)\n {\n }",
"public function getDefaultHasAction()\n {\n return 1;\n }",
"public function getDefaultHasAction()\n {\n return 1;\n }",
"public function getDefaultHasAction()\n {\n return 1;\n }",
"function test_init_action_is_run() {\n\t}",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"public function testSetDefault() : void\n {\n $reflex = new \\ReflectionClass($this->getTestedInstance());\n $instance = $reflex->newInstanceWithoutConstructor();\n\n $hasDefault = $reflex->getProperty('hasDefault');\n $hasDefault->setAccessible(true);\n\n $default = $reflex->getProperty('default');\n $default->setAccessible(true);\n\n $this->getTestCase()->assertFalse($hasDefault->getValue($instance));\n $this->getTestCase()->assertnull($default->getValue($instance));\n\n $this->getTestCase()->assertSame($instance, $instance->setDefault(null));\n $this->getTestCase()->assertTrue($hasDefault->getValue($instance));\n $this->getTestCase()->assertnull($default->getValue($instance));\n\n $this->getTestCase()->assertSame($instance, $instance->setDefault(new \\stdClass()));\n $this->getTestCase()->assertTrue($hasDefault->getValue($instance));\n $this->getTestCase()->assertInstanceOf(\\stdClass::class, $default->getValue($instance));\n\n $this->getTestCase()->assertSame($instance, $instance->setDefault(true));\n $this->getTestCase()->assertTrue($hasDefault->getValue($instance));\n $this->getTestCase()->assertTrue($default->getValue($instance));\n\n return;\n }",
"static function get_default_action()\r\n {\r\n return self :: DEFAULT_ACTION;\r\n }",
"static function get_default_action()\r\n {\r\n return self :: DEFAULT_ACTION;\r\n }",
"public function testIndexGroupActionPostSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => ['1', '2']\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/hr/deferred/index', $opt);\n\t\t$this->checkFlashMessage(__('Selected tasks has been processed.'));\n\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t3 => '3',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}",
"public function testExistingNodeSettingsLoad() {\n $this->createTestContentType();\n\n $action = 'access_denied';\n $node_id = $this->createTestNode($action);\n $this->loadNodeFormForTestNode($node_id);\n $default_option_id = 'edit-rh-action-'\n . str_replace('_', '-', $action);\n $this->assertFieldChecked($default_option_id);\n }",
"public function test(&$element, $value, $group = null, &$input = null, &$form = null)\n {\n // Get the possible field actions and the ones posted to validate them.\n $fieldActions = self::getFieldActions($element);\n $valueActions = self::getValueActions($value);\n\n // Make sure that all posted actions are in the list of possible actions for the field.\n foreach ($valueActions as $action)\n {\n if (!in_array($action, $fieldActions))\n {\n return false;\n }\n }\n\n return true;\n }",
"public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }",
"public function getDefaultAction();",
"public function getDefaultAction();",
"public function getDefaultAction();",
"function store($id, $group, $data)\n {\n return true;\n }",
"public function testDefaultNodeSettingsLoad() {\n $this->createTestContentType();\n $this->loadNewNodeFormForTestContentType();\n\n $this->assertNoFieldByName('rh_override');\n $this->assertFieldByName('rh_action', 'access_denied');\n $this->assertFieldByName('rh_action', 'display_page');\n $this->assertFieldByName('rh_action', 'page_not_found');\n $this->assertFieldByName('rh_action', 'page_redirect');\n $default_option_id = 'edit-rh-action-'\n . str_replace('_', '-', self::DEFAULT_ACTION);\n $this->assertFieldChecked($default_option_id);\n }",
"public function pickTarget(Blackbox_Data $data)\n\t{\n\t\t$won = $this->group->getWinner();\n\t\tif ($won !== NULL\n\t\t\t&& $this->state_data->target_name != $won)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\treturn parent::pickTarget($data);\n\t\t}\n\t\tcatch (OLPBlackbox_FailException $e)\n\t\t{\n\t\t\t$this->group->setWinner($this->state_data->target_name);\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"protected function _checkValueDetailDefault($arr)\n\t{\n\t\tglobal $varsRequest;\n\n\t\t$array = &$arr['vars'];\n\n\t\tforeach ($array as $key => $value) {\n\t\t\tif (!is_null($value['vars']['flagUse'])) {\n\t\t\t\tif ($value['vars']['idTarget'] == $arr['idTarget']\n\t\t\t\t\t&& $value['flagDefault']\n\t\t\t\t\t&& $varsRequest['query']['func'] == 'DetailEdit'\n\t\t\t\t) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif ($value['child']) {\n\t\t\t\t$flag = $this->_checkValueDetailDefault(array(\n\t\t\t\t\t'vars' => $array[$key]['child'],\n\t\t\t\t\t'idTarget' => $arr['idTarget'],\n\t\t\t\t));\n\t\t\t\tif ($flag) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function hasAssignment(ElementableDependencyDataProvider $data_provider): bool;",
"protected function getDefaultAction() {\t\n\t\treturn __DEFAULT_ACTION__;\n\t}",
"public function testGroupContentRespectUnpublishedArgument() {\n $view = Views::getView('test_moderated_group_content');\n $view->setDisplay();\n\n /** @var \\Drupal\\user\\UserInterface$user1 */\n $user1 = $this->container->get('current_user')->getAccount();\n\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group1 */\n $group1 = Group::create([\n 'type' => 'default',\n 'label' => $this->randomMachineName(),\n ]);\n $group1->save();\n\n /** @var \\Drupal\\node\\Entity\\Node $node1 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node1',\n 'moderation_state' => 'draft',\n ])->save();\n $node1 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node1']\n );\n $node1 = current($node1);\n\n /** @var \\Drupal\\node\\Entity\\Node $node2 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node2',\n 'moderation_state' => 'published',\n ])->save();\n $node2 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node2']\n );\n $node2 = current($node2);\n $group1->addContent($node1, 'group_node:default');\n $group1->addContent($node2, 'group_node:default');\n $group1->addMember($user1);\n\n $view->preview();\n $this->assertEquals(0, count($view->result), 'No results when group id argument is not present.');\n $view->destroy();\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Member can see their own unpublished content.');\n\n $user2 = User::create(['name' => $this->randomString()]);\n $user2->save();\n $this->container->get('current_user')->setAccount($user2);\n\n /** @var \\Drupal\\node\\Entity\\Node $node3 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node3',\n 'moderation_state' => 'draft',\n ])->save();\n $node3 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node3']\n );\n $node3 = current($node3);\n $group1->addContent($node3, 'group_node:default');\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Outsider can see their own unpublished content.');\n $view->destroy();\n\n $this->container->get('current_user')->setAccount($user1);\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(2, count($view->result), 'Member can see any (own + outsiders) unpublished content.');\n $view->destroy();\n\n }",
"public function testFindDefault()\n {\n $data = array(\n 'customerId' => '33160580-3e25-49f4-b01c-274634cb3011'\n );\n $this->resource->findDefault($data);\n\n $this->assertAttributeEquals(BASE_URL, 'base_url', $this->connector, 'Failed. Base url not correct');\n $this->assertAttributeEquals('GET', 'method', $this->connector, 'Failed. Method is not correct');\n $this->assertAttributeEquals('paymentmethods/default?' . http_build_query($data), 'url', $this->connector, 'Failed. Url is not correct');\n\n }",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => '2'\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testHasDefault() : void\n {\n $reflex = new \\ReflectionClass($this->getTestedInstance());\n $instance = $reflex->newInstanceWithoutConstructor();\n\n $hasDefault = $reflex->getProperty('hasDefault');\n $hasDefault->setAccessible(true);\n\n $this->getTestCase()->assertFalse($instance->hasDefault());\n $hasDefault->setValue($instance, true);\n $this->getTestCase()->assertTrue($instance->hasDefault());\n\n return;\n }",
"public function testActionUseCase3()\n {\n\n // person, user, and target\n $user = factory(UserEloquent::class)->create();\n $person = factory(PersonEloquent::class)->create([\n 'is_pre_approved' => 0,\n 'is_primary' => 0,\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $stageId = StageEloquent::where('label', 'prospect')->where('user_id', null)->first()->getKey();\n $stageLeadId = StageEloquent::where('label', 'lead')->where('user_id', null)->first()->getKey();\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $stageId,\n 'lead_type_id' => $leadTypeId,\n ]);\n $tag = TagEloquent::find(10);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n\n // workflow, rule, action and object\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_pre_approved',\n 'value' => '1',\n ]);\n $action2 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'person_contexts',\n 'target_field' => 'stage_id',\n 'value' => $stageLeadId,\n ]);\n $workflow->actions()->sync([$action1->getKey(), $action2->getKey()]); //\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $tag->getKey(),\n ]);\n\n\n // // parent rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'not preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '0'\n ]);\n\n // dependent rule\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'is prospect person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $stageId,\n 'parent_id' => $rule1->getKey(),\n ]);\n $action1->rules()->sync([ $rule1->getKey()]);\n $action2->rules()->sync([ $rule2->getKey()]);\n\n\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n //// check should failed /////\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n 'info' => 'Dependent rule(s) not meet!',\n ]);\n $this->notSeeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n //// second run, run action 1 first /////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //echo $output->fetch();\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(),\n 'object_id' => $person->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('persons',[\n 'id' => $person->getKey(),\n $action1->target_field => $action1->value,\n ]);\n\n //// second run, run action 2 then ///\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $person);\n }",
"function getDefaultState()\r\n\t{\r\n\t}",
"function MyMod_Data_Group_Actual_Get()\n {\n $this->PostInitItems();\n\n if (!empty($this->CurrentDataGroup))\n {\n $group=$this->CurrentDataGroup;\n }\n else\n {\n $group=$this->GetCGIVarValue($this->GroupDataCGIVar());\n }\n\n $groups=$this->MyMod_Data_Group_Defs_Get();\n if (!preg_grep('/^'.$group.'$/',array_keys($groups)))\n {\n $group=\"\";\n }\n\n if (\n empty($group)\n ||\n !$this->MyMod_Item_Group_Allowed($groups[ $group ])\n )\n {\n //No group found (or group found was not allowed)\n //Localize first allowed data group\n foreach ($groups as $rgroup => $groupdef)\n {\n if ($this->MyMod_Item_Group_Allowed($groups[ $rgroup ]))\n {\n $group=$rgroup;\n break;\n }\n }\n }\n\n return $group;\n }",
"public function setExpectedAction($action);",
"public function test_do_action_funcname( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"function testFindWithoutResult() {\r\n $this->assertNull(\r\n \t$this->actionForwards->find(\"wrongKey\"), \"Found an forward where no one is expected!\"\r\n );\r\n }",
"public function testGroup(){\n //invalid value should not change its default value\n $this->CI->task->group = 5;//greater\n $this->assertNull($this->CI->task->group, 'test >= 5');\n \n //invalid value type should not change its default value\n $this->CI->task->group = 'text';\n $this->assertNull($this->CI->task->group, 'test non-integer');\n \n //valid value\n $this->CI->task->group = 4;\n $this->assertEquals(4, $this->CI->task->group);\n }",
"public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function load($data, $formName = null)\n {\n if ($this->isNonexistent()) return false;\n\n if (!$this->inputFieldsGroup->isActiveInputFields() &&\n !$this->inputFilesGroup->isActiveInputFiles() &&\n !$this->inputImagesGroup->isActiveInputImages() &&\n !$this->inputConditionsGroup->isActiveInputConditions()\n ) return false;\n\n $isSomethingLoaded = false;\n\n if (!$this->inputFieldsGroup->isActiveInputFields())\n $inputFieldsLoaded = true;\n else\n if ($inputFieldsLoaded = $this->inputFieldsGroup->load($data))\n $isSomethingLoaded = true;\n\n if (!$this->inputFilesGroup->isActiveInputFiles())\n $inputFilesLoaded = true;\n else\n if ($inputFilesLoaded = $this->inputFilesGroup->load($data))\n $isSomethingLoaded = true;\n\n if (!$this->inputImagesGroup->isActiveInputImages())\n $inputImagesLoaded = true;\n else\n if ($inputImagesLoaded = $this->inputImagesGroup->load($data))\n $isSomethingLoaded = true;\n\n if (!$this->inputConditionsGroup->isActiveInputConditions())\n $inputConditionsLoaded = true;\n else\n if ($inputConditionsLoaded = $this->inputConditionsGroup->load($data))\n $isSomethingLoaded = true;\n\n //if ($inputConditionsLoaded)\n// throw new \\yii\\base\\Exception(print_r([\n// $inputFieldsLoaded,\n// $inputFilesLoaded,\n// $inputImagesLoaded,\n// $inputConditionsLoaded\n// ], true));\n\n if ($isSomethingLoaded) return true;\n\n if ($inputFieldsLoaded && $inputFilesLoaded && $inputImagesLoaded && $inputConditionsLoaded)\n return true;\n\n return false;\n }",
"public function fetchGroupData() {}",
"public function fetchGroupData() {}",
"public function testGetGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testValidationDefaultNoAnyFields()\r\n {\r\n $data = $this->getCorrectData();\r\n unset($data['name']);\r\n unset($data['locked']);\r\n unset($data['ref_artifact_id']);\r\n unset($data['status']);\r\n $artifact = $this->Artifacts->newEntity($data);\r\n $this->assertEmpty($artifact->errors());\r\n }",
"function testGetState2(){\n \t$existingAnswer = new Answer(2); //Answer of formdest_id = 2\n\t\t$this->assertEqual($existingAnswer->getState(), TRUE);\n }",
"private function assertOnMergeKeyAndActionValue($actions, $expectedValue, $expectedMergeKey = null)\n {\n $expectedMergeKey = $expectedMergeKey ??\n ActionGroupObjectBuilder::DEFAULT_ACTION_OBJECT_NAME . self::ACTION_GROUP_MERGE_KEY;\n $this->assertArrayHasKey($expectedMergeKey, $actions);\n\n $action = $actions[$expectedMergeKey];\n $this->assertEquals($expectedMergeKey, $action->getStepKey());\n $this->assertEquals($expectedValue, $action->getCustomActionAttributes());\n }",
"function dataDefatult($data, $defaultD) {\r\n if ($data)\r\n return $data;\r\n return $defaultD;\r\n}",
"public function dataAction() {\n parent::dataAction();\n }",
"public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function hasChangedTargetGroup();",
"public static function userHasPermissionForGroupAction($group, $action)\n\t{\n\t\t// Get user roles\n\t\t$roles = self::getGroupMemberRoles(\n\t\t\t\\User::get('id'),\n\t\t\t$group->get('gidNumber')\n\t\t);\n\n\t\t// Check to see if any of our roles for user has permission for action\n\t\tforeach ($roles as $role)\n\t\t{\n\t\t\t$permissions = json_decode($role['permissions']);\n\t\t\t$permissions = (is_object($permissions)) ? $permissions : new \\stdClass;\n\t\t\tif (property_exists($permissions, $action) && $permissions->$action == 1)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function setDefaultData(array $defaultData);",
"public function isDefault()\n\t{\n\t\treturn \\IPS\\Dispatcher::i()->application->directory == 'core' and \\IPS\\Dispatcher::i()->module->key == 'members' and \\IPS\\Dispatcher::i()->controller != 'groups';\n\t}",
"public function shouldReturnDefaultGroup()\n {\n $groups = array(\n 1 => array(\n 'name' => 'Reiche Schnösel',\n 'score' => '5000',\n 'methods' => array('foo', 'bar')\n ),\n 2 => array(\n 'name' => 'Arme Tropfe',\n 'score' => 'ABCD',\n 'methods' => array('foo')\n )\n );\n $this->config->set('solvency-groups', array(\n 'default-group' => 1,\n 'solvency-groups' => serialize($groups)\n ));\n $this->assertEquals(\n $groups[1]['name'],\n $this->config->getDefaultSolvencyGroup()->getName(),\n 'Default group is not the one we expexted.'\n );\n }",
"public function store($id, $group, $data)\n\t{\n\t\treturn true;\n\t}",
"public function testDefaultValues() {\n\t\t$this->assertSame(null, $this->Field->mapToName());\n\t\tlist($callback, $mapToName) = $this->Field->map();\n\t\t$this->assertSame(1, $callback(1));\n\t\t$this->assertSame(null, $mapToName);\n\t}",
"protected function loadData()\n {\n $this->id = $this->getParameter('id', 'int', null);\n if ($this->id == null || !BackendMailengineModel::existsGroup($this->id)) {\n $this->redirect(BackendModel::createURLForAction('groups') . '&error=non-existing');\n }\n\n $this->record = BackendMailengineModel::getGroup($this->id);\n }",
"public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }",
"public function testForgetPushed0()\n{\n\n $actual = $this->dispatcher->forgetPushed();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testDefaultElement()\n\t{\n\t\t$_POST['form'] = 'dropdown';\n\t\t$_POST['default_element'] = '1337';\n\t\t$this->assertTrue($this->ddmDefaultElement->isFilled());\n\t\t$this->assertEquals($_POST['default_element'], $this->ddmDefaultElement->getValue());\n\t}",
"public function test_do_action_closure( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"function grp_actions($type, $gid) {\n global $db;\n $gdetails = $this->get_details($gid);\n\n if (!$gdetails)\n e(lang(\"grp_exist_error\"));\n else {\n switch ($type) {\n case \"activate\":\n case \"active\": {\n $db->update(tbl($this->gp_tbl), array(\"active\"), array(\"yes\"), \" group_id='$gid' \");\n e(lang(\"grp_av_msg\"), \"m\");\n }\n break;\n case \"deactivate\":\n case \"deactive\": {\n\n $db->update(tbl($this->gp_tbl), array(\"active\"), array(\"no\"), \" group_id='$gid' \");\n e(lang(\"grp_da_msg\"), \"m\");\n }\n break;\n case \"featured\":\n case \"feature\": {\n $db->update(tbl($this->gp_tbl), array(\"featured\"), array(\"yes\"), \" group_id='$gid' \");\n e(lang(\"grp_fr_msg\"), \"m\");\n }\n break;\n case \"unfeatured\":\n case \"unfeature\": {\n $db->update(tbl($this->gp_tbl), array(\"featured\"), array(\"no\"), \" group_id='$gid' \");\n e(lang(\"grp_fr_msg2\"), \"m\");\n }\n break;\n case \"delete\": {\n $this->delete_group($gid);\n e(lang(\"grp_del_msg\"), \"m\");\n }\n break;\n }\n }\n }",
"public function setDefaultAction($default);",
"protected function has_data()\n {\n }",
"public function assign_values(&$action, $id = 0, $ref = '')\n {\n // phpcs:enable\n\t\tglobal $conf, $langs;\n\t\tglobal $form, $formcompany;\n\n\t\t$ret = $this->getObject($id, $ref);\n\n\t\tparent::assign_values($action);\n\n $this->tpl['title'] = load_fiche_titre($this->getTitle($action));\n\n\t\tif ($action == 'create' || $action == 'edit')\n\t\t{\n\t\t\t$this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civility_id'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Confirm delete third party\n\t\t\tif ($action == 'delete' || $conf->use_javascript_ajax)\n\t\t\t{\n\t\t\t\t$this->tpl['action_delete'] = $form->formconfirm($_SERVER[\"PHP_SELF\"].\"?socid=\".$this->object->id, $langs->trans(\"DeleteAnIndividual\"), $langs->trans(\"ConfirmDeleteIndividual\"), \"confirm_delete\", '', 0, \"1,action-delete\");\n\t\t\t}\n\t\t}\n }",
"public function testExceptionOnMissingArguments()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function testGetName() {\r\n $action = $this->_action->setName('name');\r\n $this->assertEquals('name', $action->getName());\r\n }",
"public function testAvailableGroupOperations()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function canActOnTarget($action,$target) {\n // owner of target -> always yes, except for verification\n // all other situatons -> check role action targets\n // - matching globals -> yes\n // - specifics\n // + gets messy\n // - otherwise -> no\n\n if (is_string($action)) {\n global $ACTIONS;\n $action = $ACTIONS[$action];\n }\n\n // system admin -> always yes\n if ($this->flag_is_system_admin) {\n return true;\n }\n\n// util_prePrintR($action);\n// util_prePrintR($target);\n\n // owner of target -> always yes, except for verification\n if ($target->user_id == $this->user_id) {\n if ($action->name != 'verify') { return true; }\n }\n\n\n // view & list is controlled by flags on the object rather than explicit permissions / access records\n if (($action->name == 'view') || ($action->name == 'list')) {\n if (array_key_exists('flag_active',$target->fieldValues)) {\n if ($target->flag_active) {\n return true;\n }\n } elseif (array_key_exists('flag_workflow_published',$target->fieldValues)) {\n if (($target->flag_workflow_published) && (($target->flag_workflow_validated))) {\n return true;\n }\n }\n }\n\n // all other situatons -> check role action targets\n $this->cacheRoleActionTargets();\n\n // - matching globals -> yes\n $target_global_type = Role_Action_Target::getGlobalTargetTypeForObject($target);\n if (in_array($target_global_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_global_type] as $glob_rat) {\n if ($glob_rat->action_id == $action->action_id) {\n return true;\n }\n }\n }\n\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n // - specifics\n // + gets messy\n\n // if the allowed target types do not contain the specific type of the target in question, then no need to go further\n\n // get a list of all the specific ids to check. This gets a bit messy as we have to climb or include a hierarchy depending on what exactly the target is\n\n// util_prePrintR($target);\n\n $ids_to_check = array();\n\n $target_class = get_class($target);\n switch ($target_class) {\n case 'Authoritative_Plant':\n $ids_to_check = array($target->authoritative_plant_id);\n break;\n case 'Authoritative_Plant_Extra':\n // can act on this if can act on the plant\n return $this->canActOnTarget($action,$target->getAuthoritativePlant());\n break;\n case 'Metadata_Structure':\n // can edit this if can edit itself or any parent\n $ids_to_check = Db_Linked::arrayOfAttrValues($target->getLineage(),'metadata_structure_id');\n break;\n case 'Metadata_Term_Set':\n // can edit if can edit any structure that uses this term set\n $structures = Metadata_Structure::getAllFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection);\n $ids_to_check = array();\n foreach ($structures as $s) {\n $ids_to_check = array_merge($ids_to_check,Db_Linked::arrayOfAttrValues($s->getLineage(),'metadata_structure_id'));\n }\n break;\n case 'Metadata_Term_Value':\n // can edit if can edit any structure that uses the term set for which this is a value\n return $this->canActOnTarget($action,Metadata_Term_Set::getOneFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection));\n break;\n case 'Metadata_Reference':\n // can edit if can edit anything to which this refers\n return $this->canActOnTarget($action,$target->getReferrent());\n break;\n case 'Notebook':\n $ids_to_check = array($target->notebook_id);\n break;\n case 'Notebook_Page':\n // can act on if can act on the notebook that contains this page\n return $this->canActOnTarget($action,$target->getNotebook());\n break;\n case 'Notebook_Page_Field':\n // can act on if can act on the notebook that contains the notebook page that this page field\n return $this->canActOnTarget($action,$target->getNotebookPage()->getNotebook());\n break;\n case 'Specimen':\n $ids_to_check = array($target->specimen_id);\n break;\n case 'Specimen_Image':\n // can act on if can act on the specimen\n return $this->canActOnTarget($action,$target->getSpecimen());\n break;\n default:\n break;\n }\n\n// util_prePrintR($ids_to_check);\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n $target_specific_type = Role_Action_Target::getSpecificTargetTypeForObject($target);\n if (! in_array($target_specific_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n return false;\n }\n\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_specific_type] as $spec_rat) {\n if (($spec_rat->action_id == $action->action_id) && (in_array($spec_rat->target_id,$ids_to_check))) {\n if ($action->name == 'view') {\n $actual_target = $spec_rat->getTargets()[0];\n if (array_key_exists('flag_workflow_published',$actual_target->fieldValues)) {\n return $actual_target->flag_workflow_published && $actual_target->flag_workflow_validated;\n }\n }\n return true;\n }\n }\n\n return false;\n }",
"public function testValidationDefaultCorrect()\r\n {\r\n $data = $this->getCorrectData();\r\n $artifact = $this->Artifacts->newEntity($data);\r\n $this->assertEmpty($artifact->errors());\r\n }",
"public function testResolve0()\n{\n\n // Traversed conditions\n // if (!$this->cached) == false (line 193)\n\n $actual = $this->handlerStack->resolve();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testStateIssuedCorrectly()\n {\n $this->assertNull($this->state->issue());\n }",
"public function isActionAllowed($section, $reference, $action = NULL) ;",
"function _initData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$this->_data = null;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}",
"public function testDefaults()\n {\n $doc = new Feature();\n $this->assertTrue($doc->getIsActive());\n }",
"function _acf_apply_is_local_field_group_key($bool, $id)\n{\n}",
"public function test_admin_group_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'group_list']);\n $this->assertResponseCode(404);\n }"
] | [
"0.585288",
"0.5543096",
"0.53329015",
"0.5300506",
"0.52045625",
"0.5021562",
"0.49911073",
"0.49374685",
"0.4908047",
"0.4897302",
"0.4858217",
"0.483455",
"0.48013476",
"0.4773542",
"0.4728716",
"0.47107366",
"0.47061822",
"0.47039708",
"0.46993744",
"0.46973863",
"0.468146",
"0.46791455",
"0.46690932",
"0.46690932",
"0.46690932",
"0.46573526",
"0.46557298",
"0.4654807",
"0.4654807",
"0.4654807",
"0.4635326",
"0.4624526",
"0.4605765",
"0.46023613",
"0.46023613",
"0.46007273",
"0.4573765",
"0.45660177",
"0.45552817",
"0.45517877",
"0.45517877",
"0.45517877",
"0.45451322",
"0.4531831",
"0.45292532",
"0.45025793",
"0.44983962",
"0.44857544",
"0.4481907",
"0.44765854",
"0.4474026",
"0.4470607",
"0.44689825",
"0.44600463",
"0.44512573",
"0.4449444",
"0.44472533",
"0.44344273",
"0.44298893",
"0.44218016",
"0.44203633",
"0.44119692",
"0.44116575",
"0.44116575",
"0.4411569",
"0.44071355",
"0.44045296",
"0.4403732",
"0.44014573",
"0.44008932",
"0.43999374",
"0.43920434",
"0.43919405",
"0.43873957",
"0.43869737",
"0.4376082",
"0.43747705",
"0.4371278",
"0.43703714",
"0.43665305",
"0.4363406",
"0.4362721",
"0.43611437",
"0.43595725",
"0.43580604",
"0.43563884",
"0.4355585",
"0.43545848",
"0.43434322",
"0.434241",
"0.4329444",
"0.43211004",
"0.43198866",
"0.43189955",
"0.43158934",
"0.43124294",
"0.43047866",
"0.42965704",
"0.4293841",
"0.42928556"
] | 0.4987926 | 7 |
Tests a parameterized section reference in an action group resolved with user args. | public function testGetStepsWithParameterizedArg()
{
// Mock Entity Object Handler
$this->setEntityObjectHandlerReturn(function ($entityName) {
if ($entityName == "data2") {
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
}
});
// mock the section object handler response
$element = new ElementObject("element1", "textArea", ".selector {{var1}}", null, null, true);
$section = new SectionObject("testSection", ["element1" => $element]);
// bypass the private constructor
$sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();
AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects(
[new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]
)
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
// XML Data
$steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);
// Persisted Data
$steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isActionAllowed($section, $reference, $action = NULL) ;",
"public function testGetStepsWithParameterizedSimpleArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])]\n )\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n // String Literal\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']);\n\n // String Literal w/ data-like structure\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']);\n }",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"function section ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tsection');\n return $rc->newInstanceArgs( $arguments ); \n}",
"private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"abstract function perform($userinfo, $groupinfo, $args);",
"public function testHandleArgs()\n {\n $input = array('foo' => 'bar', 'bar' => 'baz');\n $lookup = new Lookup($input);\n\n $this->assertSame('bar', $lookup->getArg('foo'));\n $this->assertNull($lookup->getArg('animal'));\n $this->assertSame($input, $lookup->getArgs());\n }",
"public function isAuthorized($action = '', $params = array(), &$user = array()) {\n\t\tif (!$this->activeUser && empty($user)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($action)) {\n\t\t\t$action = $this->Auth->action();\n\t\t} else {\n\t\t\t$parsed = Router::parse($action);\n\t\t\t$action = Set::filter(array(Inflector::camelize($parsed['plugin']), Inflector::camelize($parsed['controller']), $parsed['action']));\n\t\t\t$action = implode('/', $action);\n\t\t}\n\n\t\tif (empty($user)) {\n\t\t\t$user =& $this->activeUser;\n\t\t}\n\t\tif (empty($params)) {\n\t\t\t$params = $this->passedArgs;\n\t\t}\n\t\tunset($user['ConditionalGroup']);\n\t\t$user['ConditionalGroup'] = $this->_setConditionalGroups($params, $user);\n\n\t\t// main group\n\t\t$mainAccess = Core::acl($user['Group']['id'], $action);\n\n\t\t$condAccess = false;\n\t\t// check for conditional group\n\t\tif (!empty($user['ConditionalGroup'])) {\n\t\t\tforeach ($user['ConditionalGroup'] as $group) {\n\t\t\t\t$condAccess = Core::acl($group['Group']['id'], $action, 'conditional');\n\t\t\t\tif ($condAccess) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $mainAccess || $condAccess;\n\t}",
"public function testExceptionOnMissingArguments()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n }",
"function testLoadVarFromSection(){\n\t\tTestsHelper::Print(\"testing magratheaConfig loading a var from a section...\");\n\t\t$confs = array(\n\t\t\t'this_section' => array(\n\t\t\t\t'this_var' => 'ok', \n\t\t\t\t'this_other_var' => 'ok2' ), \n\t\t\t'this_other_section' => array(\n\t\t\t\t'this_var' => 'ok3', \n\t\t\t\t'this_other_var' => 'ok4' ), \n\t\t\t'this_last_section' => array() \n\t\t );\n\t\t$this->magConfig->setConfig($confs);\n\t\t$this->magConfig->Save(true);\n\n\t\t$newConf = new ConfigFile();\n\t\t$newConf->setPath($this->configPath);\n\t\t$newConf->setFile($this->fileName);\n\t\t$section = (array)$newConf->GetConfig();\n\t\t$this->assertCount(3, $section);\n\n\t\t$section = $newConf->GetConfig(\"this_section\");\n\t\t$this->assertEquals($section[\"this_var\"], \"ok\");\n\n\t\t$var = $newConf->getConfig(\"this_other_section/this_var\");\n\n\n\t\t$this->assertEquals($var, \"ok3\");\n\t}",
"function checkSection($section) {\n\t\treturn in_array(\"*\", $this->_sections) || in_array($section, $this->_sections);\n\t}",
"public function testArgument() {\n $view = Views::getView('test_view');\n foreach (['en' => 'John', 'xx-lolspeak' => 'George'] as $langcode => $name) {\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('arguments', [\n 'langcode' => [\n 'id' => 'langcode',\n 'table' => 'views_test_data',\n 'field' => 'langcode',\n ],\n ]);\n $this->executeView($view, [$langcode]);\n\n $expected = [\n ['name' => $name],\n ];\n $this->assertIdenticalResultset($view, $expected, ['views_test_data_name' => 'name']);\n $view->destroy();\n }\n }",
"function cleanyeti_sections_callback( $section_passed ) {\n\tglobal $cleanyeti_tabs;\n\t$cleanyeti_tabs = cleanyeti_get_settings_page_tabs();\n\tforeach ( $cleanyeti_tabs as $tabname => $tab ) {\n\t\t$tabsections = $tab['sections'];\n\t\tforeach ( $tabsections as $sectionname => $section ) {\n\t\t\tif ( 'cleanyeti_' . $sectionname . '_section' == $section_passed['id'] ) {\n\t\t\t\t?>\n\t\t\t\t<p><?php echo $section['description']; ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}\n}",
"function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->REPLACEid == 0) ? -1 : $row->REPLACEid), $contentids))\r\n\t\t\treturn false;\r\n\r\n\t\t/* category included or excluded ? */\r\n\t\t$result = in_array((($row->REPLACEcatid == 0) ? -1 : $row->REPLACEcatid), $sections);\r\n\t\tif (($include && !$result) || (!$include && $result))\r\n\t\t\treturn false; /* include and not found OR exclude and found */\r\n\r\n\t\treturn true;\r\n\t}",
"public function isUserInSection($user){\n\t\t$sql = \"SELECT id_user FROM tbl_user_section_assignment WHERE id_section=:id_section AND id_user=:id_user\";\n\t\t$command = Yii::app()->db->createCommand($sql);\n\t\t$command->bindValue(\":id_section\", $this->id_section, PDO::PARAM_INT);\n\t\t$command->bindValue(\":id_user\", $user->id, PDO::PARAM_INT);\n\t\treturn $command->execute()==1;\n\t}",
"function testLoadVarFromSection(){\n\t\t\techo \"testing magratheaConfig loading a var from a section... <br/>\";\n\t\t\t$confs = array(\n\t\t\t\t'this_section' => array(\n\t\t\t\t\t'this_var' => 'ok', \n\t\t\t\t\t'this_other_var' => 'ok2' ), \n\t\t\t\t'this_other_section' => array(\n\t\t\t\t\t'this_var' => 'ok3', \n\t\t\t\t\t'this_other_var' => 'ok4' ), \n\t\t\t\t'this_last_section' => array() \n\t\t\t );\n\t\t\t$this->magConfig->setConfig($confs);\n\t\t\t$this->magConfig->Save(true);\n\n\t\t\t$newConf = new MagratheaConfigFile();\n\t\t\t$newConf->setPath($this->configPath);\n\t\t\t$newConf->setFile(\"test_conf.conf\");\n\t\t\t$section = $newConf->GetConfig();\n\t\t\t$this->assertEqual(count($section), 3);\n\n\t\t\t$section = $newConf->GetConfig(\"this_section\");\n\t\t\t$this->assertEqual($section[\"this_var\"], \"ok\");\n\n\t\t\t$var = $newConf->getConfig(\"this_other_section/this_var\");\n\n\t\t\t$this->assertEqual($var, \"ok3\");\n\t\t}",
"public function addSectionAction($values)\n\t{\n\t\t$this->vars['section_action'][] = (object) $values;\n\t}",
"public static function sectionURI($mnt,$section)\n{\nreturn self::commandURI($mnt,'section&name='.$section);\n}",
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testEditSection() {\n\t\t$name = 'Help:ApiEditPageTest_testEditSection';\n\t\t$page = WikiPage::factory( Title::newFromText( $name ) );\n\t\t$text = \"==section 1==\\ncontent 1\\n==section 2==\\ncontent2\";\n\t\t// Preload the page with some text\n\t\t$page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), 'summary' );\n\n\t\tlist( $re ) = $this->doApiRequestWithToken( array(\n\t\t\t'action' => 'edit',\n\t\t\t'title' => $name,\n\t\t\t'section' => '1',\n\t\t\t'text' => \"==section 1==\\nnew content 1\",\n\t\t) );\n\t\t$this->assertEquals( 'Success', $re['edit']['result'] );\n\t\t$newtext = WikiPage::factory( Title::newFromText( $name ) )\n\t\t\t->getContent( Revision::RAW )\n\t\t\t->getNativeData();\n\t\t$this->assertEquals( \"==section 1==\\nnew content 1\\n\\n==section 2==\\ncontent2\", $newtext );\n\n\t\t// Test that we raise a 'nosuchsection' error\n\t\ttry {\n\t\t\t$this->doApiRequestWithToken( array(\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'title' => $name,\n\t\t\t\t'section' => '9999',\n\t\t\t\t'text' => 'text',\n\t\t\t) );\n\t\t\t$this->fail( \"Should have raised a UsageException\" );\n\t\t} catch ( UsageException $e ) {\n\t\t\t$this->assertEquals( 'nosuchsection', $e->getCodeString() );\n\t\t}\n\t}",
"private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }",
"public function update( &$args ) {\n\n\t\t$section = $this->parse( $args );\n\n\t\tif ( empty( $section['section_id'] ) ) {\n\t\t\treturn $this->create( $args );\n\t\t}\n\n\t\t$section_id = $section['section_id'];\n\t\t$update_data = array(\n\t\t\t'section_name' => $section['section_name'],\n\t\t\t'section_course_id' => $section['section_course_id'],\n\t\t\t'section_order' => $section['section_order'],\n\t\t\t'section_description' => $section['section_description'],\n\t\t);\n\n\t\tglobal $wpdb;\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->learnpress_sections,\n\t\t\t$update_data,\n\t\t\tarray( 'section_id' => $section_id )\n\t\t);\n\t\t$section['section_id'] = $section_id;\n\n\t\treturn $section;\n\t}",
"public static function checkViewAccess($group, $section, $sub_section = NULL) {\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group_entity */\n $group_entity = \\Drupal::entityTypeManager()\n ->getStorage('group')\n ->load($group);\n /** @var \\Drupal\\living_spaces_sections\\LivingSpacesSectionsManagerInterface $service */\n $service = \\Drupal::service('living_spaces_sections.manager');\n\n if (!$group_entity ||\n !$service->isSectionsEnabled($group_entity->bundle()) ||\n !$group_entity->access('view')\n ) {\n return AccessResult::forbidden();\n }\n\n $path = implode('/', [$section, $sub_section]);\n $section = $service->getSectionFromGroupByPath($group_entity, $path);\n return AccessResult::allowedIf($section && $section->access('view'));\n }",
"public function testPluginsProvidingCustomAttributesAndContextualLinks() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'access contextual links',\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $page->clickLink('Manage layout');\n $page->clickLink('Add section');\n $page->clickLink('Layout Builder Test Plugin');\n $page->pressButton('Add section');\n $page->clickLink('Add block');\n $page->clickLink('Test Attributes');\n $page->pressButton('Add block');\n $page->pressButton('Save layout');\n\n $this->drupalGet('node/1');\n\n $assert_session->elementExists('css', '.attribute-test-class');\n $assert_session->elementExists('css', '[custom-attribute=test]');\n $assert_session->elementExists('css', 'div[data-contextual-id*=\"layout_builder_test\"]');\n }",
"public function inSection( array $params = null )\n {\n $this->searchEntities($params, 'section');\n }",
"public function verifyAc(array $args);",
"public function is_group( $args, $assoc_args = array() ) {\n\t\t$alias = $args[0];\n\n\t\t$aliases = WP_CLI::get_runner()->aliases;\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\t// how do we know the alias is a group?\n\t\t// + array keys are numeric\n\t\t// + array values begin with '@'\n\n\t\t$first_item = $aliases[ $alias ];\n\t\t$first_item_key = key( $first_item );\n\t\t$first_item_value = $first_item[ $first_item_key ];\n\n\t\tif ( is_numeric( $first_item_key ) && substr( $first_item_value, 0, 1 ) === '@' ) {\n\t\t\tWP_CLI::halt( 0 );\n\t\t}\n\t\tWP_CLI::halt( 1 );\n\n\t}",
"public function testUserControllerWithVariadicArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n \n $path = \"user/variadic\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:0\", $res);\n\n $path = \"user/variadic/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:1\", $res);\n\n $path = \"user/variadic/1/2/3/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:4\", $res);\n }",
"public function modEditsection($group, $section, $value, $store_id = 0) {\r\r\n\t\t$this->db->query(\r\r\n\t\t\t\"DELETE FROM \" . DB_PREFIX . $this->tbl_module . \" WHERE \r\r\n\t\t\t`store_id`\t= '\" . (int)$store_id . \"' AND \r\r\n\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"' AND \r\r\n\t\t\t`section`\t\t= '\" . $this->db->escape($section) . \"'\r\r\n\t\t\");\r\r\n\r\r\n\t\t//echo \"<pre>\".print_r($value,true).\"</pre>\";\r\r\n\t\tforeach ($value as $k => $v) {\r\r\n\t\t\t$this->db->query(\r\r\n\t\t\t\t\"INSERT INTO \" . DB_PREFIX . $this->tbl_module . \" SET \r\r\n\t\t\t\t`store_id`\t= '\" . (int)$store_id . \"',\r\r\n\t\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"', \r\r\n\t\t\t\t`section`\t= '\" . $this->db->escape($section) . \"', \r\r\n\t\t\t\t`key`\t\t= '\" . $this->db->escape($k) . \"', \r\r\n\t\t\t\t`value`\t\t= '\" . $this->db->escape(json_encode($v)) . \"'\r\r\n\t\t\t\");\r\r\n\t\t}\r\r\n\t}",
"public function checkUserSection($section){\n $query = \"SELECT user_id \n FROM tbl_author_sort\n WHERE user_id = '{$this->getUser()}'\n AND section_handle = '{$section}'\n LIMIT 1\n \";\n if(Symphony::Database()->fetchVar('user_id',0,$query)){\n return true;\n }\n return false;\n }",
"public function print_section_html($args)\r\n {\r\n var_dump($args);\r\n print 'Enter your settings below:';\r\n }",
"protected abstract function urlByRouteSections (\\MvcCore\\IRoute $route, array & $params = [], $urlParamRouteName = NULL);",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->id == 0) ? -1 : $row->id), $contentids))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n }",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function coverageSection(string $section);",
"function checkSectionCategory(&$row, &$obj) {\r\n\t\t$include = isset($obj->_include_sc) ? $obj->_include_sc : false;\r\n\t\t$sections = isset($obj->_exclude_sections) ? $obj->_exclude_sections : array();\r\n\t\t$catids = isset($obj->_exclude_categories) ? $obj->_exclude_categories : array();\r\n\t\t$contentids = isset($obj->_exclude_contentids) ? $obj->_exclude_contentids : array();\r\n\t\t$contentitems = isset($obj->_exclude_contentitems) ? $obj->_exclude_contentitems : array();\r\n\r\n\t\t/* content item excluded ? DO NOT USE ANYMORE */\r\n\t\tif (in_array((($row->id == 0) ? -1 : $row->id), $contentids))\r\n\t\t\treturn false;\r\n\r\n\t\t/*\r\n\t\t * Include = include only : selected Ids OR selected Sections OR Selected Categories)\r\n\t\t * Exclude = exclude selected Ids OR selected Sections OR Selected Categories\r\n\t\t */\r\n\r\n\t\t/* content ids */\r\n\t\tif (count($contentitems) > 0) {\r\n\t\t\t$result = in_array((($row->id == 0) ? -1 : $row->id), $contentitems);\r\n\t\t\tif ($include && $result)\r\n\t\t\t\treturn true; /* include and selected */\r\n\t\t\tif (!$include && $result)\r\n\t\t\t\treturn false; /* exclude and selected */\r\n\t\t}\r\n\r\n\t\t/* sections (docman categories) */\r\n\t\t$result = in_array((($row->catsid == 0) ? -1 : $row->catsid), $sections);\r\n\t\tif ($include && $result)\r\n\t\t\treturn true; /* include and selected */\r\n\t\tif (!$include && $result)\r\n\t\t\treturn false; /* exclude and selected */\r\n\r\n\t\tif ($include)\r\n\t\t\treturn false; /* was not included */\r\n\t\tif (!$include)\r\n\t\t\treturn true; /* was not excluded */\r\n\t}",
"public function testDispatchWithArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/with-args/foo/bar'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }",
"public function set(string $section, string $key, $value) : bool;",
"public function testGetStepsWithOuterScopePersistence()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);\n }",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function show(User $user, Section $section)\n {\n return $user->hasPermission('show-reference-section');\n }",
"function region_has_content($region='default' /*...*/) {\n return CAsdf::Instance()->views->RegionHasView(func_get_args());\n}",
"protected function check_in_section_variable( $field, $expected ) {\n\t\t$message = 'The in_section variable is not set correctly when a ' . $field->type . ' field is duplicated.';\n\t\t$this->assertTrue( isset( $field->field_options['in_section'] ), $message );\n\n\t\t$message = 'The in_section variable is not set to the correct value when a ' . $field->type . ' field is duplicated.';\n\t\t$this->assertEquals( $expected, $field->field_options['in_section'], $message );\n\t}",
"public function testCustomSectionAttributes() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $page->clickLink('Manage layout');\n $page->clickLink('Add section');\n $page->clickLink('Layout Builder Test Plugin');\n $page->pressButton('Add section');\n // See \\Drupal\\layout_builder_test\\Plugin\\Layout\\LayoutBuilderTestPlugin::build().\n $assert_session->elementExists('css', '.go-birds');\n }",
"public function update(User $user, Section $section)\n {\n return $user->hasPermission('update-reference-section');\n }",
"public function testParseArgumentsCanParseRuleArguments()\n {\n $this->assertEquals(['min' => 10, 'max' => 100], $this->ruleParse->parseArguments('min=10,max=100'));\n $this->assertEquals([0 => 10, 1 => 100], $this->ruleParse->parseArguments('10,100'));\n }",
"public function testFilters_byUserNameOrGroupId()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 2); \n }",
"public function settings( $section, $args = false ) {\n\t\t\t// Section.\n\t\t\tif ( ! isset( $this->settings[ $section ] ) ):\n\t\t\t\t$this->settings[ $section ] = get_post_meta( $this->id, \"settings_$section\", true );\n\t\t\tendif;\n\n\t\t\t// Deep selection.\n\t\t\tif ( $this->settings[ $section ] !== false && $args !== false ):\n\t\t\t\t$paths = func_get_args();\n\t\t\t\tunset( $paths[0] );\n\n\t\t\t\treturn TotalPoll::instance( 'helpers' )->pathfinder( $this->settings[ $section ], $paths );\n\t\t\tendif;\n\n\t\t\treturn $this->settings[ $section ];\n\t\t}",
"public function set_default_field_args( $field_args, $tab_key, $section_key ) {\n\n $type = isset($field_args['type']) ? $field_args['type'] : 'text';\n $conditions = isset($field_args['conditions']) ? $field_args['conditions'] : false;\n\n $disable = isset($field_args['disable']) ? boolval($field_args['disable']) : false;\n\n if ( isset($field_args['global']) && $field_args['global'] === true) {\n $disable = $this->is_disabled( $field_args['name'] ) ? true : $disable;\n $name_id = $this->get_option_prefix( $field_args['name'] );\n }\n else if ( isset($field_args['parent']) ) {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $field_args['parent']['name_id'] . '[' . $field_args['name'] . ']';\n }\n else {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $this->get_option_prefix($section_key . '[' . $field_args['name'] . ']');\n }\n\n $args = array(\n 'id' => $field_args['name'],\n 'name_id' => $name_id,\n 'label_for' => $args['label_for'] = \"{$section_key}[{$field_args['name']}]\",\n 'desc' => isset($field_args['desc']) ? $field_args['desc'] : '',\n 'placeholder' => isset($field_args['placeholder']) ? $field_args['placeholder'] : '',\n 'global' => isset($field_args['global']) ? boolval($field_args['global']) : false,\n 'label' => isset($field_args['label']) ? $field_args['label'] : '',\n 'title' => isset($field_args['title']) ? $field_args['title'] : '',\n 'tab' => $tab_key,\n 'section' => $section_key,\n 'parent' => isset($field_args['parent']) ? $field_args['parent'] : false,\n 'size' => isset($field_args['size']) ? $field_args['size'] : null,\n 'options' => isset($field_args['options']) ? $field_args['options'] : '',\n 'std' => isset($field_args['default']) ? $field_args['default'] : '',\n 'disable' => $disable,\n 'sanitize_callback' => isset($field_args['sanitize_callback']) ? $field_args['sanitize_callback'] : '',\n 'type' => $type,\n 'sub_fields' => ( $type === 'sub_fields' && isset($field_args['sub_fields']) ) ? $field_args['sub_fields'] : false,\n 'display' => (isset($field_args['display'])) ? $field_args['display'] : '',\n 'conditions' => $conditions\n );\n\n return $args;\n }",
"public function testBuildUrlWithArgs()\n {\n $path = $this->uut->buildPath('with-args', ['foo' => 'foo', 'bar' => 'bar']);\n $this->assertEquals('/with-args/foo/bar', $path);\n }",
"public static function modify(&$object, $action, $section, $str) {\n\t\t\tsettype($section, 'string');\n\t\t\tsettype($str, 'string');\n\t\t\t$section = strtolower($section);\n\t\t\t\n\t\t\tif (is_callable(array('\\\\uri\\\\modify', $section))) {\n\t\t\t\treturn call_user_func_array(array('\\\\uri\\\\modify', $section), array(&$object, $action, $str));\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"public function testAccess() {\n $assert_session = $this->assertSession();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field';\n // Allow overrides for the layout.\n $this->drupalGet(\"{$field_ui_prefix}/display/default\");\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $this->drupalGet(\"{$field_ui_prefix}/display/default\");\n $this->submitForm(['layout[allow_custom]' => TRUE], 'Save');\n\n $this->drupalLogin($this->drupalCreateUser(['configure any layout']));\n $this->drupalGet('node/1');\n $assert_session->pageTextContains('The first node body');\n $assert_session->pageTextNotContains('Powered by Drupal');\n $node = Node::load(1);\n $node->setUnpublished();\n $node->save();\n $this->drupalGet('node/1');\n $assert_session->pageTextNotContains('The first node body');\n $assert_session->pageTextContains('Access denied');\n\n $this->drupalGet('node/1/layout');\n $assert_session->pageTextNotContains('The first node body');\n $assert_session->pageTextContains('Access denied');\n }",
"public function has(string $section, string $key) : bool;",
"public function testSectionLabels() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $page->checkField('layout[enabled]');\n $page->pressButton('Save');\n $page->checkField('layout[allow_custom]');\n $page->pressButton('Save');\n\n $this->drupalGet('node/1/layout');\n $page->clickLink('Add section');\n $page->clickLink('One column');\n $page->fillField('layout_settings[label]', 'My Cool Section');\n $page->pressButton('Add section');\n $assert_session->pageTextContains('My Cool Section');\n $page->pressButton('Save layout');\n $assert_session->pageTextNotContains('My Cool Section');\n }",
"public function delete(User $user, Section $section)\n {\n return $user->hasPermission('delete-reference-section');\n }",
"public function testArgumentValidateUserUid() {\n $view = Views::getView('test_view_argument_validate_user');\n $this->executeView($view);\n\n $this->assertTrue($view->argument['null']->validateArgument($this->account->id()));\n // Reset argument validation.\n $view->argument['null']->argument_validated = NULL;\n // Fail for a valid numeric, but for a user that doesn't exist\n $this->assertFalse($view->argument['null']->validateArgument(32));\n\n $form = [];\n $form_state = new FormState();\n $view->argument['null']->buildOptionsForm($form, $form_state);\n $sanitized_id = ArgumentPluginBase::encodeValidatorId('entity:user');\n $this->assertTrue($form['validate']['options'][$sanitized_id]['roles']['#states']['visible'][':input[name=\"options[validate][options][' . $sanitized_id . '][restrict_roles]\"]']['checked']);\n }",
"#[@test]\n public function argument_count_should_be_considered_when_matching_args() {\n $this->sut->setArguments(array(1, 2));\n $this->assertTrue($this->sut->doesMatchArgs(array(1, 2)));\n $this->assertFalse($this->sut->doesMatchArgs(array()));\n $this->assertFalse($this->sut->doesMatchArgs(array(1)));\n $this->assertFalse($this->sut->doesMatchArgs(array(1, 2, 3)));\n }",
"function accessMenu( $uid, $access, $section ) {\r\n\tglobal $database;\r\n\r\n\t$row = new mosCategory( $database );\r\n\t$row->load( $uid );\r\n\t$row->access = $access;\r\n\r\n\tif ( !$row->check() ) {\r\n\t\treturn $row->getError();\r\n\t}\r\n\tif ( !$row->store() ) {\r\n\t\treturn $row->getError();\r\n\t}\r\n}",
"public function testCheckArray() {\n\t\t$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';\n\n\t\t$Ini = new IniAcl();\n\t\t$Ini->config = $Ini->readConfigFile($iniFile);\n\t\t$Ini->userPath = 'User.username';\n\n\t\t$user = array(\n\t\t\t'User' => array('username' => 'admin')\n\t\t);\n\t\t$this->assertTrue($Ini->check($user, 'posts'));\n\t}",
"public function exec($accessControlProfileId, $jobType, $section, $value)\n\t{\n\t\t$accessControlProfile = $this->client->accessControlProfile->get($accessControlProfileId);\n\t\tswitch ($jobType)\n\t\t{\n\t\tcase '+':\n\t\t\tif (!$value) die (\"\\r\\nERROR: value to add must be supplied\\r\\n\");\n\t\t\t$this->addToSection($accessControlProfile, $section, $value);\n\t\tbreak;\n\t\tcase '-':\n\t\t\tif (!$value) die (\"\\r\\nERROR: value to remove must be supplied\\r\\n\");\n\t\t\t$this->removeFromSection($accessControlProfile, $section, $value);\n\t\tbreak;\n\t\tcase '?':\n\t\t\t$this->dumpSection($accessControlProfile, $section, $value);\n\t\tbreak;\n\n\t\tdefault:\n\t\t\t//print_r($accessControlProfile);\n\t\t\tdie(\"\\r\\nNOTICE: Action type can be the value '-' or '+' \\r\\n\");\n\t\tbreak;\n\t\t}\n\n\n\t\t//print_r($accessControlProfile);\n\n\t\treturn $this->sendToBackToServer($accessControlProfile);\n\t}",
"protected function prepareSectionIndexTest() {}",
"public function test_that_authorized_user_can_view_courses_within_other_periods()\n {\n \n }",
"function course_completion_check_custom_rule($element,$value,$extra) {\n $key = $extra[0];\n $values = $extra[1];\n $set_ok = false;\n\n foreach ($values->_options['choices'] as $name=>$choice) {\n $item = $key.'_'.$name;\n if (optional_param($item,0,PARAM_INT) == 1) {\n $set_ok = true;\n }\n }\n\n return $set_ok ? true : false;\n}",
"public function test(&$element, $value, $group = null, &$input = null, &$form = null)\n {\n // Get the possible field actions and the ones posted to validate them.\n $fieldActions = self::getFieldActions($element);\n $valueActions = self::getValueActions($value);\n\n // Make sure that all posted actions are in the list of possible actions for the field.\n foreach ($valueActions as $action)\n {\n if (!in_array($action, $fieldActions))\n {\n return false;\n }\n }\n\n return true;\n }",
"public function test_match_withMoreThanOneVar()\n {\n $route = new Route('GET', '/{id}/{slug}', 'test');\n $this->assertTrue(\n $route->match('GET', '/50/my-post-title'),\n 'match() must return true if URI pattern with var match pattern provided in constructor.'\n );\n $this->assertSame(\n ['id' => '50', 'slug' => 'my-post-title'],\n $route->getParams(),\n 'getParams() must return params from URI provided to match() method when more than one var is specified.'\n );\n }",
"#[@test]\n public function doesMatch_should_return_true_if_args_are_equal() {\n $this->sut->setArguments(array('1', 2, 3.0, '4'));\n\n $this->assertTrue($this->sut->doesMatchArgs(array('1', 2, 3.0, '4')));\n }",
"abstract public function checkAccess($userId, $itemName, $params = array());",
"function cv_content_section( $atts, $content = null ) {\n global $canvys;\n return $canvys['shortcodes']['cv_section']->callback( $atts, $content );\n}",
"abstract public function check($userId, $permission, array $data = []);",
"public function testFilters_byUserNameAndGroupId()\n {\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 0);\n\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=m&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=2\");\n $this->assertEqual(count($this->vars['users']), 1);\n }",
"public function testCheckIfOverviewContainsCase()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestCase1')\n ->assertViewHas('testCases');\n\n }",
"function paramsValidateTwo($instruction, $first_arg, $sec_arg)\n{\n if ((strcmp(\"MOVE\", $instruction[0]) == 0) || (strcmp(\"NOT\", $instruction[0]) == 0) || (strcmp(\"INT2CHAR\", $instruction[0]) == 0) || (strcmp(\"STRLEN\", $instruction[0]) == 0) || (strcmp(\"TYPE\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") )\n {\n Err();\n }\n }\n else if ((strcmp(\"READ\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg != \"type\"))\n {\n Err();\n }\n }\n}",
"private function verify_action_params( $subscription ){\n if( empty( $subscription->id ) )\n return false;\n\n $plan = pms_get_subscription_plan( $subscription->subscription_plan_id );\n\n if( $plan->type != 'group' )\n return false;\n\n return true;\n }",
"public function themeEditsection($group, $section, $value, $store_id = 0) {\r\r\n\t\t$this->db->query(\r\r\n\t\t\t\"DELETE FROM \" . DB_PREFIX . $this->tbl_theme . \" WHERE \r\r\n\t\t\t`store_id`\t= '\" . (int)$store_id . \"' AND \r\r\n\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"' AND \r\r\n\t\t\t`section`\t\t= '\" . $this->db->escape($section) . \"'\r\r\n\t\t\");\r\r\n\r\r\n\t\t//echo \"<pre>\".print_r($value,true).\"</pre>\";\r\r\n\t\tforeach ($value as $k => $v) {\r\r\n\t\t\t$this->db->query(\r\r\n\t\t\t\t\"INSERT INTO \" . DB_PREFIX . $this->tbl_theme . \" SET \r\r\n\t\t\t\t`store_id`\t= '\" . (int)$store_id . \"',\r\r\n\t\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"', \r\r\n\t\t\t\t`section`\t= '\" . $this->db->escape($section) . \"', \r\r\n\t\t\t\t`key`\t\t= '\" . $this->db->escape($k) . \"', \r\r\n\t\t\t\t`value`\t\t= '\" . $this->db->escape(json_encode($v)) . \"'\r\r\n\t\t\t\");\r\r\n\t\t}\r\r\n\t}",
"function _section_match($section_limitations,$results_type)\n\t{\n\t\tif ($section_limitations==array()) return true;\n\n\t\tforeach ($section_limitations as $l)\n\t\t{\n\t\t\tif (@strpos(strtolower($results_type),strtolower($l))!==false) return true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function settings_table($args) \n {\n if ($args['section'] == 'addressbook') {\n $use_auto_abook = rcmail::get_instance()->config->get('use_auto_abook', true);\n $field_id = 'rcmfd_use_auto_abook';\n\n $checkbox = new html_checkbox(array(\n 'name' => '_use_auto_abook', \n 'id' => $field_id, 'value' => 1\n ));\n $args['blocks']['automaticallycollected']['name'] = $this->gettext('automaticallycollected');\n $args['blocks']['automaticallycollected']['options']['use_subscriptions'] = array(\n 'title' => html::label($field_id, rcube_utils::rep_specialchars_output($this->gettext('useautoabook'))),\n 'content' => $checkbox->show($use_auto_abook ? 1 : 0),\n );\n\n $use_auto_abook_for_completion = rcmail::get_instance()->config->get('use_auto_abook_for_completion', true);\n $field_id2 = 'rcmfd_use_auto_abook_for_completion';\n $checkbox2 = new html_checkbox(array(\n 'name' => '_use_auto_abook_for_completion',\n 'id' => $field_id2, 'value' => 1\n ));\n $args['blocks']['automaticallycollected']['name'] = $this->gettext('automaticallycollected');\n $args['blocks']['automaticallycollected']['options']['use_autocompletion'] = array(\n 'title' => html::label($field_id2, rcube_utils::rep_specialchars_output($this->gettext('useforcompletion'))),\n 'content' => $checkbox2->show($use_auto_abook_for_completion ? 1 : 0),\n );\n }\n return $args;\n }",
"public function duplicate( &$section, $args = array() ) {\n\t}",
"public function edit(section $section)\n {\n //\n }",
"public function test($arg);",
"function keys_exist_in($array,$params,$section,$tbl = true){\r\n\r\n\tforeach($params as $item){\r\n\t\tif (!array_key_exists(trim($item),$array)){\r\n\t\t\tif ($tbl)\r\n\t\t\t\techo \"<tr><td colspan=\\\"5\\\"><strong>Error</strong>: key '$item' not found in $section!</td></tr>\";\r\n\t\t\telse\r\n\t\t\t\techo \"<strong>Error</strong>: key '$item' not found in $section!</form>\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}",
"public static function validateSection($section)\n\t{\n\t\tif (JFactory::getApplication()->isClient('site'))\n\t\t{\n\t\t\t// On the front end we need to map some sections\n\t\t\tswitch ($section)\n\t\t\t{\n\t\t\t\t// Editing an download\n\t\t\t\tcase 'form':\n\n\t\t\t\t\t// Category list view\n\t\t\t\tcase 'featured':\n\t\t\t\tcase 'category':\n\t\t\t\t\t$section = 'download';\n\t\t\t}\n\t\t}\n\n\t\tif ($section != 'download')\n\t\t{\n\t\t\t// We don't know other sections\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $section;\n\t}",
"public static function checkManageAccess(GroupInterface $group, AccountInterface $user = NULL) {\n /** @var \\Drupal\\living_spaces_sections\\LivingSpacesSectionsManagerInterface $service */\n $service = \\Drupal::service('living_spaces_sections.manager');\n\n if (!$user) {\n $user = \\Drupal::currentUser();\n }\n\n // Check if sections enabled for the group type.\n if (!$service->isSectionsEnabled($group->bundle())) {\n return AccessResult::forbidden();\n }\n\n // Check if user has global access or certain group access.\n if ($user->hasPermission('administer living spaces sections settings') ||\n $user->hasPermission('manage living spaces sections settings') ||\n $group->hasPermission('administer living spaces sections settings', $user) ||\n $group->hasPermission('manage living spaces sections settings', $user)\n ) {\n return AccessResult::allowed();\n }\n\n return AccessResult::neutral();\n }",
"public function testParseParams(){\n $this->assertEquals($this->object->parseParams(array(\n 'type'=>'categorie-name',\n 'search'=>'android'\n )),'/type/categorie-name/search/android');\n \n $this->assertEquals($this->object->parseParams(array(\n 'type'=>'categorie-id',\n 'search'=>76\n )),'/type/categorie-id/search/76');\n }",
"public function read($section);",
"public function testUserControllerWithArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n\n $path = \"user/view/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"viewAction id:1\", $res);\n\n $path = \"user/search/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"searchAction str:moped\", $res);\n\n $path = \"user/test/42/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"testAction id:42 str:moped\", $res);\n }",
"public function __checkAuthentication($user, $action) {\n $action = $this->action;\n $authFlag = false;\n $role = $this->UserAuth->user(\"user_role\");\n switch ($role) {\n case 1001:\n if (in_array($action, $this->superadminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1002:\n if (in_array($action, $this->adminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1003:\n if (in_array($action, $this->instituteAdminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1004:\n if (in_array($action, $this->branchActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1005:\n if (in_array($action, $this->teacherActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1006:\n if (in_array($action, $this->accountantActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1007:\n if (in_array($action, $this->parentActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break; \n default:\n if (in_array($action, $this->guestActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n }\n\n if (!$authFlag) {\n $this->_setFlashMsgs(__('You are not authorized for this action'), 'danger');\n $this->redirect($this->UserAuth->redirect());\n return false;\n } else {\n return true;\n }\n return self::isAuthorized($user);\n }",
"public function testGetAuthorizationDivisionspermittedMe()\n {\n }",
"function fopr_template_section( $name ) {\n\t$id = get_the_ID();\n\tswitch ( $name ) {\n\t\tcase 'example-template-section':\n\t\t\t?>\n\t\t\t<section class=\"[ section section--full ] example\">\n\t\t\t\tHi, I'm an example section to show how to use templates mixed with Gutenberg blocks.\n\t\t\t\tJust use the Template Section block and enter the name of this case.\n\t\t\t\tThis way you can use gutenberg blocks in one section and a section from the template in another.\n\t\t\t</section>\n\t\t\t<?php\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\techo 'Template section \"' . esc_html( $name ) . '\" not found.';\n\t}\n}",
"public function delete(string $section, string $key) : bool;",
"function _campaign_resource_access($op = 'view', $args = array()) {\n if (DOSOMETHING_REPORTBACK_LOG) {\n watchdog('dosomething_api', '_campaign_resource_access args:' . json_encode($args));\n }\n\n if ($op == 'index') {\n return TRUE;\n }\n\n $node = node_load($args[0]);\n if (!$node) {\n return services_error(t('No node found for @nid', array('@nid' => $args[0])), 403);\n }\n\n if ($op == 'view') {\n return node_access($op, $node);\n }\n\n if (!user_is_logged_in()) {\n return services_error(t('Must be logged in!'), 403);\n }\n\n if (dosomething_campaign_is_active($node)) {\n return TRUE;\n //@todo: If op==reportback and SMS Game, return 403 error.\n }\n\n return services_error(t('Campaign node @nid is not active.', array('@nid' => $node->nid)), 403);\n}",
"function testOptionsTuples(){\n\t\t#mdx:OptionsTuples\n\t\t$choice = new SimpleChoice(\"category\");\n\t\t$choice->options([[1,'Action'],[2,'Drama'],[3,'Sci-fi']]);\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"1 - Action\",\"$choice\");\n\n\t}",
"public function testArgumentTitle() {\n $this->installSchema('system', ['sequences']);\n $this->installEntitySchema('user');\n $this->installConfig(['user']);\n User::create(['uid' => 0, 'name' => ''])->save();\n ViewTestData::createTestViews(static::class, ['user_test_views']);\n\n $view = Views::getView('test_user_uid_argument');\n\n // Tests an invalid user uid.\n $view->preview(NULL, [rand(1000, 10000)]);\n $this->assertEmpty($view->getTitle());\n $view->destroy();\n\n // Tests a valid user.\n $account = $this->createUser();\n $view->preview(NULL, [$account->id()]);\n $this->assertEquals($account->label(), $view->getTitle());\n $view->destroy();\n\n // Tests the anonymous user.\n $anonymous = $this->config('user.settings')->get('anonymous');\n $view->preview(NULL, [0]);\n $this->assertEquals($anonymous, $view->getTitle());\n $view->destroy();\n\n $view->getDisplay()->getHandler('argument', 'uid')->options['break_phrase'] = TRUE;\n $view->preview(NULL, [$account->id() . ',0']);\n $this->assertEquals($account->label() . ', ' . $anonymous, $view->getTitle());\n $view->destroy();\n\n $view->getDisplay()->getHandler('argument', 'uid')->options['break_phrase'] = TRUE;\n $view->preview(NULL, ['0,' . $account->id()]);\n $this->assertEquals($anonymous . ', ' . $account->label(), $view->getTitle());\n $view->destroy();\n }"
] | [
"0.58181256",
"0.55953324",
"0.53428715",
"0.5264419",
"0.52022636",
"0.51012194",
"0.4941738",
"0.48870313",
"0.4838513",
"0.47824267",
"0.47665146",
"0.4740185",
"0.47240394",
"0.47177273",
"0.47083986",
"0.46732798",
"0.46647125",
"0.46636122",
"0.46594095",
"0.46525747",
"0.46505758",
"0.46334395",
"0.46218288",
"0.46145546",
"0.4604032",
"0.4601728",
"0.45947313",
"0.45851555",
"0.4583363",
"0.45789996",
"0.45774558",
"0.45722806",
"0.4562138",
"0.45616034",
"0.4560894",
"0.4560894",
"0.4560673",
"0.4560673",
"0.45512363",
"0.45372233",
"0.45332775",
"0.4532193",
"0.4500986",
"0.44991246",
"0.44912362",
"0.44894862",
"0.44880188",
"0.4479067",
"0.4456458",
"0.44504952",
"0.44484997",
"0.4431987",
"0.44276717",
"0.44161057",
"0.44147968",
"0.44087046",
"0.44058225",
"0.43876615",
"0.43833783",
"0.4382935",
"0.43733174",
"0.43711364",
"0.43599126",
"0.43424934",
"0.43371797",
"0.43359083",
"0.43345076",
"0.43296823",
"0.4308884",
"0.4308261",
"0.42995298",
"0.42971182",
"0.42893657",
"0.42863533",
"0.42748404",
"0.4274004",
"0.42658097",
"0.42350522",
"0.42264485",
"0.42222226",
"0.42158735",
"0.4212317",
"0.4211824",
"0.42030546",
"0.41918045",
"0.4189616",
"0.41863295",
"0.4179523",
"0.41697344",
"0.41604644",
"0.4156221",
"0.4151188",
"0.41492057",
"0.41378596",
"0.41366792",
"0.41279548",
"0.41275525",
"0.41253474",
"0.4124019",
"0.41233182"
] | 0.5897048 | 0 |
Tests a parameterized section reference in an action group resolved with user simpleArgs. | public function testGetStepsWithParameterizedSimpleArg()
{
// Mock Entity Object Handler
$this->setEntityObjectHandlerReturn(function ($entityName) {
if ($entityName == "data2") {
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
}
});
// mock the section object handler response
$element = new ElementObject("element1", "textArea", ".selector {{var1}}", null, null, true);
$section = new SectionObject("testSection", ["element1" => $element]);
// bypass the private constructor
$sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();
AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects(
[new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])]
)
->withArguments([new ArgumentObject('simple', null, 'string')])
->build();
// String Literal
$steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']);
// String Literal w/ data-like structure
$steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']);
// Persisted Data
$steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }",
"public function isActionAllowed($section, $reference, $action = NULL) ;",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"function section ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tsection');\n return $rc->newInstanceArgs( $arguments ); \n}",
"private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"public static function sectionURI($mnt,$section)\n{\nreturn self::commandURI($mnt,'section&name='.$section);\n}",
"function cleanyeti_sections_callback( $section_passed ) {\n\tglobal $cleanyeti_tabs;\n\t$cleanyeti_tabs = cleanyeti_get_settings_page_tabs();\n\tforeach ( $cleanyeti_tabs as $tabname => $tab ) {\n\t\t$tabsections = $tab['sections'];\n\t\tforeach ( $tabsections as $sectionname => $section ) {\n\t\t\tif ( 'cleanyeti_' . $sectionname . '_section' == $section_passed['id'] ) {\n\t\t\t\t?>\n\t\t\t\t<p><?php echo $section['description']; ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}\n}",
"public function testHandleArgs()\n {\n $input = array('foo' => 'bar', 'bar' => 'baz');\n $lookup = new Lookup($input);\n\n $this->assertSame('bar', $lookup->getArg('foo'));\n $this->assertNull($lookup->getArg('animal'));\n $this->assertSame($input, $lookup->getArgs());\n }",
"abstract function perform($userinfo, $groupinfo, $args);",
"public function testEditSection() {\n\t\t$name = 'Help:ApiEditPageTest_testEditSection';\n\t\t$page = WikiPage::factory( Title::newFromText( $name ) );\n\t\t$text = \"==section 1==\\ncontent 1\\n==section 2==\\ncontent2\";\n\t\t// Preload the page with some text\n\t\t$page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), 'summary' );\n\n\t\tlist( $re ) = $this->doApiRequestWithToken( array(\n\t\t\t'action' => 'edit',\n\t\t\t'title' => $name,\n\t\t\t'section' => '1',\n\t\t\t'text' => \"==section 1==\\nnew content 1\",\n\t\t) );\n\t\t$this->assertEquals( 'Success', $re['edit']['result'] );\n\t\t$newtext = WikiPage::factory( Title::newFromText( $name ) )\n\t\t\t->getContent( Revision::RAW )\n\t\t\t->getNativeData();\n\t\t$this->assertEquals( \"==section 1==\\nnew content 1\\n\\n==section 2==\\ncontent2\", $newtext );\n\n\t\t// Test that we raise a 'nosuchsection' error\n\t\ttry {\n\t\t\t$this->doApiRequestWithToken( array(\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'title' => $name,\n\t\t\t\t'section' => '9999',\n\t\t\t\t'text' => 'text',\n\t\t\t) );\n\t\t\t$this->fail( \"Should have raised a UsageException\" );\n\t\t} catch ( UsageException $e ) {\n\t\t\t$this->assertEquals( 'nosuchsection', $e->getCodeString() );\n\t\t}\n\t}",
"private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }",
"public function testCustomSectionAttributes() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $page->clickLink('Manage layout');\n $page->clickLink('Add section');\n $page->clickLink('Layout Builder Test Plugin');\n $page->pressButton('Add section');\n // See \\Drupal\\layout_builder_test\\Plugin\\Layout\\LayoutBuilderTestPlugin::build().\n $assert_session->elementExists('css', '.go-birds');\n }",
"public function testUserControllerWithVariadicArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n \n $path = \"user/variadic\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:0\", $res);\n\n $path = \"user/variadic/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:1\", $res);\n\n $path = \"user/variadic/1/2/3/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:4\", $res);\n }",
"public function testSectionLabels() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $page->checkField('layout[enabled]');\n $page->pressButton('Save');\n $page->checkField('layout[allow_custom]');\n $page->pressButton('Save');\n\n $this->drupalGet('node/1/layout');\n $page->clickLink('Add section');\n $page->clickLink('One column');\n $page->fillField('layout_settings[label]', 'My Cool Section');\n $page->pressButton('Add section');\n $assert_session->pageTextContains('My Cool Section');\n $page->pressButton('Save layout');\n $assert_session->pageTextNotContains('My Cool Section');\n }",
"public function is_group( $args, $assoc_args = array() ) {\n\t\t$alias = $args[0];\n\n\t\t$aliases = WP_CLI::get_runner()->aliases;\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\t// how do we know the alias is a group?\n\t\t// + array keys are numeric\n\t\t// + array values begin with '@'\n\n\t\t$first_item = $aliases[ $alias ];\n\t\t$first_item_key = key( $first_item );\n\t\t$first_item_value = $first_item[ $first_item_key ];\n\n\t\tif ( is_numeric( $first_item_key ) && substr( $first_item_value, 0, 1 ) === '@' ) {\n\t\t\tWP_CLI::halt( 0 );\n\t\t}\n\t\tWP_CLI::halt( 1 );\n\n\t}",
"public function testArgument() {\n $view = Views::getView('test_view');\n foreach (['en' => 'John', 'xx-lolspeak' => 'George'] as $langcode => $name) {\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('arguments', [\n 'langcode' => [\n 'id' => 'langcode',\n 'table' => 'views_test_data',\n 'field' => 'langcode',\n ],\n ]);\n $this->executeView($view, [$langcode]);\n\n $expected = [\n ['name' => $name],\n ];\n $this->assertIdenticalResultset($view, $expected, ['views_test_data_name' => 'name']);\n $view->destroy();\n }\n }",
"public function testFilters_byUserNameOrGroupId()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 2); \n }",
"public function isAuthorized($action = '', $params = array(), &$user = array()) {\n\t\tif (!$this->activeUser && empty($user)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($action)) {\n\t\t\t$action = $this->Auth->action();\n\t\t} else {\n\t\t\t$parsed = Router::parse($action);\n\t\t\t$action = Set::filter(array(Inflector::camelize($parsed['plugin']), Inflector::camelize($parsed['controller']), $parsed['action']));\n\t\t\t$action = implode('/', $action);\n\t\t}\n\n\t\tif (empty($user)) {\n\t\t\t$user =& $this->activeUser;\n\t\t}\n\t\tif (empty($params)) {\n\t\t\t$params = $this->passedArgs;\n\t\t}\n\t\tunset($user['ConditionalGroup']);\n\t\t$user['ConditionalGroup'] = $this->_setConditionalGroups($params, $user);\n\n\t\t// main group\n\t\t$mainAccess = Core::acl($user['Group']['id'], $action);\n\n\t\t$condAccess = false;\n\t\t// check for conditional group\n\t\tif (!empty($user['ConditionalGroup'])) {\n\t\t\tforeach ($user['ConditionalGroup'] as $group) {\n\t\t\t\t$condAccess = Core::acl($group['Group']['id'], $action, 'conditional');\n\t\t\t\tif ($condAccess) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $mainAccess || $condAccess;\n\t}",
"public function show(User $user, Section $section)\n {\n return $user->hasPermission('show-reference-section');\n }",
"public function isUserInSection($user){\n\t\t$sql = \"SELECT id_user FROM tbl_user_section_assignment WHERE id_section=:id_section AND id_user=:id_user\";\n\t\t$command = Yii::app()->db->createCommand($sql);\n\t\t$command->bindValue(\":id_section\", $this->id_section, PDO::PARAM_INT);\n\t\t$command->bindValue(\":id_user\", $user->id, PDO::PARAM_INT);\n\t\treturn $command->execute()==1;\n\t}",
"public function print_section_html($args)\r\n {\r\n var_dump($args);\r\n print 'Enter your settings below:';\r\n }",
"public function coverageSection(string $section);",
"public function testCheckArray() {\n\t\t$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';\n\n\t\t$Ini = new IniAcl();\n\t\t$Ini->config = $Ini->readConfigFile($iniFile);\n\t\t$Ini->userPath = 'User.username';\n\n\t\t$user = array(\n\t\t\t'User' => array('username' => 'admin')\n\t\t);\n\t\t$this->assertTrue($Ini->check($user, 'posts'));\n\t}",
"public function inSection( array $params = null )\n {\n $this->searchEntities($params, 'section');\n }",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function set_default_field_args( $field_args, $tab_key, $section_key ) {\n\n $type = isset($field_args['type']) ? $field_args['type'] : 'text';\n $conditions = isset($field_args['conditions']) ? $field_args['conditions'] : false;\n\n $disable = isset($field_args['disable']) ? boolval($field_args['disable']) : false;\n\n if ( isset($field_args['global']) && $field_args['global'] === true) {\n $disable = $this->is_disabled( $field_args['name'] ) ? true : $disable;\n $name_id = $this->get_option_prefix( $field_args['name'] );\n }\n else if ( isset($field_args['parent']) ) {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $field_args['parent']['name_id'] . '[' . $field_args['name'] . ']';\n }\n else {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $this->get_option_prefix($section_key . '[' . $field_args['name'] . ']');\n }\n\n $args = array(\n 'id' => $field_args['name'],\n 'name_id' => $name_id,\n 'label_for' => $args['label_for'] = \"{$section_key}[{$field_args['name']}]\",\n 'desc' => isset($field_args['desc']) ? $field_args['desc'] : '',\n 'placeholder' => isset($field_args['placeholder']) ? $field_args['placeholder'] : '',\n 'global' => isset($field_args['global']) ? boolval($field_args['global']) : false,\n 'label' => isset($field_args['label']) ? $field_args['label'] : '',\n 'title' => isset($field_args['title']) ? $field_args['title'] : '',\n 'tab' => $tab_key,\n 'section' => $section_key,\n 'parent' => isset($field_args['parent']) ? $field_args['parent'] : false,\n 'size' => isset($field_args['size']) ? $field_args['size'] : null,\n 'options' => isset($field_args['options']) ? $field_args['options'] : '',\n 'std' => isset($field_args['default']) ? $field_args['default'] : '',\n 'disable' => $disable,\n 'sanitize_callback' => isset($field_args['sanitize_callback']) ? $field_args['sanitize_callback'] : '',\n 'type' => $type,\n 'sub_fields' => ( $type === 'sub_fields' && isset($field_args['sub_fields']) ) ? $field_args['sub_fields'] : false,\n 'display' => (isset($field_args['display'])) ? $field_args['display'] : '',\n 'conditions' => $conditions\n );\n\n return $args;\n }",
"public function set(string $section, string $key, $value) : bool;",
"function checkSection($section) {\n\t\treturn in_array(\"*\", $this->_sections) || in_array($section, $this->_sections);\n\t}",
"public function testParsingSingleArgument()\n {\n $request = $this->parser->parse('foo bar');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals(['bar'], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public function testExceptionOnMissingArguments()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n }",
"public function verifyAc(array $args);",
"public function testPluginsProvidingCustomAttributesAndContextualLinks() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'access contextual links',\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $page->clickLink('Manage layout');\n $page->clickLink('Add section');\n $page->clickLink('Layout Builder Test Plugin');\n $page->pressButton('Add section');\n $page->clickLink('Add block');\n $page->clickLink('Test Attributes');\n $page->pressButton('Add block');\n $page->pressButton('Save layout');\n\n $this->drupalGet('node/1');\n\n $assert_session->elementExists('css', '.attribute-test-class');\n $assert_session->elementExists('css', '[custom-attribute=test]');\n $assert_session->elementExists('css', 'div[data-contextual-id*=\"layout_builder_test\"]');\n }",
"function testLoadVarFromSection(){\n\t\tTestsHelper::Print(\"testing magratheaConfig loading a var from a section...\");\n\t\t$confs = array(\n\t\t\t'this_section' => array(\n\t\t\t\t'this_var' => 'ok', \n\t\t\t\t'this_other_var' => 'ok2' ), \n\t\t\t'this_other_section' => array(\n\t\t\t\t'this_var' => 'ok3', \n\t\t\t\t'this_other_var' => 'ok4' ), \n\t\t\t'this_last_section' => array() \n\t\t );\n\t\t$this->magConfig->setConfig($confs);\n\t\t$this->magConfig->Save(true);\n\n\t\t$newConf = new ConfigFile();\n\t\t$newConf->setPath($this->configPath);\n\t\t$newConf->setFile($this->fileName);\n\t\t$section = (array)$newConf->GetConfig();\n\t\t$this->assertCount(3, $section);\n\n\t\t$section = $newConf->GetConfig(\"this_section\");\n\t\t$this->assertEquals($section[\"this_var\"], \"ok\");\n\n\t\t$var = $newConf->getConfig(\"this_other_section/this_var\");\n\n\n\t\t$this->assertEquals($var, \"ok3\");\n\t}",
"function testOptionsTuples(){\n\t\t#mdx:OptionsTuples\n\t\t$choice = new SimpleChoice(\"category\");\n\t\t$choice->options([[1,'Action'],[2,'Drama'],[3,'Sci-fi']]);\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"1 - Action\",\"$choice\");\n\n\t}",
"public function testBuildUrlWithArgs()\n {\n $path = $this->uut->buildPath('with-args', ['foo' => 'foo', 'bar' => 'bar']);\n $this->assertEquals('/with-args/foo/bar', $path);\n }",
"public function testAccess() {\n $assert_session = $this->assertSession();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field';\n // Allow overrides for the layout.\n $this->drupalGet(\"{$field_ui_prefix}/display/default\");\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $this->drupalGet(\"{$field_ui_prefix}/display/default\");\n $this->submitForm(['layout[allow_custom]' => TRUE], 'Save');\n\n $this->drupalLogin($this->drupalCreateUser(['configure any layout']));\n $this->drupalGet('node/1');\n $assert_session->pageTextContains('The first node body');\n $assert_session->pageTextNotContains('Powered by Drupal');\n $node = Node::load(1);\n $node->setUnpublished();\n $node->save();\n $this->drupalGet('node/1');\n $assert_session->pageTextNotContains('The first node body');\n $assert_session->pageTextContains('Access denied');\n\n $this->drupalGet('node/1/layout');\n $assert_session->pageTextNotContains('The first node body');\n $assert_session->pageTextContains('Access denied');\n }",
"public function checkUserSection($section){\n $query = \"SELECT user_id \n FROM tbl_author_sort\n WHERE user_id = '{$this->getUser()}'\n AND section_handle = '{$section}'\n LIMIT 1\n \";\n if(Symphony::Database()->fetchVar('user_id',0,$query)){\n return true;\n }\n return false;\n }",
"public function testArgumentTitle() {\n $this->installSchema('system', ['sequences']);\n $this->installEntitySchema('user');\n $this->installConfig(['user']);\n User::create(['uid' => 0, 'name' => ''])->save();\n ViewTestData::createTestViews(static::class, ['user_test_views']);\n\n $view = Views::getView('test_user_uid_argument');\n\n // Tests an invalid user uid.\n $view->preview(NULL, [rand(1000, 10000)]);\n $this->assertEmpty($view->getTitle());\n $view->destroy();\n\n // Tests a valid user.\n $account = $this->createUser();\n $view->preview(NULL, [$account->id()]);\n $this->assertEquals($account->label(), $view->getTitle());\n $view->destroy();\n\n // Tests the anonymous user.\n $anonymous = $this->config('user.settings')->get('anonymous');\n $view->preview(NULL, [0]);\n $this->assertEquals($anonymous, $view->getTitle());\n $view->destroy();\n\n $view->getDisplay()->getHandler('argument', 'uid')->options['break_phrase'] = TRUE;\n $view->preview(NULL, [$account->id() . ',0']);\n $this->assertEquals($account->label() . ', ' . $anonymous, $view->getTitle());\n $view->destroy();\n\n $view->getDisplay()->getHandler('argument', 'uid')->options['break_phrase'] = TRUE;\n $view->preview(NULL, ['0,' . $account->id()]);\n $this->assertEquals($anonymous . ', ' . $account->label(), $view->getTitle());\n $view->destroy();\n }",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"public function testParseArgumentsCanParseRuleArguments()\n {\n $this->assertEquals(['min' => 10, 'max' => 100], $this->ruleParse->parseArguments('min=10,max=100'));\n $this->assertEquals([0 => 10, 1 => 100], $this->ruleParse->parseArguments('10,100'));\n }",
"public function modEditsection($group, $section, $value, $store_id = 0) {\r\r\n\t\t$this->db->query(\r\r\n\t\t\t\"DELETE FROM \" . DB_PREFIX . $this->tbl_module . \" WHERE \r\r\n\t\t\t`store_id`\t= '\" . (int)$store_id . \"' AND \r\r\n\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"' AND \r\r\n\t\t\t`section`\t\t= '\" . $this->db->escape($section) . \"'\r\r\n\t\t\");\r\r\n\r\r\n\t\t//echo \"<pre>\".print_r($value,true).\"</pre>\";\r\r\n\t\tforeach ($value as $k => $v) {\r\r\n\t\t\t$this->db->query(\r\r\n\t\t\t\t\"INSERT INTO \" . DB_PREFIX . $this->tbl_module . \" SET \r\r\n\t\t\t\t`store_id`\t= '\" . (int)$store_id . \"',\r\r\n\t\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"', \r\r\n\t\t\t\t`section`\t= '\" . $this->db->escape($section) . \"', \r\r\n\t\t\t\t`key`\t\t= '\" . $this->db->escape($k) . \"', \r\r\n\t\t\t\t`value`\t\t= '\" . $this->db->escape(json_encode($v)) . \"'\r\r\n\t\t\t\");\r\r\n\t\t}\r\r\n\t}",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function testFilters_byUserNameAndGroupId()\n {\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 0);\n\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=m&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=2\");\n $this->assertEqual(count($this->vars['users']), 1);\n }",
"public function testArgumentValidateUserUid() {\n $view = Views::getView('test_view_argument_validate_user');\n $this->executeView($view);\n\n $this->assertTrue($view->argument['null']->validateArgument($this->account->id()));\n // Reset argument validation.\n $view->argument['null']->argument_validated = NULL;\n // Fail for a valid numeric, but for a user that doesn't exist\n $this->assertFalse($view->argument['null']->validateArgument(32));\n\n $form = [];\n $form_state = new FormState();\n $view->argument['null']->buildOptionsForm($form, $form_state);\n $sanitized_id = ArgumentPluginBase::encodeValidatorId('entity:user');\n $this->assertTrue($form['validate']['options'][$sanitized_id]['roles']['#states']['visible'][':input[name=\"options[validate][options][' . $sanitized_id . '][restrict_roles]\"]']['checked']);\n }",
"public function exec($accessControlProfileId, $jobType, $section, $value)\n\t{\n\t\t$accessControlProfile = $this->client->accessControlProfile->get($accessControlProfileId);\n\t\tswitch ($jobType)\n\t\t{\n\t\tcase '+':\n\t\t\tif (!$value) die (\"\\r\\nERROR: value to add must be supplied\\r\\n\");\n\t\t\t$this->addToSection($accessControlProfile, $section, $value);\n\t\tbreak;\n\t\tcase '-':\n\t\t\tif (!$value) die (\"\\r\\nERROR: value to remove must be supplied\\r\\n\");\n\t\t\t$this->removeFromSection($accessControlProfile, $section, $value);\n\t\tbreak;\n\t\tcase '?':\n\t\t\t$this->dumpSection($accessControlProfile, $section, $value);\n\t\tbreak;\n\n\t\tdefault:\n\t\t\t//print_r($accessControlProfile);\n\t\t\tdie(\"\\r\\nNOTICE: Action type can be the value '-' or '+' \\r\\n\");\n\t\tbreak;\n\t\t}\n\n\n\t\t//print_r($accessControlProfile);\n\n\t\treturn $this->sendToBackToServer($accessControlProfile);\n\t}",
"public function section($name, $default = null);",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function testCheckIfOverviewContainsCase()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestCase1')\n ->assertViewHas('testCases');\n\n }",
"public function update( &$args ) {\n\n\t\t$section = $this->parse( $args );\n\n\t\tif ( empty( $section['section_id'] ) ) {\n\t\t\treturn $this->create( $args );\n\t\t}\n\n\t\t$section_id = $section['section_id'];\n\t\t$update_data = array(\n\t\t\t'section_name' => $section['section_name'],\n\t\t\t'section_course_id' => $section['section_course_id'],\n\t\t\t'section_order' => $section['section_order'],\n\t\t\t'section_description' => $section['section_description'],\n\t\t);\n\n\t\tglobal $wpdb;\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->learnpress_sections,\n\t\t\t$update_data,\n\t\t\tarray( 'section_id' => $section_id )\n\t\t);\n\t\t$section['section_id'] = $section_id;\n\n\t\treturn $section;\n\t}",
"public static function modify(&$object, $action, $section, $str) {\n\t\t\tsettype($section, 'string');\n\t\t\tsettype($str, 'string');\n\t\t\t$section = strtolower($section);\n\t\t\t\n\t\t\tif (is_callable(array('\\\\uri\\\\modify', $section))) {\n\t\t\t\treturn call_user_func_array(array('\\\\uri\\\\modify', $section), array(&$object, $action, $str));\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"public function testGetStepsWithOuterScopePersistence()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);\n }",
"protected function check_in_section_variable( $field, $expected ) {\n\t\t$message = 'The in_section variable is not set correctly when a ' . $field->type . ' field is duplicated.';\n\t\t$this->assertTrue( isset( $field->field_options['in_section'] ), $message );\n\n\t\t$message = 'The in_section variable is not set to the correct value when a ' . $field->type . ' field is duplicated.';\n\t\t$this->assertEquals( $expected, $field->field_options['in_section'], $message );\n\t}",
"protected function prepareSectionIndexTest() {}",
"function testLoadVarFromSection(){\n\t\t\techo \"testing magratheaConfig loading a var from a section... <br/>\";\n\t\t\t$confs = array(\n\t\t\t\t'this_section' => array(\n\t\t\t\t\t'this_var' => 'ok', \n\t\t\t\t\t'this_other_var' => 'ok2' ), \n\t\t\t\t'this_other_section' => array(\n\t\t\t\t\t'this_var' => 'ok3', \n\t\t\t\t\t'this_other_var' => 'ok4' ), \n\t\t\t\t'this_last_section' => array() \n\t\t\t );\n\t\t\t$this->magConfig->setConfig($confs);\n\t\t\t$this->magConfig->Save(true);\n\n\t\t\t$newConf = new MagratheaConfigFile();\n\t\t\t$newConf->setPath($this->configPath);\n\t\t\t$newConf->setFile(\"test_conf.conf\");\n\t\t\t$section = $newConf->GetConfig();\n\t\t\t$this->assertEqual(count($section), 3);\n\n\t\t\t$section = $newConf->GetConfig(\"this_section\");\n\t\t\t$this->assertEqual($section[\"this_var\"], \"ok\");\n\n\t\t\t$var = $newConf->getConfig(\"this_other_section/this_var\");\n\n\t\t\t$this->assertEqual($var, \"ok3\");\n\t\t}",
"public function update(User $user, Section $section)\n {\n return $user->hasPermission('update-reference-section');\n }",
"public function testParseParams(){\n $this->assertEquals($this->object->parseParams(array(\n 'type'=>'categorie-name',\n 'search'=>'android'\n )),'/type/categorie-name/search/android');\n \n $this->assertEquals($this->object->parseParams(array(\n 'type'=>'categorie-id',\n 'search'=>76\n )),'/type/categorie-id/search/76');\n }",
"public static function checkViewAccess($group, $section, $sub_section = NULL) {\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group_entity */\n $group_entity = \\Drupal::entityTypeManager()\n ->getStorage('group')\n ->load($group);\n /** @var \\Drupal\\living_spaces_sections\\LivingSpacesSectionsManagerInterface $service */\n $service = \\Drupal::service('living_spaces_sections.manager');\n\n if (!$group_entity ||\n !$service->isSectionsEnabled($group_entity->bundle()) ||\n !$group_entity->access('view')\n ) {\n return AccessResult::forbidden();\n }\n\n $path = implode('/', [$section, $sub_section]);\n $section = $service->getSectionFromGroupByPath($group_entity, $path);\n return AccessResult::allowedIf($section && $section->access('view'));\n }",
"public function edit(section $section)\n {\n //\n }",
"function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->REPLACEid == 0) ? -1 : $row->REPLACEid), $contentids))\r\n\t\t\treturn false;\r\n\r\n\t\t/* category included or excluded ? */\r\n\t\t$result = in_array((($row->REPLACEcatid == 0) ? -1 : $row->REPLACEcatid), $sections);\r\n\t\tif (($include && !$result) || (!$include && $result))\r\n\t\t\treturn false; /* include and not found OR exclude and found */\r\n\r\n\t\treturn true;\r\n\t}",
"function accessMenu( $uid, $access, $section ) {\r\n\tglobal $database;\r\n\r\n\t$row = new mosCategory( $database );\r\n\t$row->load( $uid );\r\n\t$row->access = $access;\r\n\r\n\tif ( !$row->check() ) {\r\n\t\treturn $row->getError();\r\n\t}\r\n\tif ( !$row->store() ) {\r\n\t\treturn $row->getError();\r\n\t}\r\n}",
"public function addSectionAction($values)\n\t{\n\t\t$this->vars['section_action'][] = (object) $values;\n\t}",
"function wp_credits_section_title($group_data = array())\n {\n }",
"function course_completion_check_custom_rule($element,$value,$extra) {\n $key = $extra[0];\n $values = $extra[1];\n $set_ok = false;\n\n foreach ($values->_options['choices'] as $name=>$choice) {\n $item = $key.'_'.$name;\n if (optional_param($item,0,PARAM_INT) == 1) {\n $set_ok = true;\n }\n }\n\n return $set_ok ? true : false;\n}",
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"protected abstract function urlByRouteSections (\\MvcCore\\IRoute $route, array & $params = [], $urlParamRouteName = NULL);",
"function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->id == 0) ? -1 : $row->id), $contentids))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n }",
"final protected function runBasicAction( $sAction,\r\n array $asArgv = [] ){\r\n $bReturn = false;\r\n switch ( $sAction ){\r\n case \"default\":\r\n $bReturn = $this->oModel->runBasicDataAction( $sAction,\r\n $asArgv );\r\n break;\r\n\r\n case \"none\":\r\n $bReturn = true;\r\n break;\r\n } // switch ( $sAction )\r\n\r\n return $bReturn;\r\n }",
"function checkSectionCategory(&$row, &$obj) {\r\n\t\t$include = isset($obj->_include_sc) ? $obj->_include_sc : false;\r\n\t\t$sections = isset($obj->_exclude_sections) ? $obj->_exclude_sections : array();\r\n\t\t$catids = isset($obj->_exclude_categories) ? $obj->_exclude_categories : array();\r\n\t\t$contentids = isset($obj->_exclude_contentids) ? $obj->_exclude_contentids : array();\r\n\t\t$contentitems = isset($obj->_exclude_contentitems) ? $obj->_exclude_contentitems : array();\r\n\r\n\t\t/* content item excluded ? DO NOT USE ANYMORE */\r\n\t\tif (in_array((($row->id == 0) ? -1 : $row->id), $contentids))\r\n\t\t\treturn false;\r\n\r\n\t\t/*\r\n\t\t * Include = include only : selected Ids OR selected Sections OR Selected Categories)\r\n\t\t * Exclude = exclude selected Ids OR selected Sections OR Selected Categories\r\n\t\t */\r\n\r\n\t\t/* content ids */\r\n\t\tif (count($contentitems) > 0) {\r\n\t\t\t$result = in_array((($row->id == 0) ? -1 : $row->id), $contentitems);\r\n\t\t\tif ($include && $result)\r\n\t\t\t\treturn true; /* include and selected */\r\n\t\t\tif (!$include && $result)\r\n\t\t\t\treturn false; /* exclude and selected */\r\n\t\t}\r\n\r\n\t\t/* sections (docman categories) */\r\n\t\t$result = in_array((($row->catsid == 0) ? -1 : $row->catsid), $sections);\r\n\t\tif ($include && $result)\r\n\t\t\treturn true; /* include and selected */\r\n\t\tif (!$include && $result)\r\n\t\t\treturn false; /* exclude and selected */\r\n\r\n\t\tif ($include)\r\n\t\t\treturn false; /* was not included */\r\n\t\tif (!$include)\r\n\t\t\treturn true; /* was not excluded */\r\n\t}",
"public function CLIAccesWithShortArgumentsBuildsCorrectRequest() {}",
"public function settings( $section, $args = false ) {\n\t\t\t// Section.\n\t\t\tif ( ! isset( $this->settings[ $section ] ) ):\n\t\t\t\t$this->settings[ $section ] = get_post_meta( $this->id, \"settings_$section\", true );\n\t\t\tendif;\n\n\t\t\t// Deep selection.\n\t\t\tif ( $this->settings[ $section ] !== false && $args !== false ):\n\t\t\t\t$paths = func_get_args();\n\t\t\t\tunset( $paths[0] );\n\n\t\t\t\treturn TotalPoll::instance( 'helpers' )->pathfinder( $this->settings[ $section ], $paths );\n\t\t\tendif;\n\n\t\t\treturn $this->settings[ $section ];\n\t\t}",
"public function test($arg);",
"public function testRun2(){\n\t\t$param = $this->urlParam;\n\t\t$param['{params}'] = '';\n\t\t$contact = $this->contacts('testUser');\n\t\t$this->assertTrackGeneric($contact,$param,$contact->trackingKey);\n\t}",
"private function verify_action_params( $subscription ){\n if( empty( $subscription->id ) )\n return false;\n\n $plan = pms_get_subscription_plan( $subscription->subscription_plan_id );\n\n if( $plan->type != 'group' )\n return false;\n\n return true;\n }",
"public function delete(User $user, Section $section)\n {\n return $user->hasPermission('delete-reference-section');\n }",
"public function testGetAuthorizationDivisionspermittedMe()\n {\n }",
"public function testUserControllerWithArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n\n $path = \"user/view/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"viewAction id:1\", $res);\n\n $path = \"user/search/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"searchAction str:moped\", $res);\n\n $path = \"user/test/42/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"testAction id:42 str:moped\", $res);\n }",
"public function test_that_authorized_user_can_view_courses_within_other_periods()\n {\n \n }",
"public function testDispatchWithArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/with-args/foo/bar'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }",
"abstract public function checkAccess($userId, $itemName, $params = array());",
"public function has(string $section, string $key) : bool;",
"public function testParseShortArguments()\n\t{\n\t\t$_SERVER['argv'] = array('/dev/null', '-ab', '-c', '-e', 'f', 'foobar', 'ghijk');\n\t\t$instance = new Cli(null, array('filter' => new \\Awf\\Tests\\Stubs\\Input\\FilterMock));\n\n\t\t$this->assertThat(\n\t\t\t$instance->get('a'),\n\t\t\t$this->identicalTo(true),\n\t\t\t'Line: ' . __LINE__ . '.'\n\t\t);\n\n\t\t$this->assertThat(\n\t\t\t$instance->get('b'),\n\t\t\t$this->identicalTo(true),\n\t\t\t'Line: ' . __LINE__ . '.'\n\t\t);\n\n\t\t$this->assertThat(\n\t\t\t$instance->get('c'),\n\t\t\t$this->identicalTo(true),\n\t\t\t'Line: ' . __LINE__ . '.'\n\t\t);\n\n\t\t$this->assertThat(\n\t\t\t$instance->get('e'),\n\t\t\t$this->identicalTo('f'),\n\t\t\t'Line: ' . __LINE__ . '.'\n\t\t);\n\n\t\t$this->assertThat(\n\t\t\t$instance->args,\n\t\t\t$this->equalTo(array('foobar', 'ghijk')),\n\t\t\t'Line: ' . __LINE__ . '.'\n\t\t);\n\t}",
"protected function _editSelf() {\n\t\t$actions = func_get_args();\n\n\t\tif (in_array($this->action, $actions)) {\n\t\t\tif (!isset($this->passedArgs['User'])) {\n\t\t\t\t$this->passedArgs['User'] = $this->activeUser['User']['id'];\n\t\t\t\t$this->params['named']['User'] = $this->activeUser['User']['id'];\n\t\t\t}\n\t\t}\n\t}",
"public function testInArray() {\n\t\t$array = array(\"a\", \"b\", \"c\");\n\t\t$this->assertTrue(permissionInPermissions($array, \"a\"));\n\t\t$this->assertTrue(permissionInPermissions($array, \"b\"));\n\t\t$this->assertTrue(permissionInPermissions($array, \"c\"));\n\t}",
"private function testSubArg($string) {\n if (strlen($string) >= 3) {\n $subarg = substr($string, 3);\n $pattern = \"+[ ]{2, }+\";\n if (preg_match($pattern, $string)) {\n return false;\n }\n return true;\n }\n \n return false;\n\n }",
"function paramsValidateTwo($instruction, $first_arg, $sec_arg)\n{\n if ((strcmp(\"MOVE\", $instruction[0]) == 0) || (strcmp(\"NOT\", $instruction[0]) == 0) || (strcmp(\"INT2CHAR\", $instruction[0]) == 0) || (strcmp(\"STRLEN\", $instruction[0]) == 0) || (strcmp(\"TYPE\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") )\n {\n Err();\n }\n }\n else if ((strcmp(\"READ\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg != \"type\"))\n {\n Err();\n }\n }\n}",
"public function read($section);",
"public function edit(Section $section)\n {\n }",
"function defaultable_sections($section = NULL) {\r\n if (in_array($section, array('row_options', 'row_plugin', 'items_per_page'))) {\r\n return FALSE;\r\n }\r\n return parent::defaultable_sections($section);\r\n }",
"function matchArguements($opts, $shortTags, $longTags)\n{\n foreach(str_split(str_replace(':', '', $shortTags)) as $idx => $opt)\n {\n $longopt = str_replace(':', '', $longTags[$idx]);\n if(isset($opts[$longopt]))\n {\n if(!isset($opts[$opt]))\n {\n $opts[$opt] = $opts[$longopt];\n }\n else\n {\n $opts[$longopt] = is_array($opts[$longopt])\n ? : [$opts[$longopt]];\n $opts[$opt] = is_array($opts[$opt]) ? : [$opts[$opt]];\n $opts[$opt] = array_merge($opts[$opt], $opts[$longopt]);\n }\n }\n }//end foreach\n\n return $opts;\n}",
"public function test(&$element, $value, $group = null, &$input = null, &$form = null)\n {\n // Get the possible field actions and the ones posted to validate them.\n $fieldActions = self::getFieldActions($element);\n $valueActions = self::getValueActions($value);\n\n // Make sure that all posted actions are in the list of possible actions for the field.\n foreach ($valueActions as $action)\n {\n if (!in_array($action, $fieldActions))\n {\n return false;\n }\n }\n\n return true;\n }",
"function keys_exist_in($array,$params,$section,$tbl = true){\r\n\r\n\tforeach($params as $item){\r\n\t\tif (!array_key_exists(trim($item),$array)){\r\n\t\t\tif ($tbl)\r\n\t\t\t\techo \"<tr><td colspan=\\\"5\\\"><strong>Error</strong>: key '$item' not found in $section!</td></tr>\";\r\n\t\t\telse\r\n\t\t\t\techo \"<strong>Error</strong>: key '$item' not found in $section!</form>\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}",
"public function renderSectionBody(array $section, DataCollection $collection, array $sections = [], string $sectionName = ''): void;",
"public static function validateSection($section)\n\t{\n\t\tif (JFactory::getApplication()->isClient('site'))\n\t\t{\n\t\t\t// On the front end we need to map some sections\n\t\t\tswitch ($section)\n\t\t\t{\n\t\t\t\t// Editing an download\n\t\t\t\tcase 'form':\n\n\t\t\t\t\t// Category list view\n\t\t\t\tcase 'featured':\n\t\t\t\tcase 'category':\n\t\t\t\t\t$section = 'download';\n\t\t\t}\n\t\t}\n\n\t\tif ($section != 'download')\n\t\t{\n\t\t\t// We don't know other sections\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $section;\n\t}"
] | [
"0.5803498",
"0.5566526",
"0.53851414",
"0.5227098",
"0.51804197",
"0.50407124",
"0.48020297",
"0.4778006",
"0.47397548",
"0.47348225",
"0.47177112",
"0.46829703",
"0.46779534",
"0.4668429",
"0.46591905",
"0.4640222",
"0.46230632",
"0.46077523",
"0.4570732",
"0.4569551",
"0.45618418",
"0.45480436",
"0.45466194",
"0.4543158",
"0.45395902",
"0.4526322",
"0.45241687",
"0.45193633",
"0.45154953",
"0.4515121",
"0.45087555",
"0.45049602",
"0.45042396",
"0.45042396",
"0.4504067",
"0.4504067",
"0.45013013",
"0.44989952",
"0.44859",
"0.4484925",
"0.4481295",
"0.44703755",
"0.44520354",
"0.44445005",
"0.44414005",
"0.44347414",
"0.44320726",
"0.4430749",
"0.44271058",
"0.44228333",
"0.44220912",
"0.44148815",
"0.4414594",
"0.44056404",
"0.4396185",
"0.43893522",
"0.43819138",
"0.43808448",
"0.4375227",
"0.4374163",
"0.43682048",
"0.43671152",
"0.43641284",
"0.4360925",
"0.43584684",
"0.43533987",
"0.43527552",
"0.434447",
"0.4340592",
"0.43388662",
"0.43238357",
"0.43206188",
"0.43096176",
"0.43075958",
"0.43071815",
"0.42784494",
"0.4276538",
"0.42672065",
"0.42654243",
"0.42652205",
"0.42593595",
"0.4257731",
"0.42559373",
"0.42439756",
"0.42439288",
"0.42430106",
"0.4240178",
"0.42285195",
"0.4227853",
"0.4226246",
"0.4219415",
"0.42128566",
"0.42086685",
"0.41913426",
"0.41909567",
"0.41901043",
"0.41868556",
"0.41770718",
"0.4175133",
"0.41656613"
] | 0.6504436 | 0 |
Tests a data reference in an action group resolved with a persisted reference used in another function. | public function testGetStepsWithOuterScopePersistence()
{
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);
$this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkData($callable, $params = null, $group = null){\r\n \t\t$group = ($group) ? $group : $this->_options['defaultgroup'];\r\n \r\n \t\t// Get the storage handler\r\n \t\t$handler =& $this->_getStorage();\r\n \t\tif (!JError::isError($handler) && $this->_options['caching']) {\r\n \t\t\treturn !!$handler->get($this->_makeId($callable, $params), $group, (isset($this->_options['checkTime']))? $this->_options['checkTime'] : true);\r\n \t\t}\r\n \t\treturn false;\r\n }",
"function testObjReference() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n \r\n\t\t// Create an object to reference\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testGenSave\");\r\n\t\t$oid = $obj->save(false);\r\n\r\n\t\t// Create an activity with the reference\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", null, $this->user);\r\n\t\t$objAct->setValue(\"obj_reference\", \"customer:$oid\");\r\n\t\t$aid = $objAct->save(false);\r\n\t\t$this->assertTrue($aid > 0 );\r\n\t\tunset($objAct);\r\n\r\n\t\t// Close and then open again\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", $aid, $this->user);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n\t\tunset($objAct);\r\n\r\n\t\t// Test with the list cache\r\n\t\t$list = new CAntObjectList($dbh, \"activity\", $this->user);\r\n\t\t$list->addCondition(\"and\", \"id\", \"is_equal\", $aid);\r\n\t\t$list->getObjects();\r\n\t\t$this->assertEquals($list->getNumObjects(), 1);\r\n\t\t$objAct = $list->getObject(0);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n \r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\t$objAct->removeHard();\r\n\t}",
"function store($id, $group, $data)\n {\n return true;\n }",
"public function dataIsReference()\n {\n return [\n [\n '/* testBitwiseAndA */',\n false,\n ],\n [\n '/* testBitwiseAndB */',\n false,\n ],\n [\n '/* testBitwiseAndC */',\n false,\n ],\n [\n '/* testBitwiseAndD */',\n false,\n ],\n [\n '/* testBitwiseAndE */',\n false,\n ],\n [\n '/* testBitwiseAndF */',\n false,\n ],\n [\n '/* testBitwiseAndG */',\n false,\n ],\n [\n '/* testBitwiseAndH */',\n false,\n ],\n [\n '/* testBitwiseAndI */',\n false,\n ],\n [\n '/* testFunctionReturnByReference */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceC */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceD */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceE */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceF */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceG */',\n true,\n ],\n [\n '/* testForeachValueByReference */',\n true,\n ],\n [\n '/* testForeachKeyByReference */',\n true,\n ],\n [\n '/* testArrayValueByReferenceA */',\n true,\n ],\n [\n '/* testArrayValueByReferenceB */',\n true,\n ],\n [\n '/* testArrayValueByReferenceC */',\n true,\n ],\n [\n '/* testArrayValueByReferenceD */',\n true,\n ],\n [\n '/* testArrayValueByReferenceE */',\n true,\n ],\n [\n '/* testArrayValueByReferenceF */',\n true,\n ],\n [\n '/* testArrayValueByReferenceG */',\n true,\n ],\n [\n '/* testArrayValueByReferenceH */',\n true,\n ],\n [\n '/* testAssignByReferenceA */',\n true,\n ],\n [\n '/* testAssignByReferenceB */',\n true,\n ],\n [\n '/* testAssignByReferenceC */',\n true,\n ],\n [\n '/* testAssignByReferenceD */',\n true,\n ],\n [\n '/* testAssignByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceA */',\n true,\n ],\n [\n '/* testPassByReferenceB */',\n true,\n ],\n [\n '/* testPassByReferenceC */',\n true,\n ],\n [\n '/* testPassByReferenceD */',\n true,\n ],\n [\n '/* testPassByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceF */',\n true,\n ],\n [\n '/* testPassByReferenceG */',\n true,\n ],\n [\n '/* testPassByReferenceH */',\n true,\n ],\n [\n '/* testPassByReferenceI */',\n true,\n ],\n [\n '/* testPassByReferenceJ */',\n true,\n ],\n [\n '/* testNewByReferenceA */',\n true,\n ],\n [\n '/* testNewByReferenceB */',\n true,\n ],\n [\n '/* testUseByReference */',\n true,\n ],\n [\n '/* testArrowFunctionReturnByReference */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testClosureReturnByReference */',\n true,\n ],\n ];\n\n }",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"public function testRelatedGroupsAreSaved(): void\n {\n $items = Category::factory()->count(1)->create();\n $group = Group::factory()->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.groups', [$group->id])\n ->emit('save')\n ->assertOk()\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'success';\n });\n\n $this->assertEquals(1, $items[0]->groups()->count());\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"public function testSaveDataScopeStore()\n {\n $this->entityModel->expects($this->once())->method('getNewSku')->will($this->returnValue([\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ]));\n $this->entityModel->expects($this->once())->method('getOldSku')->will($this->returnValue([\n 'sku_assoc2' => ['entity_id' => 3]\n ]));\n $attributes = ['position' => ['id' => 0], 'qty' => ['id' => 0]];\n $this->links->expects($this->once())->method('getAttributes')->will($this->returnValue($attributes));\n\n $bunch = [[\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]];\n $this->entityModel->expects($this->at(2))->method('getNextBunch')->will($this->returnValue($bunch));\n $this->entityModel->expects($this->any())->method('isRowAllowedToImport')->will($this->returnValue(true));\n $this->entityModel->expects($this->at(4))->method('getRowScope')->will($this->returnValue(\n \\Magento\\CatalogImportExport\\Model\\Import\\Product::SCOPE_DEFAULT\n ));\n $this->entityModel->expects($this->at(5))->method('getRowScope')->will($this->returnValue(\n \\Magento\\CatalogImportExport\\Model\\Import\\Product::SCOPE_STORE\n ));\n\n $this->links->expects($this->once())->method('saveLinksData');\n $this->grouped->saveData();\n }",
"public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }",
"public function testDereferenceBasic()\n {\n $src = 'success';\n $ref = &$src;\n $this->debug->log('ref', $ref);\n $src = 'fail';\n $output = $this->debug->output();\n $this->assertContains('success', $output);\n }",
"public function store($id, $group, $data)\n\t{\n\t\treturn true;\n\t}",
"public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function testGetValueDeref()\r\n\t{\r\n\t\t$obj = CAntObject::factory($this->dbh, \"task\", null, $this->user);\r\n\t\t$obj->setValue(\"user_id\", $this->user->id);\r\n\t\t$obj->save();\r\n\r\n\t\t$this->assertEquals($this->user->getValue(\"name\"), $obj->getValueDeref(\"user_id.name\"));\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"public function test_do_action_closure( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"public function testStoreSupplierGroup()\n {\n }",
"public function testActionUseCase3()\n {\n\n // person, user, and target\n $user = factory(UserEloquent::class)->create();\n $person = factory(PersonEloquent::class)->create([\n 'is_pre_approved' => 0,\n 'is_primary' => 0,\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $stageId = StageEloquent::where('label', 'prospect')->where('user_id', null)->first()->getKey();\n $stageLeadId = StageEloquent::where('label', 'lead')->where('user_id', null)->first()->getKey();\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $stageId,\n 'lead_type_id' => $leadTypeId,\n ]);\n $tag = TagEloquent::find(10);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n\n // workflow, rule, action and object\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_pre_approved',\n 'value' => '1',\n ]);\n $action2 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'person_contexts',\n 'target_field' => 'stage_id',\n 'value' => $stageLeadId,\n ]);\n $workflow->actions()->sync([$action1->getKey(), $action2->getKey()]); //\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $tag->getKey(),\n ]);\n\n\n // // parent rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'not preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '0'\n ]);\n\n // dependent rule\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'is prospect person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $stageId,\n 'parent_id' => $rule1->getKey(),\n ]);\n $action1->rules()->sync([ $rule1->getKey()]);\n $action2->rules()->sync([ $rule2->getKey()]);\n\n\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n //// check should failed /////\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n 'info' => 'Dependent rule(s) not meet!',\n ]);\n $this->notSeeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n //// second run, run action 1 first /////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //echo $output->fetch();\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(),\n 'object_id' => $person->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('persons',[\n 'id' => $person->getKey(),\n $action1->target_field => $action1->value,\n ]);\n\n //// second run, run action 2 then ///\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $person);\n }",
"public function test_do_action_funcname( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"function save($data, $group_id = false, $permission_data = null, $permission_action_data = null)\n {\n $success = false;\n\n if (!$group_id) {\n if ($this->db->insert('groups', $data)) {\n\n $data['group_id'] = $this->db->insert_id();\n\n // We have either inserted or updated a new employee, now lets set permissions.\n if ($data['group_id'] && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $data['group_id']));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// $this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $data['group_id']));\n\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $data['group_id']));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $data['group_id'];\n }\n return $success;\n }\n\n /* Update Group */\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', $data);\n\n if ($success && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $group_id));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $group_id));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $group_id));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t// \t$this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $group_id));\n\t\t\t\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $group_id));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $success;\n }",
"public function testDeleteSupplierGroup()\n {\n }",
"public function hasAssignment(ElementableDependencyDataProvider $data_provider): bool;",
"public function getByReference(): bool;",
"public function populateAsReference()\n {\n\n $orm = $this->db->getOrm();\n\n // Reference Container zum befüllen der Referenz Datensätze\n $refContainers = array();\n\n // Sicher stelle, das keine unerwarteten Daten in der Tabelle sind\n $orm->cleanResource('WbfsysRoleGroup');\n\n // Leeren des Caches\n $orm->clearCache();\n\n // global\n $orm->import\n (\n 'WbfsysRoleGroup',\n array\n (\n array\n (\n 'name' => 'name_1',\n 'access_key' => 'access_key_1',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisici elit,\nsed eiusmod tempor incidunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\naliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit\nesse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt\nmollit anim id est laborum.'\n ),\n )\n );\n\n }",
"public function testMergeActions() {\n $contact = $this->contact('testAnyone');\n $action = new Actions;\n $action->actionDescription = \"TEST\";\n $action->visibility = 1;\n $action->associationType = \"contacts\";\n $action->associationId = $contact->id;\n $action->save();\n\n $model = new Contacts;\n foreach ($contact->attributes as $key => $val) {\n if ($key != 'id' && $key != 'nameId') {\n $model->$key = $val;\n }\n }\n $model->save();\n\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n\n $mergeData = $model->mergeActions($contact, true);\n\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n\n $model->unmergeActions($contact->id, $mergeData);\n\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n }",
"public function testChangingReferenceName(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->setAlias('FavoritePost');\n $table->addBehavior(\n 'Translate',\n ['fields' => ['body'], 'referenceName' => 'Posts']\n );\n\n $items = $table->associations();\n $association = $items->getByProperty('body_translation');\n $this->assertNotEmpty($association, 'Translation association not found');\n\n $found = false;\n foreach ($association->getConditions() as $key => $value) {\n if (strpos($key, 'body_translation.model') !== false) {\n $found = true;\n $this->assertSame('Posts', $value);\n break;\n }\n }\n\n $this->assertTrue($found, '`referenceName` field condition on a Translation association was not found');\n }",
"public function testReference()\n {\n if (is_null($this->ref)) {\n return;\n }\n\n $this->assertArrayHasKey(\n 'extensions',\n $this->ref,\n \"No extension in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'functions',\n $this->ref,\n \"No function in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'constants',\n $this->ref,\n \"No constant in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'classes',\n $this->ref,\n \"No classe in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'interfaces',\n $this->ref,\n \"No interface in Reference\"\n );\n }",
"function update( string $_group_key, IIndexedEntity $_entity ): bool;",
"public function testCustomSave() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r1');\");\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r2');\");\r\n\r\n\t\t$result = $dbh->Query(\"select id from customer_labels limit 2\");\r\n\t\t$g1 = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$g2 = $dbh->GetValue($result, 1, \"id\");\r\n\r\n\t\t// Test mValue\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$obj->setMValue(\"groups\", $g1);\r\n\t\t$obj->setMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->removeMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t// Make sure mvalues reload and that we are not using too many queries to load the object\r\n\t\t// TODO: work on the dacl to only allow one query when loading an object\r\n\t\t$statBefore = $dbh->statNumQueries;\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"Test Assoc\");\r\n\t\t$this->assertFalse($obj->getMValueExists(\"groups\", $g2));\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertTrue(($dbh->statNumQueries-$statBefore)<=2); // Loading an object should never take more than 2 queries\r\n\t\t//echo \"<pre>Num Queries: \".($dbh->statNumQueries-$statBefore).\"</pre>\";\r\n\r\n\t\t// Test object_multi\r\n\t\t$cont = new CAntObject($dbh, \"contact_personal\", null, $this->user);\r\n\t\t$cont->setValue(\"first_name\", \"Test Personal Contact\");\r\n\t\t$contactId = $cont->save();\r\n\t\t$this->assertTrue($contactId > 0);\r\n\t\t$obj->debug = true;\r\n\t\t$obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false);\r\n \r\n // Test remove the mvalue\r\n $obj->removeMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n unset($obj);\r\n \r\n // Test remove all mvalues\r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false); // Make sure the mvalue was set\r\n $obj->removeMValues(\"associations\"); // now remove the mvalues\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n\r\n\t\t// Test object (with no type)\r\n\t\t$com = new CAntObject($dbh, \"comment\", null);\r\n\t\t$com->setValue(\"obj_reference\", \"contact_personal:$cid\");\r\n\t\t$comid = $com->save(false);\r\n\t\tunset($com);\r\n\t\t$com = new CAntObject($dbh, \"comment\", $comid);\r\n\t\t$this->assertEquals($com->getValue(\"obj_reference\"), \"contact_personal:$cid\");\r\n\t\t$com->removeHard();\r\n\t\t\r\n\t\t// Cleanup\r\n\t\t$cont->removeHard();\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r1';\");\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r2';\");\r\n\t}",
"public function call($data, $action)\n {\n }",
"public function testConversion(){\n $objects = array(\n 'testUser' => array(\n 'userA',\n 'userB'\n ),\n 'CGroup' => array(\n 'group'\n )\n );\n \n foreach($objects as $type => $arr){\n foreach($arr as $alias){\n $$alias = new $type;\n $this->assertTrue($$alias->save());\n }\n }\n \n $group->alias = 'group';\n $this->assertTrue($group->save());\n \n /**\n * Give B some rights on the group and let userA join that group\n */\n $userB->grant('group', '*');\n $this->assertFalse($userB->may($userA, 'read'));\n \n $userA->beAco();\n $this->assertTrue($userA->join('group'));\n $this->assertTrue($userB->may($userA, 'read'));\n $this->assertTrue($userA->leave('group'));\n $this->assertFalse($userB->may($userA, 'read'));\n \n //And once more, directly\n $userB->grant($userA, 'read');\n $this->assertTrue($userB->may($userA, 'read'));\n \n //Remove all objects\n foreach($objects as $type=> $arr)\n foreach($arr as $obj)\n $this->assertTrue($$obj->delete()); \n }",
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }",
"function isWikiPageReferenced($wikipage, $group_id) {\n $obsoleteToday = $this->getObsoleteToday();\n $sql = sprintf('SELECT item_id'.\n ' FROM plugin_docman_item'.\n ' WHERE wiki_page = \\'%s\\''.\n ' AND group_id = %d'.\n ' AND delete_date IS NULL'.\n ' AND (obsolescence_date > %d OR obsolescence_date=0)'\n , db_es($wikipage), db_ei($group_id), $obsoleteToday\n );\n $res = $this->retrieve($sql);\n if($res && !$res->isError() && $res->rowCount() >= 1) {\n return true;\n }\n else {\n return false;\n }\n }",
"public function testTagAttach()\n {\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_EXECUTE,\n 'target_class' => 'tagger',\n 'target_field' => 'attach',\n 'value' => 'attach_tag',\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n \n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'tag person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag2->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function canActOnTarget($action,$target) {\n // owner of target -> always yes, except for verification\n // all other situatons -> check role action targets\n // - matching globals -> yes\n // - specifics\n // + gets messy\n // - otherwise -> no\n\n if (is_string($action)) {\n global $ACTIONS;\n $action = $ACTIONS[$action];\n }\n\n // system admin -> always yes\n if ($this->flag_is_system_admin) {\n return true;\n }\n\n// util_prePrintR($action);\n// util_prePrintR($target);\n\n // owner of target -> always yes, except for verification\n if ($target->user_id == $this->user_id) {\n if ($action->name != 'verify') { return true; }\n }\n\n\n // view & list is controlled by flags on the object rather than explicit permissions / access records\n if (($action->name == 'view') || ($action->name == 'list')) {\n if (array_key_exists('flag_active',$target->fieldValues)) {\n if ($target->flag_active) {\n return true;\n }\n } elseif (array_key_exists('flag_workflow_published',$target->fieldValues)) {\n if (($target->flag_workflow_published) && (($target->flag_workflow_validated))) {\n return true;\n }\n }\n }\n\n // all other situatons -> check role action targets\n $this->cacheRoleActionTargets();\n\n // - matching globals -> yes\n $target_global_type = Role_Action_Target::getGlobalTargetTypeForObject($target);\n if (in_array($target_global_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_global_type] as $glob_rat) {\n if ($glob_rat->action_id == $action->action_id) {\n return true;\n }\n }\n }\n\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n // - specifics\n // + gets messy\n\n // if the allowed target types do not contain the specific type of the target in question, then no need to go further\n\n // get a list of all the specific ids to check. This gets a bit messy as we have to climb or include a hierarchy depending on what exactly the target is\n\n// util_prePrintR($target);\n\n $ids_to_check = array();\n\n $target_class = get_class($target);\n switch ($target_class) {\n case 'Authoritative_Plant':\n $ids_to_check = array($target->authoritative_plant_id);\n break;\n case 'Authoritative_Plant_Extra':\n // can act on this if can act on the plant\n return $this->canActOnTarget($action,$target->getAuthoritativePlant());\n break;\n case 'Metadata_Structure':\n // can edit this if can edit itself or any parent\n $ids_to_check = Db_Linked::arrayOfAttrValues($target->getLineage(),'metadata_structure_id');\n break;\n case 'Metadata_Term_Set':\n // can edit if can edit any structure that uses this term set\n $structures = Metadata_Structure::getAllFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection);\n $ids_to_check = array();\n foreach ($structures as $s) {\n $ids_to_check = array_merge($ids_to_check,Db_Linked::arrayOfAttrValues($s->getLineage(),'metadata_structure_id'));\n }\n break;\n case 'Metadata_Term_Value':\n // can edit if can edit any structure that uses the term set for which this is a value\n return $this->canActOnTarget($action,Metadata_Term_Set::getOneFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection));\n break;\n case 'Metadata_Reference':\n // can edit if can edit anything to which this refers\n return $this->canActOnTarget($action,$target->getReferrent());\n break;\n case 'Notebook':\n $ids_to_check = array($target->notebook_id);\n break;\n case 'Notebook_Page':\n // can act on if can act on the notebook that contains this page\n return $this->canActOnTarget($action,$target->getNotebook());\n break;\n case 'Notebook_Page_Field':\n // can act on if can act on the notebook that contains the notebook page that this page field\n return $this->canActOnTarget($action,$target->getNotebookPage()->getNotebook());\n break;\n case 'Specimen':\n $ids_to_check = array($target->specimen_id);\n break;\n case 'Specimen_Image':\n // can act on if can act on the specimen\n return $this->canActOnTarget($action,$target->getSpecimen());\n break;\n default:\n break;\n }\n\n// util_prePrintR($ids_to_check);\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n $target_specific_type = Role_Action_Target::getSpecificTargetTypeForObject($target);\n if (! in_array($target_specific_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n return false;\n }\n\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_specific_type] as $spec_rat) {\n if (($spec_rat->action_id == $action->action_id) && (in_array($spec_rat->target_id,$ids_to_check))) {\n if ($action->name == 'view') {\n $actual_target = $spec_rat->getTargets()[0];\n if (array_key_exists('flag_workflow_published',$actual_target->fieldValues)) {\n return $actual_target->flag_workflow_published && $actual_target->flag_workflow_validated;\n }\n }\n return true;\n }\n }\n\n return false;\n }",
"public function testGroupContentEntityOperationAccessAlterHook(string $operation): void {\n // Check that our test user doesn't have access to edit or delete comments\n // in the group.\n // This is the default behavior for users that are not a group member.\n $this->assertFalse($this->userHasAccess($operation));\n\n // Now enable our hook which will alter the group content entity operation\n // access rules to allow moderators to edit and delete comments in all\n // groups. Since our user is a moderator they should now have access.\n \\Drupal::state()->set('og_test_group_content_entity_operation_access_alter', TRUE);\n $this->assertTrue($this->userHasAccess($operation));\n }",
"function checkReference() {\n\t\t$arrRecord = BackendUtility::getRecord($this->arrWizardParameters['table'], $this->arrWizardParameters['uid']);\n\t\tif (!is_array($arrRecord))\t{\n\t\t\tBackendUtility::typo3PrintError('Wizard Error', 'No reference to record', 0);\n\t\t\texit;\n\t\t}\n }",
"public function hasReferences() {}",
"function &artifact_get_object($artifact_id,$data=false) {\n\tglobal $ARTIFACT_OBJ;\n\tif (!isset($ARTIFACT_OBJ[\"_\".$artifact_id.\"_\"])) {\n\t\tif ($data) {\n\t\t\t//the db result handle was passed in\n\t\t} else {\n\t\t\t$res = db_query_params ('SELECT * FROM artifact_vw WHERE artifact_id=$1',\n\t\t\t\t\t\tarray ($artifact_id)) ;\n\t\t\tif (db_numrows($res) <1 ) {\n\t\t\t\t$ARTIFACT_OBJ[\"_\".$artifact_id.\"_\"]=false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$data = db_fetch_array($res);\n\t\t}\n\t\t$ArtifactType =& artifactType_get_object($data[\"group_artifact_id\"]);\n\t\t$ARTIFACT_OBJ[\"_\".$artifact_id.\"_\"]= new Artifact($ArtifactType,$data);\n\t}\n\treturn $ARTIFACT_OBJ[\"_\".$artifact_id.\"_\"];\n}",
"function has_module_action_permission($module_id, $action_id, $group_id)\n {\n if ($module_id == null) {\n return true;\n }\n\n static $cache;\n\n if (isset($cache[$module_id . '|' . $action_id . '|' . $group_id])) {\n return $cache[$module_id . '|' . $action_id . '|' . $group_id];\n }\n\n\n $query = $this->db->get_where('group_permissions_actions', array('group_id' => $group_id, 'module_id' => $module_id, 'action_id' => $action_id), 1);\n $cache[$module_id . '|' . $action_id . '|' . $group_id] = $query->num_rows() == 1;\n return $cache[$module_id . '|' . $action_id . '|' . $group_id];\n }",
"function store($data, $id, $group = null)\n {\n // Get the default group\n $group = ($group) ? $group : $this->_options['defaultgroup'];\n\n // Get the storage handler and store the cached data\n $handler = $this->_getStorage();\n if ($handler != null && $this->_options['caching']) {\n return $handler->store($id, $group, $data);\n }\n return false;\n }",
"private function assertOnMergeKeyAndActionValue($actions, $expectedValue, $expectedMergeKey = null)\n {\n $expectedMergeKey = $expectedMergeKey ??\n ActionGroupObjectBuilder::DEFAULT_ACTION_OBJECT_NAME . self::ACTION_GROUP_MERGE_KEY;\n $this->assertArrayHasKey($expectedMergeKey, $actions);\n\n $action = $actions[$expectedMergeKey];\n $this->assertEquals($expectedMergeKey, $action->getStepKey());\n $this->assertEquals($expectedValue, $action->getCustomActionAttributes());\n }",
"public function testSavedExisting() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$cust = CAntObject::factory($dbh, \"customer\", null, $this->user);\r\n\t\t$grpd = $cust->addGroupingEntry(\"groups\", \"Unit Test Group\", \"e3e3e3\");\r\n\t\t$statd = $cust->addGroupingEntry(\"status_id\", \"Unit Test Status\", \"e3e3e3\");\r\n\t\t\r\n\t\t$g1 = $grpd['id'];\r\n\t\t$s1 = $statd['id'];\r\n\r\n\t\t// Manually insert a customer\r\n\t\t$result = $dbh->Query(\"insert into customers(name, status_id) values('big unit test', '$s1');select currval('customers_id_seq') as id;\");\r\n\t\t$cid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t\r\n\t\tif ($dbh->GetNumberRows($result))\r\n\t\t{\r\n\t\t\t$cid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t\t$dbh->Query(\"insert into customer_label_mem(customer_id, label_id) VALUES('$cid', '$g1');\");\r\n\t\t}\r\n\t\t\r\n\t\t// Save customer groups using CAntObject\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testSavedExisting\");\r\n\t\t$savedId = $obj->save(); \r\n\t\t$this->assertEquals($savedId, $cid);\r\n\t\tunset($obj);\r\n\t\t\r\n\t\t// Open and make sure the object has a value, then save it\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertEquals($obj->getForeignValue(\"groups\"), \"Unit Test Group\");\r\n\t\t$this->assertEquals($obj->getValue(\"status_id\"), $s1);\r\n\t\t$this->assertEquals($obj->getForeignValue(\"status_id\"), \"Unit Test Status\");\r\n\t\t$obj->save();\r\n\t\tunset($obj);\r\n\r\n\t\t// Open again and make sure the object has a value for groups\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$obj->save();\r\n\r\n\r\n\t\t// Now test with object references both with and with subtypes\r\n\t\t$act = CAntObject::factory($dbh, \"activity\", null, $this->user);\r\n\r\n\t\t// Manually insert an activity\r\n\t\t$result = $dbh->Query(\"insert into objects_activity_act(name, user_id) values('big unit test', '\".$this->user->id.\"');\r\n\t\t\t\t\t\t\t\tselect currval('objects_id_seq') as id;\");\r\n\t\t$aid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$field = $act->def->getField('obj_reference');\r\n\t\t$fieldUser = $act->def->getField('user_id');\r\n\t\t$dbh->Query(\"insert into object_associations(type_id, object_id, assoc_type_id, assoc_object_id, field_id) \r\n\t\t\t\t\t\tVALUES('\".$act->object_type_id.\"', '$aid', '\".$obj->object_type_id.\"', \r\n\t\t\t\t\t\t'$cid', '\".$field->id.\"');\");\r\n\t\t$dbh->Query(\"insert into object_associations(type_id, object_id, assoc_type_id, assoc_object_id, field_id) \r\n\t\t\t\t\t\tVALUES('\".$act->object_type_id.\"', '$aid', '\".$this->user->userObj->object_type_id.\"', \r\n\t\t\t\t\t\t'\".$this->user->id.\"', '\".$fieldUser->id.\"');\");\r\n\r\n\t\t$obj2 = new CAntObject($dbh, \"activity\", null, $this->user);\r\n $obj2->id = $aid;\r\n $obj2->load();\r\n\t\t$this->assertEquals($obj2->getValue(\"obj_reference\"), \"customer:$cid\");\r\n\t\t$this->assertEquals($obj2->getForeignValue(\"obj_reference\"), \"testSavedExisting\");\r\n\t\t$this->assertEquals($obj2->getValue(\"user_id\"), $this->user->id);\r\n\t\t$this->assertEquals($obj2->getForeignValue(\"user_id\"), $this->user->name);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->deleteGroupingEntry(\"groups\", $grpd['id']);\r\n\t\t$obj->deleteGroupingEntry(\"status_id\", $statd['id']);\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$act->removeHard();\r\n\t}",
"public function test_do_action_create_function( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"public function testProjectAssignmentsLinkRelation()\n {\n }",
"public function memberOf(string $groupName) : bool;",
"public function test_do_action_within_class_instance( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"public function groupContentEntityOperationAccessAlterHookTestProvider(): array {\n return [\n ['update'],\n ['delete'],\n ];\n }",
"function &act() {\n return $this->reference;\n }",
"public function set($key, $data, $group = 'default', $expire = 0)\n {\n $key = $this->getInstanceKey($key, $group);\n\n // Cache for this request locally\n $this->cache[$key] = $data;\n\n // If the group is a non-memcached group we should'nt save it but return success\n if (in_array($group, $this->no_mc_groups)) {\n return true;\n }\n\n $expire = $this->getExpirationTime($expire);\n\n foreach ($this->mc as $mc) {\n if (!$mc->set($key, $data, $expire)) {\n $this->deleteByKey($key);\n return false;\n }\n }\n\n return true;\n }",
"public function testBasicAssignments() {\n\t\t$query = new Query();\n\t\t$group = ['key' => 'hits', 'reduce' => 'function() {}'];\n\t\t$calculate = 'count';\n\n\t\t$this->assertNull($query->group());\n\t\t$query->group($group);\n\t\t$this->assertEqual($group, $query->group());\n\n\t\t$this->assertNull($query->calculate());\n\t\t$query->calculate($calculate);\n\t\t$this->assertEqual($calculate, $query->calculate());\n\n\t\t$query = new Query(compact('calculate', 'group'));\n\t\t$this->assertEqual($group, $query->group());\n\t\t$this->assertEqual($calculate, $query->calculate());\n\n\t\t$query->group(false);\n\t\t$this->assertNull($query->group());\n\t}",
"function _acf_apply_is_local_field_group_key($bool, $id)\n{\n}",
"public function testFileRefs() {}",
"public function testReportsReferralsGet()\n {\n }",
"public function testTagDetach()\n {\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_EXECUTE,\n 'target_class' => 'tagger',\n 'target_field' => 'detach',\n 'value' => 'detach_tag',\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n \n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'detach tag person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check tag\n $this->notSeeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"function groups_assign_grouping($groupingid, $groupid) {\n if (record_exists('groupings_groups', 'groupingid', $groupingid, 'groupid', $groupid)) {\n return true;\n }\n $assign = new object();\n $assign->groupingid = $groupingid;\n $assign->groupid = $groupid;\n $assign->timeadded = time();\n return (bool)insert_record('groupings_groups', $assign);\n}",
"public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }",
"protected static function isObjectReference($data)\n {\n if (isset($data['id']) && isset($data['type']))\n {\n if (count($data) === 2) return true;\n return isset($data['href']) && count($data) === 3;\n }\n return false;\n }",
"public function testGeTaskVariableData()\n {\n }",
"function delete( string $_group_key, IIndexedEntity $_entity ): bool;",
"public function testShowSupplierGroup()\n {\n }",
"function isReferenceTo ( &$anObject ) {\n \t\t// Store the value of $anObject\n \t\t$temp = $anObject;\n \t\t\n \t\t// Set the value of $anObject to something unique and see if $this\n \t\t// has changed as well.\n\t\t$anObject = uniqid(\"test_ref\");\n\t\t$is_ref = ($anObject === $this);\n\t\t\n\t\t// Put back the original value.\n\t\t$anObject = $temp;\n \t\treturn $is_ref;\n \t}",
"public function testDeleteOnDelete() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_delete', array(1), $Action);\n\t}",
"function changeRecord($hookName, $params) {\n\t\t$record =& $params[0];\n\t\t$row = $params[1];\n\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t$journal = $journalDao->getJournal($row['journal_id']);\n\t\t$openAIREDao =& DAORegistry::getDAO('OpenAIREDAO');\n\t\tif ($openAIREDao->isOpenAIREArticle($row['article_id'])) {\n\t\t\t$record->sets[] = $journal->getPath() . ':ec_fundedresources';\n\t\t}\n\t\treturn false;\t\n\t}",
"public function test_do_action_within_class( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}",
"public function returnsReference()\n\t{\n\t\treturn false;\n\t}",
"public function testFreedIsTrue(): void\n {\n $this->get_accessible_reflection_property('freed');\n $this->assertTrue($this->get_reflection_property_value('freed'));\n }",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function testDereferenceObject()\n {\n $testVal = 'success A';\n $testO = new TestObj();\n $testO->propPublic = &$testVal;\n $this->debug->log('test_o', $testO);\n $testVal = 'success B';\n $this->debug->log('test_o', $testO);\n $testVal = 'fail';\n $output = $this->debug->output();\n self::assertStringContainsString('success A', $output);\n self::assertStringContainsString('success B', $output);\n self::assertStringNotContainsString('fail', $output);\n self::assertSame('fail', $testO->propPublic); // prop should be 'fail' at this point\n }",
"public function testProjectAssignmentsSave()\n {\n }",
"public function acl_verify_access($group = false) {\n\t\t\n\t\t//debug($this->controller);\n\t\t\n\t\t\n\t\tif (!$group) {\n\t\t\t$username = $this->controller->Authsome->get('username');\n\t\t\t$group_name = $this->controller->Authsome->get($this->settings['group_model'].'.name');\n\t\t\t$group_id = $this->controller->Authsome->get($this->settings['group_model'].'.id');\n\t\t}\n\t\t\n\t\t$controller = $this->controller->params['controller'];\n\t\t$action = $this->controller->params['action'];\n\n\t\t//////////////////////////////////////////////////////////\n\t\t// Original SQL Query (sorts in order of precedence explained in header, gets first match)\n\t\t// Result is the most specific ACL rule.\n\t\t//\n\t\t// SELECT permission FROM auth_acls \n\t\t// WHERE auth_group_id IN ('1', '*') AND controller IN ('deployments', \"*\") AND action IN ('run', \"*\") \n\t\t// ORDER BY auth_group_id DESC, controller DESC, action DESC\n\t\t// LIMIT 1\n\t\t//////////////////////////////////////////////////////////\n\n\t\t$acl_model = ClassRegistry::init($this->settings['acl_model']);\n\n\t\t//////////////////////////////////////////////////////////\n\t\t// Special Debugging for ACL DB Data\n\t\t//\n\t\t$DEBUG_SQL = FALSE;\n\t\t\n\t\tif ($DEBUG_SQL) {\n\t\t\t$params_debug = array(\n\t\t\t\t// 'fields' => array('permission'), // <------- COMMENTED FOR DEBUG\n\t\t\t\t'conditions' => array('auth_group_id' => array($group_id, '*'),\n\t\t\t\t\t\t\t\t\t 'controller' => array($controller, '*'),\n\t\t\t\t\t\t\t\t\t 'action' => array($action, '*'),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t'order' => array('auth_group_id DESC', 'controller DESC', 'action DESC', 'permission ASC'),\n\t\t\t\t//'limit' => '1' // <------- COMMENTED FOR DEBUG\n\t\t\t);\n\t\t\t\n\t\t\t// DEBUG: SHOW FULL ACL MATCH SET (NOT JUST FIRST RESULT)\n\t\t\tdebug($acl_model->find('all', $params_debug));\n\t\t\texit();\n\t\t}\n\t\t//////////////////////////////////////////////////////////\n\n\t\t$params = array(\n\t\t\t'fields' => array('permission'),\n\t\t\t'conditions' => array('auth_group_id' => array($group_id, '*'),\n\t\t\t\t\t\t\t\t 'controller' => array($controller, '*'),\n\t\t\t\t\t\t\t\t 'action' => array($action, '*'),\n\t\t\t\t\t\t\t\t ),\n\t\t\t'order' => array('auth_group_id DESC', 'controller DESC', 'action DESC', 'permission ASC'),\n\t\t\t'limit' => '1'\n\t\t);\n\t\t\n\t\t// TESTING: SHOW FULL ACL MATCH SET\n\t\t$result = $acl_model->find('first', $params);\n\t\t$acl_model_name = $this->settings['acl_model'];\n\t\t\n\t\t// Permit if no ACL entry found\n\t\tif (empty($result[$acl_model_name]['permission'])) {\n\t\t\t$acl_permitted = true;\n\t\t\n\t\t} else if ($result[$acl_model_name]['permission'] == 'allow') {\n\t\t\t// Permit if ACL allowed\n\t\t\t$acl_permitted = true;\n\t\t} else {\n\t\t\t$acl_permitted = false;\n\t\t}\n\t\t\n\t\t// Return boolean value of whether user-group is permitted here.\n\t\treturn $acl_permitted;\n\t}",
"private function _perform()\n {\n switch ($this->action) {\n case 'show_in_tree':\n $this->object->set('show_in_tree', true);\n break;\n\n case 'hide_in_tree':\n $this->object->set('show_in_tree', false);\n break;\n\n case 'show_children_in_tree':\n $this->object->set('hide_children_in_tree', false);\n break;\n\n case 'hide_children_in_tree':\n $this->object->set('hide_children_in_tree', true);\n break;\n\n default:\n $this->error = $this->modx->lexicon('resourcehider.error_msg_noaction');\n return false;\n }\n\n if ($this->object->save() === false) {\n $this->error = $this->modx->lexicon('resourcehider.error_msg_save');\n return false;\n }\n\n return true;\n }",
"function data_update(mixed &$target, string|array $key, callable $callable): mixed\n {\n return data_set($target, $key, $callable(data_get($target, $key)));\n }",
"public function refersToTable(): bool;",
"private function isReference($key, $value): bool\n {\n return $key === '$ref' && is_string($value);\n }",
"public static function userHasPermissionForGroupAction($group, $action)\n\t{\n\t\t// Get user roles\n\t\t$roles = self::getGroupMemberRoles(\n\t\t\t\\User::get('id'),\n\t\t\t$group->get('gidNumber')\n\t\t);\n\n\t\t// Check to see if any of our roles for user has permission for action\n\t\tforeach ($roles as $role)\n\t\t{\n\t\t\t$permissions = json_decode($role['permissions']);\n\t\t\t$permissions = (is_object($permissions)) ? $permissions : new \\stdClass;\n\t\t\tif (property_exists($permissions, $action) && $permissions->$action == 1)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function is_reference_in_table($field, $table, $id)\n{\n $CI =& get_instance();\n $CI->db->where($field, $id);\n $row = $CI->db->get($table)->row();\n if ($row) {\n return true;\n }\n\n return false;\n}",
"abstract public function testInvokeOnNonexistentModel();",
"function MyMod_Search_Var_Access($data)\n {\n $res=True;\n if (!empty($this->ItemData[ $data ][ \"SearchAccessMethod\" ]))\n {\n $method=$this->ItemData[ $data ][ \"SearchAccessMethod\" ];\n $res=$this->$method($data);\n }\n\n return $res;\n }",
"public function testProjectAssignmentsRead()\n {\n }",
"function DB_test_data()\n{\n\n $results = DB_save_curMonth_outcome();\n if ($results != true) return false;\n $results = DB_fill_history();\n if ($results != true) return false;\n DB_empty_curMonth_tables();\n\n}",
"protected function _isReference($name) {\r\n \treturn array_key_exists($name, $this->_referenceMap);\r\n }",
"abstract public function testInvokeOnExistingModelWithTemplateIdent();",
"public function testPopulateWithRemoteReference()\r\n {\r\n $solid = $this->Solids->populateSolid(1);\r\n $this->assertEquals($this->Solids::FETCHING, $solid->status);\r\n }",
"public function testSetData() {\r\n $this->assertInstanceOf('PM\\Main\\Event\\Action\\Emit', $this->_action->setData(array()));\r\n $this->assertEquals(array(), $this->_action->getData());\r\n }",
"public function testDeReference3()\n {\n // dereferenced array into a string\n $str1 = '${test2}dd';\n $this->object->deReference($str1);\n }",
"public function store($data, $id, $group = null)\n\t{\n\t\t// Get the default group\n\t\t$group = ($group) ? $group : $this->_options['defaultgroup'];\n\n\t\t// Get the storage and store the cached data\n\t\t$handler = $this->_getStorage();\n\t\tif (!($handler instanceof Exception) && $this->_options['caching'])\n\t\t{\n\t\t\t$handler->_lifetime = $this->_options['lifetime'];\n\t\t\treturn $handler->store($id, $group, $data);\n\t\t}\n\t\treturn false;\n\t}",
"function checkWriteDependencies($reqdata, $curdata = null) {\n // Make sure the Group exists.\n \n $args = array();\n $args['conditions']['CoGroup.id'] = $reqdata['CoGroupMember']['co_group_id'];\n $args['contain'] = false;\n $g = $this->CoGroupMember->CoGroup->find('first', $args);\n \n if(empty($g)) {\n if($this->request->is('restful')) {\n $this->Api->restResultHeader(403, \"CoGroup Does Not Exist\");\n } else {\n $this->Flash->set(_txt('er.gr.nf', array($reqdata['CoGroupMember']['co_group_id'])), array('key' => 'error'));\n $this->performRedirect();\n }\n return false;\n }\n \n // Make sure this is not an automatic group.\n if(isset($g['CoGroup']['auto']) && $g['CoGroup']['auto']) {\n if($this->request->is('restful')) {\n $this->Api->restResultHeader(403, \"Memberships in automatic groups can not be edited\");\n } else {\n $this->Flash->set(_txt('er.gr.auto.edit'), array('key' => 'error'));\n $this->performRedirect();\n }\n return false;\n }\n\n // Make sure the CO Person exists.\n \n $args = array();\n $args['conditions']['CoPerson.id'] = $reqdata['CoGroupMember']['co_person_id'];\n $args['contain'] = false;\n $p = $this->CoGroupMember->CoPerson->find('first', $args);\n \n if(empty($p)) {\n if($this->request->is('restful')) {\n $this->Api->restResultHeader(403, \"CoPerson Does Not Exist\");\n } else {\n $this->Flash->set(_txt('er.cop.nf', array($reqdata['CoGroupMember']['co_person_id'])), array('key' => 'error'));\n $this->performRedirect();\n }\n\n return false;\n }\n \n if($this->action == 'add') {\n // Make sure the CO Person Role isn't already in the Group.\n \n $args = array();\n $args['conditions']['CoGroupMember.co_group_id'] = $reqdata['CoGroupMember']['co_group_id'];\n $args['conditions']['CoGroupMember.co_person_id'] = $reqdata['CoGroupMember']['co_person_id'];\n $args['contain'] = false;\n $x = $this->CoGroupMember->find('all', $args);\n \n if(!empty($x)) {\n if($this->request->is('restful')) {\n $this->Api->restResultHeader(403, \"CoPerson Already Member\");\n } else {\n $this->Flash->set(_txt('er.grm.already', array($reqdata['CoGroupMember']['co_person_id'],\n $reqdata['CoGroupMember']['co_group_id'])),\n array('key' => 'error'));\n $this->performRedirect();\n }\n \n return false;\n }\n }\n \n // XXX We don't check that the CO Person is actually in the CO... should we?\n \n return true;\n }",
"public function testSavedVsFetched()\n {\n // open a file for add.\n $file = new File;\n $file->setFilespec('//depot/test-file')\n ->add();\n\n // create a job.\n $job = new Job;\n $job->set('Description', 'fix something')\n ->save();\n\n // save a change with a file and a job.\n $change = new Change;\n $change->setDescription(\"a change with a file and a job.\\n\")\n ->setFiles(array($file->getFilespec()))\n ->setJobs(array($job->getId()))\n ->save();\n\n $fetched = Change::fetch($change->getId());\n\n $types = array('Id', 'Date', 'User', 'Status', 'Description', 'JobStatus', 'Jobs');\n foreach ($types as $type) {\n $method = \"get$type\";\n $this->assertSame($fetched->$method(), $change->$method(), \"Expect matching $type.\");\n }\n }",
"public function check_for_references ( $referenced_table_name , $_params = array() )\n\t{\n\t\t//----------------------------------\n\t\t// Fetching reference information\n\t\t//----------------------------------\n\n\t\t$this->cur_query = array(\n\t\t\t\t'do' => \"select\",\n\t\t\t\t'fields' => array( \"table_name\" , \"column_name\" , \"referenced_column_name\"),\n\t\t\t\t'table' => array( \"information_schema.KEY_COLUMN_USAGE\" ),\n\t\t\t\t'where' => array(\n\t\t\t\t\t\tarray( 'table_schema = ' . $this->quote( $this->Registry->config['sql']['dbname'] ) ),\n\t\t\t\t\t\tarray( 'referenced_table_name = ' . $this->quote( $referenced_table_name ) ),\n\t\t\t\t\t)\n\t\t\t);\n\t\t$reference_information = $this->simple_exec_query();\n\n\t\t//----------------------------------------\n\t\t// Fetching referenced data statistics\n\t\t//----------------------------------------\n\n\t\tif ( !empty( $_params ) and $_params['_do_count'] === true and !empty( $_params['referenced_column_name'] ) and !empty( $_params['value_to_check'] ) )\n\t\t{\n\t\t\t$_data_statistics = array();\n\t\t\tforeach ( $reference_information as $_r )\n\t\t\t{\n\t\t\t\tif ( $_r['referenced_column_name'] != $_params['referenced_column_name'] )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->cur_query = array(\n\t\t\t\t\t\t'do' => \"select_one\",\n\t\t\t\t\t\t'fields' => array( new Zend_Db_Expr( \"count(*)\" ) ),\n\t\t\t\t\t\t'table' => $_r['table_name'],\n\t\t\t\t\t\t'where' => $_r['table_name'] . \".\" . $_r['column_name'] . \"=\" .\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tis_int( $_params['value_to_check'] )\n\t\t\t\t\t\t\t\t?\n\t\t\t\t\t\t\t\t$this->quote( $_params['value_to_check'], \"INTEGER\" )\n\t\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t\t$this->quote( $_params['value_to_check'] )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t$_data_statistics[ $_r['table_name'] ] = $this->simple_exec_query();\n\t\t\t}\n\t\t}\n\n\t\t//----------\n\t\t// Return\n\t\t//----------\n\n\t\treturn array( 'reference_information' => $reference_information, '_data_statistics' => $_data_statistics );\n\t}",
"public function testAssignTask()\n {\n // workflow, rule, action and object\n $this->task = factory(TaskEloquent::class)->create([\n 'user_id' => null,\n 'person_id' => null,\n ]);\n\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_ASSIGN,\n 'target_class' => '',\n 'target_field' => '',\n 'value' => '',\n 'task_id' =>$this->task->getKey(),\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n\n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'assign task to user',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $this->task->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function testIndexGroupActionPostSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => ['2', '3']\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$this->checkFlashMessage(__('Processing of selected tasks put in queue...'));\n\t}",
"protected function checkValue($data, DDefinable $definable = null)\n {\n $result = parent::checkValue($data, $definable);\n $user = DAuthorisationManager::getUser();\n $fieldName = $this->getName();\n if (isset($definable->originalData[ $fieldName ])) {\n foreach ($definable->getFieldValue($fieldName) as $child) {\n /* @var $child DChild */\n $result->merge($child->canSave($user));\n }\n }\n\n return $result;\n }",
"function testGetForeignCol1() \n {\n print \"\\n\" . \">testGetForeignCol1\";\n $db =& $this->db;\n $foreign_col = $db->getForeignCol();\n $this->assertEquals($foreign_col, $this->foreign_col);\n }",
"function replace( $id, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( $this->get( $id, $group ) === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->set( $id, $data, $group, $expire );\n\t}",
"public function testIsReference($identifier, $expected)\n {\n $bitwiseAnd = $this->getTargetToken($identifier, T_BITWISE_AND);\n $result = self::$phpcsFile->isReference($bitwiseAnd);\n $this->assertSame($expected, $result);\n\n }",
"function verifyCaller( $vars )\n{\nglobal $db;\n\n\n\n}",
"public function hasReferenceId(){\n return $this->_has(1);\n }",
"public function hasReferenceId(){\n return $this->_has(1);\n }"
] | [
"0.55856687",
"0.5303218",
"0.5226912",
"0.5214344",
"0.5114084",
"0.510651",
"0.50734234",
"0.50573486",
"0.49922308",
"0.49728733",
"0.49337897",
"0.4901503",
"0.4877171",
"0.48696864",
"0.48554236",
"0.48498982",
"0.48407695",
"0.482481",
"0.47914854",
"0.4770309",
"0.46481895",
"0.46301314",
"0.4607268",
"0.46048322",
"0.46020687",
"0.4582351",
"0.4560912",
"0.45591438",
"0.45417604",
"0.45084423",
"0.44994846",
"0.4484963",
"0.4481852",
"0.44775862",
"0.44709784",
"0.4464222",
"0.44549996",
"0.44549704",
"0.44440424",
"0.44436595",
"0.44338953",
"0.44334954",
"0.4427523",
"0.4415842",
"0.44128594",
"0.43974432",
"0.4394677",
"0.43936753",
"0.4391158",
"0.43750215",
"0.4371869",
"0.4370398",
"0.43661803",
"0.4363171",
"0.43602973",
"0.4340205",
"0.4338941",
"0.4338131",
"0.43365932",
"0.43360567",
"0.4334805",
"0.4323769",
"0.43177825",
"0.43177536",
"0.43174052",
"0.43170398",
"0.43053725",
"0.43037826",
"0.43029428",
"0.42920753",
"0.42918703",
"0.429065",
"0.42902854",
"0.42896175",
"0.42874312",
"0.42873454",
"0.4282437",
"0.42788234",
"0.42776772",
"0.42739308",
"0.42699468",
"0.42672586",
"0.4266289",
"0.42658567",
"0.426577",
"0.42625323",
"0.42590356",
"0.4259033",
"0.4256714",
"0.42561126",
"0.42523453",
"0.42497155",
"0.42496628",
"0.42490512",
"0.42399943",
"0.42372212",
"0.42280138",
"0.42255276",
"0.42170483",
"0.42170483"
] | 0.56405944 | 0 |
Tests an action group with mismatching args. | public function testExceptionOnMissingActions()
{
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$this->expectException(TestReferenceException::class);
$this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');
$actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testExceptionOnMissingArguments()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_LOG_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Log' => [\n\t\t\t\t\t\t\t'id' => '1'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => '2'\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }",
"private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"#[@test]\n public function doesMatch_should_return_false_if_args_are_unequal() {\n $this->sut->setArguments(array('1', 2, 3.0, '4'));\n\n $this->assertFalse($this->sut->doesMatchArgs(array('x', 2, 3.0, '4')));\n }",
"function failUnlessExtensionArgs($expected_args)\n {\n $expected_args['mode'] = $this->msg->mode;\n $this->assertEquals($expected_args, $this->msg->getExtensionArgs());\n }",
"private function _hasAllArguments()\n {\n $errors = [];\n foreach ($this->action->args as $key => $val) {\n if (!isset($this->args[$key])) {\n $errors[] = $key;\n }\n }\n\n return $errors;\n }",
"public function assertNotAction($action, $message = '') {\r\n\t\t$this->_incrementAssertionCount();\r\n\t\t$selectedAction = $this->_serviceManager->getState()->getRoute()->getAction();\n\t\tif ($action == $selectedAction) {\r\n\t\t\t$msg = sprintf('Failed asserting last action used <\"%s\"> was NOT \"%s\"', $selectedAction, $action);\r\n\t\t\tif (!empty($message)) {\r\n\t\t\t\t$msg = $message . \"\\n\" . $msg;\r\n\t\t\t}\r\n\t\t\t$this->fail($msg);\r\n\t\t}\r\n\t}",
"public function testGetNameFail() {\r\n $this->_action->getName();\r\n }",
"public function testDispatchAction() {\n\t\ttry {\n\t\t\t$this->object->dispatchAction(null); // wrong action name\n\t\t\t$this->object->dispatchAction('noAction'); // wrong action name\n\t\t\t$this->object->dispatchAction('_actionPseudoPrivate'); // underscored private action\n\t\t\t$this->object->dispatchAction('actionProtected'); // protected action\n\t\t\t$this->object->dispatchAction('actionPrivate'); // private action\n\t\t\t$this->object->dispatchAction('dispatchAction'); // method from parent\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs'));\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs', ['foo', 'bar']));\n\t\t$this->assertEquals(125, $this->object->dispatchAction('actionWithArgs'));\n\t\t$this->assertEquals(555, $this->object->dispatchAction('actionWithArgs', [505, 50]));\n\t\t$this->assertEquals(335, $this->object->dispatchAction('actionWithArgs', [335]));\n\t\t$this->assertEquals(0, $this->object->dispatchAction('actionWithArgs', ['foo', 'bar']));\n\t}",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function testDispatchOmittedArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/omitted-args/foo'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }",
"public function testManageUsersThrowsExceptionForInvalidOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation not-an-op when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"not-an-op\"));\n }",
"public function testMergeActionsException()\n {\n $testActionMergeUtil = new ActionMergeUtil(null, null);\n\n $actionObject = new ActionObject('fakeAction', 'comment', [\n 'userInput' => '{{someEntity.entity}}'\n ]);\n\n $this->expectExceptionMessage(\"Could not resolve entity reference \\\"{{someEntity.entity}}\\\" \" .\n \"in Action with stepKey \\\"fakeAction\\\".\\n\" .\n \"Exception occurred parsing action at StepKey \\\"fakeAction\\\"\");\n\n $testActionMergeUtil->resolveActionSteps([\"merge123\" => $actionObject]);\n }",
"public function requireAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return;\n }\n }\n\n $this->sendJsonResponse(false, 'Invalid Action!');\n die;\n }",
"public function testAddGroupPermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group_permission();\n }",
"public function testAddGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group();\n }",
"public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }",
"public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}",
"public function testManageUsersThrowsExceptionForEmptyOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"\"));\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"public function testUpdateGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_update_group();\n }",
"public function testRemoveGroupPermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_remove_group_permission();\n }",
"private function verify_action_params( $subscription ){\n if( empty( $subscription->id ) )\n return false;\n\n $plan = pms_get_subscription_plan( $subscription->subscription_plan_id );\n\n if( $plan->type != 'group' )\n return false;\n\n return true;\n }",
"public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {}",
"public function testGetIdentifierTypesSpecificationWithInvalidGroupName(): void\n {\n $this->expectException(Exception::class);\n $this->expectExceptionMessageMatches('~file.+was not found~i');\n\n $this->instance::getIdentifierTypesSpecification('foo bar');\n }",
"public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }",
"public function test_admin_delete_all_user_actions_with_not_existent_user_id() {\n\n // Generate allowed actions\n factory(\\App\\UserAction::class, 3)->create(['user_id' => $this->user->id]);\n\n // Generate info actions\n factory(\\App\\UserAction::class, 'info', 4)->create(['user_id' => $this->user->id]);\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/' . rand(1000, 9999) . '/delete-actions/all')\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.user_not_found')\n ]);\n }",
"public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }",
"public function testGetActionMethodForInvalidAction()\n {\n $application = new BasicTestApplication(FilePath::parse('/var/www/'));\n $request = new BasicTestRequest(Url::parse('http://www.domain.com/'), new Method('GET'));\n $response = new BasicTestResponse();\n $controller = new BasicTestController();\n $controller->processRequest($application, $request, $response, 'foo', []);\n\n self::assertNull($controller->getActionMethod());\n }",
"public function testDeleteNonExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 5694,\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"#[@test]\n public function doesMatch_should_return_false_on_differentTypes() {\n $this->sut->setArguments(array('1'));\n\n $this->assertFalse($this->sut->doesMatchArgs(array(1)));\n }",
"public function invalidActionParams($action)\n\t{\n $methodName = 'action' . $action->id;\n if(method_exists($this, $methodName))\n {\n $params = $this->getActionParams();\n $method = new ReflectionMethod($this, $methodName);\n foreach($method->getParameters() as $i => $param)\n {\n $name = $param->getName();\n if(!isset($params[$name]) && !$param->isDefaultValueAvailable())\n {\n Response::badRequest(Yii::t('error', 'Invalid parameters {attribute}', array('{attribute}' => $name)));\n }\n }\n }\n Response::badRequest(Yii::t('yii', 'Your request is invalid.'));\n\t}",
"public function hasProperArgumentName(): void\n {\n $filter = new RestrictByTypeFilter(RestrictByTypeFilter::MUNICIPALITY_NAME);\n\n $this->assertEquals('type', $filter->name());\n }",
"public function cantSeeFailNow() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\ConditionalAssertion('dontSeeFailNow', func_get_args()));\n }",
"public function test_remove_all_actions() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n yourls_remove_all_actions( $hook );\n $this->assertFalse( yourls_has_action( $hook ) );\n }",
"public function test_custom_edit_capability_and_custom_view_capability() {\n $this->validate_all_role_assignment_combinations('', '');\n }",
"public function testDispatchErrorMissingArg()\n {\n $this->expectException(ResourceNotFoundException::class);\n\n $this->uut->dispatch($this->buildRequest('/missing-arg'));\n }",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"final public function check_args(array $req, array $args) {\n\t\t$diff = \\array_diff($req, \\array_keys($args));\n\t\tif (count($diff) === 0) { return; }\n\n\t\tthrow new APIException(\n\t\t\tHTTPStatus::INTERNAL_SERVER_ERROR,\n\t\t\t\"Missing arguments \".implode(', ', $diff).\n\t\t\t\" for API module '\".get_class($this).\"'.\"\n\t\t);\n\t}",
"public function assertFunctionNotCalledWith($name, array $args)\n\t{\n\t\tif ($method = $this->getFunctionUnderTest($name) and $method->wasCalledWith($args))\n\t\t{\n\t\t\t$message = 'Expected [' . $name . '] not to be called with [' . join($args, ', ') . '].';\n\t\t\t$this->fail($message);\n\t\t}\n\t}",
"function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }",
"public function dontSeeFailNow() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Assertion('dontSeeFailNow', func_get_args()));\n }",
"public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }",
"public function testDeleteUnassignedGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 1,\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"public function invalid_action_message() {\n\t\tadd_settings_error( self::POST_ACTION_ID, 'invalid_action', __( 'Invalid action.', 'autowpdb-example-plugin' ) );\n\t}",
"function testGetNotReviewed()\n {\n $events = $this->GroupEvent->getNotReviewed(1);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), array(1, 2));\n\n //Test invalid event\n $events = $this->GroupEvent->getNotReviewed(999);\n $this->assertEqual(Set::extract('/GroupEvent/id', $events), null);\n }",
"public function test_get_actions() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $actions = yourls_get_actions( $hook );\n $this->assertTrue(isset($actions[10]['some_function']));\n $this->assertTrue(isset($actions[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_actions( rand_str() ) );\n }",
"public function testGroupContentRespectUnpublishedArgument() {\n $view = Views::getView('test_moderated_group_content');\n $view->setDisplay();\n\n /** @var \\Drupal\\user\\UserInterface$user1 */\n $user1 = $this->container->get('current_user')->getAccount();\n\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group1 */\n $group1 = Group::create([\n 'type' => 'default',\n 'label' => $this->randomMachineName(),\n ]);\n $group1->save();\n\n /** @var \\Drupal\\node\\Entity\\Node $node1 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node1',\n 'moderation_state' => 'draft',\n ])->save();\n $node1 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node1']\n );\n $node1 = current($node1);\n\n /** @var \\Drupal\\node\\Entity\\Node $node2 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node2',\n 'moderation_state' => 'published',\n ])->save();\n $node2 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node2']\n );\n $node2 = current($node2);\n $group1->addContent($node1, 'group_node:default');\n $group1->addContent($node2, 'group_node:default');\n $group1->addMember($user1);\n\n $view->preview();\n $this->assertEquals(0, count($view->result), 'No results when group id argument is not present.');\n $view->destroy();\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Member can see their own unpublished content.');\n\n $user2 = User::create(['name' => $this->randomString()]);\n $user2->save();\n $this->container->get('current_user')->setAccount($user2);\n\n /** @var \\Drupal\\node\\Entity\\Node $node3 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node3',\n 'moderation_state' => 'draft',\n ])->save();\n $node3 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node3']\n );\n $node3 = current($node3);\n $group1->addContent($node3, 'group_node:default');\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Outsider can see their own unpublished content.');\n $view->destroy();\n\n $this->container->get('current_user')->setAccount($user1);\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(2, count($view->result), 'Member can see any (own + outsiders) unpublished content.');\n $view->destroy();\n\n }",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"public function isMenuItemValidBlankCallExpectFalse() {}",
"public function testExecuteWithNonExistingCustomerGroup()\n {\n $customerGroupId = 1;\n $this->company->expects($this->atLeastOnce())->method('getCustomerGroupId')->willReturn($customerGroupId);\n $this->customerGroupRepository->expects($this->once())->method('getById')->with($customerGroupId)\n ->willThrowException(new \\Magento\\Framework\\Exception\\NoSuchEntityException());\n $this->customerGroup->execute();\n }",
"#[@test]\n public function argument_count_should_be_considered_when_matching_args() {\n $this->sut->setArguments(array(1, 2));\n $this->assertTrue($this->sut->doesMatchArgs(array(1, 2)));\n $this->assertFalse($this->sut->doesMatchArgs(array()));\n $this->assertFalse($this->sut->doesMatchArgs(array(1)));\n $this->assertFalse($this->sut->doesMatchArgs(array(1, 2, 3)));\n }",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"function check_actions($observed_fields, $pas, $start_field_set = null) // {{{\n{\n // Set initial field set to empty if not given\n if ($start_field_set === null)\n $start_field_set = new FieldSet();\n else\n $start_field_set = $start_field_set->getClone();\n // Apply actions\n $pas->applyAll($start_field_set);\n // Compare result with extracted field set\n $diff = $observed_fields->differenceWith($start_field_set);\n return $diff;\n}",
"public function testInvalidConfig()\n {\n $config = array(\n 'invalidArg' => TRUE,\n );\n\n $result = self::processFilter($config, self::$request);\n }",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"function projectsNotInGroup() {\n\n\tglobal $db;\n\treturn $db->projectsNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function testSummary() {\n $this->assertEquals('Unblock a user', $this->action->summary());\n }",
"public function exempt($action): bool;",
"public function testNotCorrectAssignuser() \r\n {\r\n // expect_not($model->assignuser());\r\n // expect_that($model->getErrors('id'));\r\n // expect_that($model->getErrors('authorRole'));\r\n \r\n }",
"public function testRejectDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}",
"public function test_admin_delete_all_user_actions_with_not_existent_user_id_in_string_format() {\n\n // Generate allowed actions\n factory(\\App\\UserAction::class, 3)->create(['user_id' => $this->user->id]);\n\n // Generate not allowed actions\n factory(\\App\\UserAction::class, 'not_allowed', 4)->create(['user_id' => $this->user->id]);\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/string' . rand() . '/delete-actions/all')\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.user_not_found')\n ]);\n }",
"public function testNotInArray() {\n\t\t$array = array(\"a\", \"b\", \"c\");\n\t\t$this->assertFalse(permissionInPermissions($array, \"d\"));\n\t}",
"protected function mag($action, array $args) {\n\t\treturn isset(static::$groepSoorten[$action]);\n\t}",
"public function is_group( $args, $assoc_args = array() ) {\n\t\t$alias = $args[0];\n\n\t\t$aliases = WP_CLI::get_runner()->aliases;\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\t// how do we know the alias is a group?\n\t\t// + array keys are numeric\n\t\t// + array values begin with '@'\n\n\t\t$first_item = $aliases[ $alias ];\n\t\t$first_item_key = key( $first_item );\n\t\t$first_item_value = $first_item[ $first_item_key ];\n\n\t\tif ( is_numeric( $first_item_key ) && substr( $first_item_value, 0, 1 ) === '@' ) {\n\t\t\tWP_CLI::halt( 0 );\n\t\t}\n\t\tWP_CLI::halt( 1 );\n\n\t}",
"public function testStepKeyReplacementFilteredIn()\n {\n $createStepKey = \"createDataStepKey\";\n $updateStepKey = \"updateDataStepKey\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject(\n $updateStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[6],\n ['selector' => 'value']\n ),\n new ActionObject(\n $createStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[7],\n ['selector' => 'value']\n )\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertContains($updateStepKey, $result);\n $this->assertContains($createStepKey, $result);\n $this->assertCount(2, $result);\n }",
"public function testInvalidModule(): void\n {\n $result = $this->check->run('Users1');\n $result = $this->check->getErrors();\n $this->assertTrue(is_array($result), \"getErrors() returned a non-array result\");\n }",
"function tx_notusergroup($cmd){\r\n\t\t$cmd = t3lib_div::trimExplode('|',$cmd,true);\r\n\t\t$gr_list = $GLOBALS['TSFE']->gr_list;\r\n\t\tforeach( $cmd as $grp) {\r\n\t\t\tif(t3lib_div::inList($gr_list,$grp)){\r\n\t\t\t\treturn false; // matched a group so condition is false\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true; // no Group Found so return true;\r\n\t}",
"public function cli_validateArgs() {}",
"public function testAddGroupUserFailsIfLackingUsers(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group_user();\n }",
"public function testGetResetPasswordPageInvalidArgumentError()\n\t{\n\t\t$this->call('orchestra::forgot@reset', array('hello world', ''));\n\t\t$this->assertResponseNotFound();\n\t}",
"function isActionAllowed($controller_id = null, $action_id = null, $event_id = null, $model_id = null, $group_id = null)\n {\n\t\t$actionAllowed = parent::isActionAllowed($controller_id, $action_id, $event_id, $model_id, $group_id);\n\n\t\t$hikeStatus = EventNames::model()->getStatusHike($event_id);\n\t\t$rolPlayer = DeelnemersEvent::model()->getRolOfPlayer($event_id, Yii::app()->user->id);\n\t\treturn $actionAllowed;\n\t}",
"public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }",
"public function testCanRegisterActionWithUnknownAccessLevel() {\n\t\t_elgg_services()->logger->disable();\n\t\t$this->assertTrue($this->actions->register('test/output', \"$this->actionsDir/output.php\", 'pblc'));\n\t\t$logged = _elgg_services()->logger->enable();\n\n\t\t$this->assertEquals([\n\t\t\t[\n\t\t\t\t'message' => 'Unrecognized value \\'pblc\\' for $access in Elgg\\\\ActionsService::register',\n\t\t\t\t'level' => Logger::ERROR,\n\t\t\t]\n\t\t\t\t], $logged);\n\n\t\t$actions = $this->actions->getAllActions();\n\t\t$this->assertArrayHasKey('test/output', $actions);\n\t\t$this->assertEquals([\n\t\t\t'file' => \"$this->actionsDir/output.php\",\n\t\t\t'access' => 'admin',\n\t\t\t\t], $actions['test/output']);\n\t}",
"public function testGetThrowExceptionIfProvidedGroupDoesNotExist()\n {\n $groupId = 42;\n $groupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $this->groupFactoryMock->expects($this->once())->method('create')->willReturn($groupMock);\n $this->groupResourceMock->expects($this->once())->method('load')->with($groupMock, $groupId);\n $groupMock->expects($this->once())->method('getId')->willReturn(false);\n $this->assertEquals($groupMock, $this->model->get($groupId));\n }",
"public function testDispatchErrorNoAction()\n {\n $this->expectException(ResourceNotFoundException::class);\n\n $this->uut->dispatch($this->buildRequest('/unknown-action'));\n }",
"public function testRemoveGroupUserFailsIfLackingUsers(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_remove_group_user();\n }",
"public function hasPermission($action = \"\");",
"public function setExpectedAction($action);",
"public function testBuildUrlMissingArgs()\n {\n $path = $this->uut->buildPath('omitted-args');\n $this->assertEquals('/omitted-args/{foo}/bar', $path);\n }",
"public function isButtonValidBrokenSetupInvalidButtonAsSecondParametersGivenExpectFalse() {}",
"public function testDeleteExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 3,\n ]);\n $response->assertSessionHasNoErrors();\n }",
"public function checkActions() {\n if (isset($this->request_json->action)) {\n\n if (is_array($this->request_json->action)) {\n $this->request_json->action = array_pop($this->request_json->action);\n }\n $vars = array('data' => (array) $this->request_json);\n $this->hook('action_' . $this->request_json->action, $vars);\n exit;\n }\n }",
"function test_checkMode_newArgs()\n {\n $result = $this->bax->_checkMode($this->bax->_newArgs());\n $this->assertTrue($result === true);\n }",
"public function assertAction($action, $message = '') {\r\n\t\t$this->_incrementAssertionCount();\n\t\t$selectedAction = $this->_serviceManager->getState()->getRoute()->getAction();\r\n\t\tif ($action != $selectedAction) {\r\n\t\t\t$msg = sprintf('Failed asserting last action used <\"%s\"> was \"%s\"', $selectedAction, $action);\r\n\t\t\tif (!empty($message)) {\r\n\t\t\t\t$msg = $message . \"\\n\" . $msg;\r\n\t\t\t}\r\n\t\t\t$this->fail($msg);\r\n\t\t}\r\n\t}",
"protected function wrong_arguments() {\n\t\t\twp_die();\n\t\t}",
"public function test_add_action_class_and_array() {\n $hook = rand_str();\n\n $this->assertFalse( yourls_has_action( $hook ) );\n\n yourls_add_action( $hook, array( 'Class', 'Method' ) );\n $this->assertSame( 10, yourls_has_action( $hook, array( 'Class', 'Method' ) ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'Class::Method' ) );\n\t}",
"public function testGetInvalidAccessByAccessName() {\n\t\t// grab a user id that exceeds the maximum allowable user id\n\t\t$access = Access::getAccessByAccessName($this->getPDO(), \"nobody was ever given this access\");\n\t\t$this->assertCount(0, $access);\n\t}",
"private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}",
"public function test_remove_all_actions_random_prio() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n yourls_remove_all_actions( $hook );\n $this->assertFalse( yourls_has_action( $hook ) );\n }",
"public function testGroups(): void\n {\n $process = $this->phpbench(\n 'run --group=do_nothing --dump --progress=none benchmarks/set1/BenchmarkBench.php'\n );\n\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertXPathCount(1, $output, '//subject');\n }",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function testMissingResourcesAreNotAllowed(): void\n {\n $items = Category::factory()->count(1)->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.groups', [100])\n ->emit('save')\n ->assertHasErrors(['editValues.groups.*'])\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'error';\n });\n\n $this->assertEquals(0, $items[0]->groups()->count());\n }"
] | [
"0.6711915",
"0.5943424",
"0.5873942",
"0.58558935",
"0.58453363",
"0.56876296",
"0.56719136",
"0.56472015",
"0.5643773",
"0.5631943",
"0.55989444",
"0.5559942",
"0.5527703",
"0.5479974",
"0.5437495",
"0.5410346",
"0.5408815",
"0.5405819",
"0.54036486",
"0.53920025",
"0.537265",
"0.5343249",
"0.5336191",
"0.53361213",
"0.53322333",
"0.5308536",
"0.5298363",
"0.5294572",
"0.5291666",
"0.5252779",
"0.5245501",
"0.52428055",
"0.5233679",
"0.5232941",
"0.52266175",
"0.521964",
"0.5204029",
"0.51649207",
"0.5153005",
"0.51233745",
"0.5118381",
"0.5098897",
"0.50842273",
"0.50799286",
"0.5076424",
"0.50648403",
"0.5063459",
"0.5058203",
"0.5050617",
"0.50482786",
"0.50471836",
"0.50202",
"0.50123394",
"0.5005748",
"0.5004965",
"0.5001015",
"0.49977157",
"0.49958336",
"0.4995208",
"0.49943143",
"0.4991586",
"0.49896273",
"0.49836892",
"0.49762058",
"0.4973223",
"0.4954997",
"0.49521858",
"0.49466774",
"0.49360147",
"0.49296412",
"0.4928435",
"0.49249715",
"0.4923137",
"0.49157414",
"0.49118024",
"0.49117783",
"0.49082828",
"0.48977348",
"0.48970512",
"0.48943952",
"0.4891711",
"0.48815104",
"0.48791274",
"0.4869549",
"0.486358",
"0.4855651",
"0.48551977",
"0.4853879",
"0.48535293",
"0.48494428",
"0.4844237",
"0.4841542",
"0.48334944",
"0.4831279",
"0.4830669",
"0.48289916",
"0.4820122",
"0.48171934",
"0.48140025",
"0.48076144"
] | 0.7050148 | 0 |
Tests an action group with missing args. | public function testExceptionOnMissingArguments()
{
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withArguments([new ArgumentObject('arg1', null, 'entity')])
->build();
$this->expectException(TestReferenceException::class);
$this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');
$actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function testDispatchOmittedArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/omitted-args/foo'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }",
"public function requireAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return;\n }\n }\n\n $this->sendJsonResponse(false, 'Invalid Action!');\n die;\n }",
"public function testDispatchAction() {\n\t\ttry {\n\t\t\t$this->object->dispatchAction(null); // wrong action name\n\t\t\t$this->object->dispatchAction('noAction'); // wrong action name\n\t\t\t$this->object->dispatchAction('_actionPseudoPrivate'); // underscored private action\n\t\t\t$this->object->dispatchAction('actionProtected'); // protected action\n\t\t\t$this->object->dispatchAction('actionPrivate'); // private action\n\t\t\t$this->object->dispatchAction('dispatchAction'); // method from parent\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs'));\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs', ['foo', 'bar']));\n\t\t$this->assertEquals(125, $this->object->dispatchAction('actionWithArgs'));\n\t\t$this->assertEquals(555, $this->object->dispatchAction('actionWithArgs', [505, 50]));\n\t\t$this->assertEquals(335, $this->object->dispatchAction('actionWithArgs', [335]));\n\t\t$this->assertEquals(0, $this->object->dispatchAction('actionWithArgs', ['foo', 'bar']));\n\t}",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }",
"public function testManageUsersThrowsExceptionForEmptyOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"\"));\n }",
"private function _hasAllArguments()\n {\n $errors = [];\n foreach ($this->action->args as $key => $val) {\n if (!isset($this->args[$key])) {\n $errors[] = $key;\n }\n }\n\n return $errors;\n }",
"public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }",
"private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}",
"public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_LOG_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }",
"public function testGetNameFail() {\r\n $this->_action->getName();\r\n }",
"public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }",
"public function testGetOrderAction(): void\n {\n $this->assertTrue(method_exists($this->stack, 'getOrderAction'));\n }",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Log' => [\n\t\t\t\t\t\t\t'id' => '1'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function test_get_actions() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $actions = yourls_get_actions( $hook );\n $this->assertTrue(isset($actions[10]['some_function']));\n $this->assertTrue(isset($actions[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_actions( rand_str() ) );\n }",
"public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => '2'\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\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }",
"public function hasPermission($action = \"\");",
"function test_init_action_is_run() {\n\t}",
"public function test_admin_delete_all_user_actions_with_not_existent_user_id() {\n\n // Generate allowed actions\n factory(\\App\\UserAction::class, 3)->create(['user_id' => $this->user->id]);\n\n // Generate info actions\n factory(\\App\\UserAction::class, 'info', 4)->create(['user_id' => $this->user->id]);\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/' . rand(1000, 9999) . '/delete-actions/all')\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.user_not_found')\n ]);\n }",
"public function testGetGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function test_init_action_added() {\n\t\t$this->assertSame( 10, has_action( 'init', 'rest_api_init' ) );\n\t}",
"public function testGroups(): void\n {\n $process = $this->phpbench(\n 'run --group=do_nothing --dump --progress=none benchmarks/set1/BenchmarkBench.php'\n );\n\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertXPathCount(1, $output, '//subject');\n }",
"private function verify_action_params( $subscription ){\n if( empty( $subscription->id ) )\n return false;\n\n $plan = pms_get_subscription_plan( $subscription->subscription_plan_id );\n\n if( $plan->type != 'group' )\n return false;\n\n return true;\n }",
"public function test_remove_all_actions() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n yourls_remove_all_actions( $hook );\n $this->assertFalse( yourls_has_action( $hook ) );\n }",
"public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}",
"public function testGetActionMethodForInvalidAction()\n {\n $application = new BasicTestApplication(FilePath::parse('/var/www/'));\n $request = new BasicTestRequest(Url::parse('http://www.domain.com/'), new Method('GET'));\n $response = new BasicTestResponse();\n $controller = new BasicTestController();\n $controller->processRequest($application, $request, $response, 'foo', []);\n\n self::assertNull($controller->getActionMethod());\n }",
"public function testDeleteUnassignedGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 1,\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"public function testAvailableGroupOperations()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function isMenuItemValidBlankCallExpectFalse() {}",
"public function testSummary() {\n $this->assertEquals('Unblock a user', $this->action->summary());\n }",
"public function testCanRegisterActionWithUnknownAccessLevel() {\n\t\t_elgg_services()->logger->disable();\n\t\t$this->assertTrue($this->actions->register('test/output', \"$this->actionsDir/output.php\", 'pblc'));\n\t\t$logged = _elgg_services()->logger->enable();\n\n\t\t$this->assertEquals([\n\t\t\t[\n\t\t\t\t'message' => 'Unrecognized value \\'pblc\\' for $access in Elgg\\\\ActionsService::register',\n\t\t\t\t'level' => Logger::ERROR,\n\t\t\t]\n\t\t\t\t], $logged);\n\n\t\t$actions = $this->actions->getAllActions();\n\t\t$this->assertArrayHasKey('test/output', $actions);\n\t\t$this->assertEquals([\n\t\t\t'file' => \"$this->actionsDir/output.php\",\n\t\t\t'access' => 'admin',\n\t\t\t\t], $actions['test/output']);\n\t}",
"function failUnlessExtensionArgs($expected_args)\n {\n $expected_args['mode'] = $this->msg->mode;\n $this->assertEquals($expected_args, $this->msg->getExtensionArgs());\n }",
"public function testDispatchErrorMissingArg()\n {\n $this->expectException(ResourceNotFoundException::class);\n\n $this->uut->dispatch($this->buildRequest('/missing-arg'));\n }",
"function perform_action($action_name, ...$args){\n global $_lms_action_arr;\n if(!empty($_lms_action_arr[$action_name])){\n $func_names = $_lms_action_arr[$action_name];\n print_r($func_names);\n foreach($func_names as $func){\n if(!empty($func)){\n //Handles the bug when a hook is not properly dequeued.\n call_user_func_array($func['name'], $args);\n }\n\n }\n }\n\n}",
"public function testDeleteNonExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 5694,\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"function isActionAllowed($controller_id = null, $action_id = null, $event_id = null, $model_id = null, $group_id = null)\n {\n\t\t$actionAllowed = parent::isActionAllowed($controller_id, $action_id, $event_id, $model_id, $group_id);\n\n\t\t$hikeStatus = EventNames::model()->getStatusHike($event_id);\n\t\t$rolPlayer = DeelnemersEvent::model()->getRolOfPlayer($event_id, Yii::app()->user->id);\n\t\treturn $actionAllowed;\n\t}",
"public function hasChildActions() {}",
"public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }",
"public function testBuildUrlMissingArgs()\n {\n $path = $this->uut->buildPath('omitted-args');\n $this->assertEquals('/omitted-args/{foo}/bar', $path);\n }",
"protected function mag($action, array $args) {\n\t\treturn isset(static::$groepSoorten[$action]);\n\t}",
"public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}",
"public function hasActions();",
"public function setExpectedAction($action);",
"public function testCallArgsEmpty()\n {\n $pattern = 'pattern';\n $controller = function () {\n return func_get_args();\n };\n $matches = array(1, 2, 3);\n $services = new Container();\n\n $route = new Route(new RoutePattern($pattern), $controller);\n $route->setMatches($matches);\n $this->assertSame([], $route->call($services));\n }",
"public function is_group( $args, $assoc_args = array() ) {\n\t\t$alias = $args[0];\n\n\t\t$aliases = WP_CLI::get_runner()->aliases;\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\t// how do we know the alias is a group?\n\t\t// + array keys are numeric\n\t\t// + array values begin with '@'\n\n\t\t$first_item = $aliases[ $alias ];\n\t\t$first_item_key = key( $first_item );\n\t\t$first_item_value = $first_item[ $first_item_key ];\n\n\t\tif ( is_numeric( $first_item_key ) && substr( $first_item_value, 0, 1 ) === '@' ) {\n\t\t\tWP_CLI::halt( 0 );\n\t\t}\n\t\tWP_CLI::halt( 1 );\n\n\t}",
"public function testDeleteExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 3,\n ]);\n $response->assertSessionHasNoErrors();\n }",
"function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }",
"public function testDispatchErrorNoAction()\n {\n $this->expectException(ResourceNotFoundException::class);\n\n $this->uut->dispatch($this->buildRequest('/unknown-action'));\n }",
"public function hasAction(string $name): bool;",
"public function checkActions() {\n if (isset($this->request_json->action)) {\n\n if (is_array($this->request_json->action)) {\n $this->request_json->action = array_pop($this->request_json->action);\n }\n $vars = array('data' => (array) $this->request_json);\n $this->hook('action_' . $this->request_json->action, $vars);\n exit;\n }\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public static function test($args = array())\n {\n }",
"public function testAddGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group();\n }",
"function executeAction($group, $action) {\n $script = $this->getScriptByGroup($group);\n \n if($script instanceof AngieApplicationUpgradeScript) {\n return $script->$action();\n } else {\n return \"Invalid group\";\n } // if\n }",
"public function checkIfCLIAccesWithPackageControllerActionAndArgumentsToleratesSpaces() {}",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"public function test_admin_delete_all_user_actions_when_user_has_no_action() {\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/' . $this->user->id . '/delete-actions/all')\n ->seeJson([\n 'success' => true,\n 'message' => trans('users_manager.user_actions_deleted')\n ])\n ->notSeeInDatabase('user_actions', [\n 'user_id' => $this->user->id\n ]);\n }",
"public function testExecuteWithNonExistingCustomerGroup()\n {\n $customerGroupId = 1;\n $this->company->expects($this->atLeastOnce())->method('getCustomerGroupId')->willReturn($customerGroupId);\n $this->customerGroupRepository->expects($this->once())->method('getById')->with($customerGroupId)\n ->willThrowException(new \\Magento\\Framework\\Exception\\NoSuchEntityException());\n $this->customerGroup->execute();\n }",
"public function test_add_action_class_and_array() {\n $hook = rand_str();\n\n $this->assertFalse( yourls_has_action( $hook ) );\n\n yourls_add_action( $hook, array( 'Class', 'Method' ) );\n $this->assertSame( 10, yourls_has_action( $hook, array( 'Class', 'Method' ) ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'Class::Method' ) );\n\t}",
"public function testFaRunWithEmptyInput()\n {\n $fa = $this->getFa();\n // Test error\n $ret = $fa->run('');\n $this->assertEquals($ret['status'], 'error');\n }",
"public function testActions() {\n // Test default actions.\n $this->assertEntity('node_publish_action', 'Publish post', 'node', []);\n $this->assertEntity('node_make_sticky_action', 'Make post sticky', 'node', []);\n $this->assertEntity('user_block_user_action', 'Block current user', 'user', []);\n $this->assertEntity('comment_publish_action', 'Publish comment', 'comment', []);\n\n // Test advanced actions.\n $this->assertEntity('unpublish_comment_containing_keyword_s_', 'Unpublish comment containing keyword(s)', 'comment', [\"keywords\" => [0 => \"drupal\"]]);\n $this->assertEntity('change_the_author_of_a_post', 'Change the author of a post', 'node', [\"owner_uid\" => \"2\"]);\n $this->assertEntity('unpublish_post_containing_keyword_s_', 'Unpublish post containing keyword(s)', 'node', [\"keywords\" => [0 => \"drupal\"]]);\n $this->assertEntity('display_a_message_to_the_user', 'Display a message to the user', 'system', [\"message\" => \"Drupal migration test\"]);\n $this->assertEntity('send_e_mail', 'Send e-mail', 'system', [\n \"recipient\" => \"[email protected]\",\n \"subject\" => \"Drupal migration test\",\n \"message\" => \"Drupal migration test\",\n ]);\n $this->assertEntity('redirect_to_url', 'Redirect to URL', 'system', [\"url\" => \"https://www.drupal.org\"]);\n\n }",
"public function testManageUsersThrowsExceptionForInvalidOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation not-an-op when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"not-an-op\"));\n }",
"public static function userHasPermissionForGroupAction($group, $action)\n\t{\n\t\t// Get user roles\n\t\t$roles = self::getGroupMemberRoles(\n\t\t\t\\User::get('id'),\n\t\t\t$group->get('gidNumber')\n\t\t);\n\n\t\t// Check to see if any of our roles for user has permission for action\n\t\tforeach ($roles as $role)\n\t\t{\n\t\t\t$permissions = json_decode($role['permissions']);\n\t\t\t$permissions = (is_object($permissions)) ? $permissions : new \\stdClass;\n\t\t\tif (property_exists($permissions, $action) && $permissions->$action == 1)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function test_remove_all_actions_random_prio() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n yourls_remove_all_actions( $hook );\n $this->assertFalse( yourls_has_action( $hook ) );\n }",
"public function testGetThrowExceptionIfProvidedGroupDoesNotExist()\n {\n $groupId = 42;\n $groupMock = $this->createMock(\\Magento\\Eav\\Model\\Entity\\Attribute\\Group::class);\n $this->groupFactoryMock->expects($this->once())->method('create')->willReturn($groupMock);\n $this->groupResourceMock->expects($this->once())->method('load')->with($groupMock, $groupId);\n $groupMock->expects($this->once())->method('getId')->willReturn(false);\n $this->assertEquals($groupMock, $this->model->get($groupId));\n }",
"public function isMenuValidBlankCallExpectFalse() {}",
"public function test_remove_only_actions_with_given_prio() {\n $hook = rand_str();\n $priorities = array();\n\n $times = mt_rand( 10, 30 );\n for ( $i = 1; $i <= $times; $i++ ) {\n $prio = mt_rand( 1, 100 );\n $priorities[] = $prio;\n yourls_add_action( $hook, rand_str(), $prio );\n }\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n\n // Pick a random number of randomly picked priorities (but not all of them)\n $priorities = array_unique( $priorities );\n $random_priorities = (array) array_rand( $priorities, mt_rand( 1, count( $priorities ) - 1 ) );\n\n // Count how many we're supposed to remove\n $removed = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n if( in_array( $prio, $random_priorities ) )\n $removed += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n // Remove the randomly picked priorities\n foreach( $random_priorities as $random_priority ) {\n yourls_remove_all_actions( $hook, $random_priority );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Count how many are left\n $remaining = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $remaining += count( $yourls_filters[ $hook ][ $prio ] );\n }\n $this->assertSame( $remaining, $times - $removed );\n }",
"public function hasProperArgumentName(): void\n {\n $filter = new RestrictByTypeFilter(RestrictByTypeFilter::MUNICIPALITY_NAME);\n\n $this->assertEquals('type', $filter->name());\n }",
"public function testAddGroupPermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group_permission();\n }",
"public function testAccessDeleteNoPermission()\n {\n $user = \\App\\User::where('permission', 0)->first();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 2,\n ]);\n $response->assertStatus(403);\n }",
"public function testGroupContentRespectUnpublishedArgument() {\n $view = Views::getView('test_moderated_group_content');\n $view->setDisplay();\n\n /** @var \\Drupal\\user\\UserInterface$user1 */\n $user1 = $this->container->get('current_user')->getAccount();\n\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group1 */\n $group1 = Group::create([\n 'type' => 'default',\n 'label' => $this->randomMachineName(),\n ]);\n $group1->save();\n\n /** @var \\Drupal\\node\\Entity\\Node $node1 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node1',\n 'moderation_state' => 'draft',\n ])->save();\n $node1 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node1']\n );\n $node1 = current($node1);\n\n /** @var \\Drupal\\node\\Entity\\Node $node2 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node2',\n 'moderation_state' => 'published',\n ])->save();\n $node2 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node2']\n );\n $node2 = current($node2);\n $group1->addContent($node1, 'group_node:default');\n $group1->addContent($node2, 'group_node:default');\n $group1->addMember($user1);\n\n $view->preview();\n $this->assertEquals(0, count($view->result), 'No results when group id argument is not present.');\n $view->destroy();\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Member can see their own unpublished content.');\n\n $user2 = User::create(['name' => $this->randomString()]);\n $user2->save();\n $this->container->get('current_user')->setAccount($user2);\n\n /** @var \\Drupal\\node\\Entity\\Node $node3 */\n Node::create([\n 'type' => 'default',\n 'title' => 'Node3',\n 'moderation_state' => 'draft',\n ])->save();\n $node3 = $this->container->get('entity_type.manager')->getStorage('node')->loadByProperties(\n ['title' => 'Node3']\n );\n $node3 = current($node3);\n $group1->addContent($node3, 'group_node:default');\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(1, count($view->result), 'Outsider can see their own unpublished content.');\n $view->destroy();\n\n $this->container->get('current_user')->setAccount($user1);\n\n $view->preview('moderated_content', [$group1->id()]);\n $this->assertEquals(2, count($view->result), 'Member can see any (own + outsiders) unpublished content.');\n $view->destroy();\n\n }",
"public function testDeleteGroupWithoutId()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => '',\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }",
"public function test_add_action_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, rand_str() );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Specific function name to test with yourls_do_action\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, 'change_one_global' );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"public function testCheckRequest(): void\n {\n $this->assertTrue(method_exists($this->stack, 'checkOrder'));\n }",
"public function testDispatchWithArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/with-args/foo/bar'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }",
"public function testFilters_noResults()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(2));\n\n $users->Auth\n ->staticExpects($this->at(2))\n ->method('user')\n ->with('id')\n ->will($this->returnValue(2));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o\");\n $this->assertEquals($this->vars['users'], array());\n }",
"public function invalidActionParams($action)\n\t{\n $methodName = 'action' . $action->id;\n if(method_exists($this, $methodName))\n {\n $params = $this->getActionParams();\n $method = new ReflectionMethod($this, $methodName);\n foreach($method->getParameters() as $i => $param)\n {\n $name = $param->getName();\n if(!isset($params[$name]) && !$param->isDefaultValueAvailable())\n {\n Response::badRequest(Yii::t('error', 'Invalid parameters {attribute}', array('{attribute}' => $name)));\n }\n }\n }\n Response::badRequest(Yii::t('yii', 'Your request is invalid.'));\n\t}",
"public function testGetName() {\r\n $action = $this->_action->setName('name');\r\n $this->assertEquals('name', $action->getName());\r\n }",
"public function testNonGroupingIntegration() {\n $this->markTestSkipped('Not yet implemented.');\n }",
"public function testRunAction() {\n\t\t$this->object->config->foo = 'bar';\n\n\t\t$this->assertEquals('bar', $this->object->config->foo);\n\t\t$this->assertArrayNotHasKey('test', $this->object->config->get());\n\n\t\t$this->object->runAction(new ActionFixture());\n\n\t\t$this->assertNotEquals('bar', $this->object->config->foo);\n\t\t$this->assertEquals('baz', $this->object->config->foo);\n\t\t$this->assertArrayHasKey('test', $this->object->config->get());\n\t}",
"public function testGetRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testFilters_byUserNameOrGroupId()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 2); \n }",
"public function testDispatchErrorRouteAction()\n {\n $this->expectException(IncompleteRouteException::class);\n\n $this->uut->dispatch($this->buildRequest('/missing-action'));\n }",
"public function testGetStepsWithOuterScopePersistence()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']);\n }",
"#[@test]\n public function argument_count_should_be_considered_when_matching_args() {\n $this->sut->setArguments(array(1, 2));\n $this->assertTrue($this->sut->doesMatchArgs(array(1, 2)));\n $this->assertFalse($this->sut->doesMatchArgs(array()));\n $this->assertFalse($this->sut->doesMatchArgs(array(1)));\n $this->assertFalse($this->sut->doesMatchArgs(array(1, 2, 3)));\n }",
"function hasAction()\n {\n return !is_null($this->_action);\n }"
] | [
"0.7223563",
"0.6607539",
"0.6257137",
"0.6115341",
"0.57558686",
"0.5725823",
"0.56694883",
"0.5650369",
"0.5647196",
"0.5646793",
"0.5584209",
"0.557697",
"0.5561265",
"0.5554617",
"0.54801255",
"0.54650414",
"0.5450285",
"0.54251176",
"0.54036295",
"0.53963804",
"0.53802073",
"0.53635657",
"0.53484327",
"0.5343135",
"0.5340358",
"0.5338949",
"0.5308714",
"0.5307515",
"0.52960074",
"0.5293828",
"0.52915215",
"0.5289037",
"0.5277928",
"0.52613944",
"0.523381",
"0.5208756",
"0.5185398",
"0.51764596",
"0.5173648",
"0.51623076",
"0.51619303",
"0.51616895",
"0.5156339",
"0.5126515",
"0.5106801",
"0.5076904",
"0.5076192",
"0.50752604",
"0.50649977",
"0.5060655",
"0.5044334",
"0.5039889",
"0.5034351",
"0.5020301",
"0.5013272",
"0.5010802",
"0.50100106",
"0.50091064",
"0.5007791",
"0.4997572",
"0.49911362",
"0.49906868",
"0.49906868",
"0.49892768",
"0.49892768",
"0.49836385",
"0.49813253",
"0.4980669",
"0.4980089",
"0.49800763",
"0.49705115",
"0.4965225",
"0.4964627",
"0.49606165",
"0.4959524",
"0.49509633",
"0.4946516",
"0.49450693",
"0.493303",
"0.49258232",
"0.49246365",
"0.49228916",
"0.4920966",
"0.49168032",
"0.49155593",
"0.4913522",
"0.49069887",
"0.48998687",
"0.48924193",
"0.4885799",
"0.48842314",
"0.4878966",
"0.4877726",
"0.4877596",
"0.4877062",
"0.48732665",
"0.48715055",
"0.48638132",
"0.4863763",
"0.48522073"
] | 0.67242515 | 1 |
Tests the stepKey replacement with "stepKey + invocationKey" process filter Specific to actions that make it past a "require stepKey replacement" filter | public function testStepKeyReplacementFilteredIn()
{
$createStepKey = "createDataStepKey";
$updateStepKey = "updateDataStepKey";
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([
new ActionObject(
$updateStepKey,
ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[6],
['selector' => 'value']
),
new ActionObject(
$createStepKey,
ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[7],
['selector' => 'value']
)
])
->build();
$result = $actionGroupUnderTest->extractStepKeys();
$this->assertContains($updateStepKey, $result);
$this->assertContains($createStepKey, $result);
$this->assertCount(2, $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }",
"protected function executeSpecificStep() {}",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"function view_key_replace_arguments($values, &$handler) {\n foreach ($values as $value) {\n if (strpos($value, '__arg:') === 0) {\n // Get the argument and make sure its actually on the view still.\n $arg_id = drupal_substr($value, drupal_strlen('__arg:'));\n if (isset($handler->view->argument[$arg_id]) && $handler->view->argument[$arg_id]->argument_validated) {\n // Argument is there and ready to go!\n $argument = clone($handler->view->argument[$arg_id]);\n $arg_value = $argument->get_value();\n // Might need to split this up.\n if (!empty($argument->options['break_phrase'])) {\n views_break_phrase($argument->get_value(), $argument);\n foreach ($argument->value as $new_val) {\n $values[$new_val] = $new_val;\n }\n }\n else {\n $new_val = $argument->get_value();\n $values[$new_val] = $new_val;\n }\n }\n // Always remove the dummy argument value.\n unset($values[$value]);\n }\n }\n\n return $values;\n }",
"public function testSetGetArgumentKeyValueSeparator()\n {\n $this->ruleParse->setArgumentKeyValueDelimiter('==');\n $this->assertEquals('==', $this->ruleParse->getArgumentKeyValueDelimiter());\n }",
"function walk_test_input(&$value,$key)\n{\n $value=test_input($value);\n}",
"public function testFacetSourceFilterKeyOverride() {\n $facet_source = new FacetSource(['filter_key' => 'ab'], 'facets_facet_source');\n\n // Override the container with the new facet source.\n $storage = $this->createMock(EntityStorageInterface::class);\n $storage->expects($this->once())\n ->method('load')\n ->willReturn($facet_source);\n $em = $this->getMockBuilder(EntityTypeManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $em->expects($this->any())\n ->method('getStorage')\n ->willReturn($storage);\n\n $container = \\Drupal::getContainer();\n $container->set('entity_type.manager', $em);\n \\Drupal::setContainer($container);\n\n $facet = new Facet([], 'facets_facet');\n $facet->setFieldIdentifier('test');\n $facet->setFacetSourceId('facet_source__dummy');\n $facet->setUrlAlias('test');\n\n $request = new Request();\n $request->query->set('ab', []);\n\n $this->processor = new QueryString(['facet' => $facet], 'query_string', [], $request, $this->entityManager, $this->eventDispatcher, $this->urlGenerator);\n $results = $this->processor->buildUrls($facet, $this->originalResults);\n\n /** @var \\Drupal\\facets\\Result\\ResultInterface $r */\n foreach ($results as $r) {\n $this->assertInstanceOf(ResultInterface::class, $r);\n $this->assertEquals('route:test?ab%5B0%5D=test%3A' . $r->getRawValue(), $r->getUrl()->toUriString());\n }\n }",
"public function testFilterByKeys()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action'];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index'];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }",
"public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }",
"public function testProcessWeirdCase1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '2'],\n false,\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }",
"public function test_getReplenishmentProcessByFilter() {\n\n }",
"public function testProcessWeirdCase2()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n false\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }",
"public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }",
"public function test_filters($my_filters) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('test_filters', func_get_args()));\n }",
"function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {\n $this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_7, $field_plugin_method, $expected_process);\n }",
"public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"public function testGetStepsWithParameterizedSimpleArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])]\n )\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n // String Literal\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']);\n\n // String Literal w/ data-like structure\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']);\n }",
"abstract public function doVerify(string $expected, string $payload, Key $key): bool;",
"public function testFilterKeywords()\n {\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }",
"public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"function process_action($target, $action) {\n //implement if needed\n }",
"public function testContinueContinues()\n {\n $tierApp = new TierApp(new Injector(), new NullCallback());\n \n $fn1 = function () {\n return false;\n };\n \n $called = false;\n \n $fn2 = function () use (&$called) {\n $called = true;\n return TierApp::PROCESS_END;\n };\n \n $tierApp->addExecutable(0, $fn1);\n $tierApp->addExecutable(1, $fn2);\n $tierApp->executeInternal();\n \n $this->assertTrue($called);\n }",
"public function testFilterByKeysDefault()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action', 0];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', 0 => null];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }",
"function duplicateStepsForTestCase($testCase, $relation, $clientID) {\n\n global $definitions;\n\n //DEFINITIONS\n $itemTypeStepsID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $tcParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $relatedStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRelatedID'], $clientID);\n $relatedRelationPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n\n //First, duplicate the steps inside the test case and set the new relation\n //build the return array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $tcParentPropertyID, 'value' => $testCase);\n $filters[] = array('ID' => $relatedStepPropertyID, 'value' => 0);\n\n // get testcase steps\n $steps = getFilteredItemsIDs($itemTypeStepsID, $clientID, $filters, $returnProperties);\n\n foreach ($steps as $step) {\n // make a copy of the step\n $stepCopy = duplicateItem($itemTypeStepsID, $step['ID'], $clientID);\n\n // change some properties\n setPropertyValueByID($relatedStepPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $step['ID'], '', $RSuserID);\n setPropertyValueByID($relatedRelationPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $relation['ID'], '', $RSuserID);\n }\n}",
"public function test_has_filter_return_values() {\n $hook = rand_str();\n\n yourls_add_filter( $hook, 'some_function' );\n yourls_add_filter( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_filter( $hook ) );\n $this->assertSame( 10, yourls_has_filter( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_filter( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_filter( $hook, 'nope_not_this_function' ) );\n }",
"public function test_apply_filter_funcname( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}",
"function allow_for_array_comparison_in_condition_non_lowercase_function_call() {\n\tif ( Array_Keys( $_GET['actions'], 'my_action', true ) ) { // OK.\n\t\tcheck_admin_referer( 'foo' );\n\t\tfoo();\n\t}\n}",
"function testAddWithExistingKey() {\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key3\", \"Path 3!\")\r\n );\r\n $counter = $this->actionForwards->size();\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key3\", \"Path 4!\")\r\n );\r\n $actionForward = $this->actionForwards->find(\"key3\");\r\n $this->assertEquals(\"key3\", $actionForward->getName(), \"Found wrong key!\");\r\n $this->assertEquals(\"Path 4!\", $actionForward->getPath(), \"Found wrong path!\");\r\n $this->assertTrue($this->actionForwards->size() == $counter, \"Found wrong number of forwards!\");\r\n }",
"function stage_do_action($action, $arg = '')\n{\n // If action starts with \"_\" we request a WooCommerce action\n $action = mb_substr($action, 0, 4) === 'get_' ? str_replace('get', 'woocommerce', $action) : $action;\n return do_action($action, $arg);\n}",
"protected function ProcessStepSuccessHook()\n {\n }",
"public function testKeyGetsRemoved()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter([\n 'test' => 'test',\n 'test2' => 'test',\n ]);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }",
"public function test_form_keygenerate_tests()\n {\n Livewire::test(ConfiguratorForm::class)\n ->set(\"name\", \"Test\")\n ->set(\"stepGenerateKey\", true)\n ->call('submitForm')\n ->assertSee(file_get_contents(base_path(self::DIR_MOCK . \"generate-key.yaml\")));\n\n\n Livewire::test(ConfiguratorForm::class)\n ->set(\"name\", \"Test\")\n ->set(\"stepGenerateKey\", false)\n ->call('submitForm')\n ->assertDontSee(\"run: php artisan key:generate\");\n\n }",
"public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }",
"public function beforeStep($filter, $callback)\n {\n $this->hooks['step.before'][] = array($filter, $callback);\n }",
"function spr_section_exclude_lifecycle($event,$step) {\n// $event:\t\"plugin_lifecycle.stm_article_order\"\n// $step:\t\"installed\", \"enabled\", \"disabled\", \"deleted\"\n// TXP 4.5: reinstall/upgrade only triggers \"installed\" event (now have to manually detect whether upgrade required)\nglobal $spr_exclude_debug;\n\nif ($spr_exclude_debug) {\n\techo \"spr_section_exclude_lifecycle start\";\n}\n\n\t$result = '?';\n\tif (($step == 'enabled') or ($step = 'installed')) {\n\t\t\t$result = spr_section_exclude_install();\n\t}\n\telse if ($step == 'deleted') {\n\t\t$result = spr_section_exclude_uninstall();\n\t}\n\tif ($spr_exclude_debug){\n\t\techo \"Event=$event Step=$step Result=$result\";\n\t}\n}",
"public function test_multiple_filter_with_priority() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 9 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"2\" . \"1\", $filtered );\n\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 11 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n }",
"public function testFilterByKeysDeepKey()\n {\n $config = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', '?' => ['sort' => 'created', 'direction' => 'asc']];\n $result = Hash::filterByKeys($config, ['controller', '?.sort']);\n $this->assertEquals(['controller' => 'Groups', '?' => ['sort' => 'created']], $result);\n }",
"public function testAddAllFieldProcesses() {\n $expected_process_keys = [\n 'comment_body',\n 'field_integer',\n 'body',\n 'field_text_plain',\n 'field_text_filtered',\n 'field_text_plain_filtered',\n 'field_text_long_plain',\n 'field_text_long_filtered',\n 'field_text_long_plain_filtered',\n 'field_text_sum_plain',\n 'field_text_sum_filtered',\n 'field_text_sum_plain_filtered',\n 'field_tags',\n 'field_image',\n 'field_link',\n 'field_reference',\n 'field_reference_2',\n 'taxonomy_forums',\n 'field_boolean',\n 'field_email',\n 'field_phone',\n 'field_date',\n 'field_date_with_end_time',\n 'field_file',\n 'field_float',\n 'field_images',\n 'field_text_list',\n 'field_integer_list',\n 'field_long_text',\n 'field_term_reference',\n 'field_text',\n 'field_node_entityreference',\n 'field_user_entityreference',\n 'field_term_entityreference',\n 'field_node_reference',\n 'field_user_reference',\n 'field_private_file',\n 'field_datetime_without_time',\n 'field_date_without_time',\n 'field_float_list',\n 'field_training',\n 'field_sector',\n 'field_chancellor',\n ];\n $this->assertFieldProcessKeys($this->fieldDiscovery, $this->migrationPluginManager, '7', $expected_process_keys);\n }",
"function testAddWithNewKey() {\r\n $counter = $this->actionForwards->size();\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key2\", \"Path 2!\")\r\n );\r\n $actionForward = $this->actionForwards->find(\"key2\");\r\n $this->assertEquals(\"key2\", $actionForward->getName(), \"Found wrong key!\");\r\n $this->assertEquals(\"Path 2!\", $actionForward->getPath(), \"Found wrong path!\");\r\n $this->assertTrue($this->actionForwards->size() == $counter + 1, \"Found wrong number of forwards!\");\r\n }",
"public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"function test_init_action_is_run() {\n\t}",
"public function testPostUpdatePermissionKeys() {\n // Login using root user.\n $this->drupalLogin($this->rootUser);\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that before updates the permission keys are in camelcase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertTrue($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertFalse($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertTrue($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertFalse($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n\n $this->runUpdates();\n\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that after updates the permission keys are in lowercase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertFalse($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertTrue($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertFalse($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertTrue($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n }",
"function qi_add_actions_filters() {\n add_action( 'woocommerce_product_options_inventory_product_data', array( &$this, 'woo_qi_product_fields' ) );\n add_action( 'woocommerce_process_product_meta', array( &$this, 'woo_qi_save_field_input' ) );\n }",
"public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }",
"abstract protected function define_my_steps();",
"function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}",
"protected function outputSpecificStep() {}",
"public function testGetDefaultArgumentKeyValueSeparator()\n {\n $this->assertEquals('=', $this->ruleParse->getArgumentKeyValueDelimiter());\n }",
"public function test_multiple_filter() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; } );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; } );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n\t}",
"public function testTransform($value, $expected_value, $invalid_id = NULL, $skip_exception = FALSE) {\n $configuration = [\n 'bypass' => TRUE,\n 'map' => [\n 'foo' => 'filter_html',\n 'baz' => 'php_code',\n ],\n ];\n $plugin = FilterID::create($this->container, $configuration, 'filter_id', []);\n\n if ($skip_exception) {\n $this->executable\n ->expects($this->exactly(1))\n ->method('saveMessage')\n ->with(\n sprintf('Filter %s could not be mapped to an existing filter plugin; omitted since it is a transformation-only filter. Install and configure a successor after the migration.', $value),\n MigrationInterface::MESSAGE_INFORMATIONAL\n );\n $this->expectException(MigrateSkipProcessException::class);\n $this->expectExceptionMessage(sprintf(\"The transformation-only filter %s was skipped.\", $value));\n }\n\n if (isset($invalid_id)) {\n $this->executable\n ->expects($this->exactly(1))\n ->method('saveMessage')\n ->with(\n sprintf('Filter %s could not be mapped to an existing filter plugin; defaulting to %s and dropping all settings. Either redo the migration with the module installed that provides an equivalent filter, or modify the text format after the migration to remove this filter if it is no longer necessary.', $invalid_id, $expected_value),\n MigrationInterface::MESSAGE_WARNING\n );\n }\n\n $row = new Row();\n $output_value = $plugin->transform($value, $this->executable, $row, 'foo');\n\n $this->assertSame($expected_value, $output_value);\n }",
"public function testCommandProcessSubstitutionChain(): void\n {\n $builder = ShellBuilder::new()->createCommand('diff')\n ->addArgument(\n ShellBuilder::new()->createCommand('ssh')\n ->addShortOption('n', '[email protected]', false)\n ->addArgument('cat', false)\n ->addArgument('/vms/cloudburst.qcow2.*', false)\n ->isProcessSubstitution(),\n false\n )\n ->addArgument(\n ShellBuilder::new()->createCommand('ssh')\n ->addShortOption('n', '[email protected]', false)\n ->addArgument('cat', false)\n ->addArgument('/vms/cloudburst.qcow2', false)\n ->isProcessSubstitution(),\n false\n );\n $result = 'diff <(ssh -n [email protected] cat /vms/cloudburst.qcow2.*) <(ssh -n [email protected] cat /vms/cloudburst.qcow2)';\n $this->assertEquals($result, (string)$builder);\n }",
"public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public static function executeStepHandler2()\n {\n // Invoke plugins\n \\Includes\\Decorator\\Utils\\PluginManager::invokeHook(static::HOOK_STEP_SECOND);\n }",
"public static function _switch()\n {\n //get the argument list, and extract $self\n $args = func_get_args();\n $self = array_shift($args);\n\n //get the item we're comparing to\n $comparison_base = array_shift($args);\n\n //split the arguments into two separate lists\n $count = count($args);\n for($i = 0; $i + 1 < $count; $i += 2)\n {\n //if the condition evalutes to true, run the body code\n if($self->evaluate($args[$i]) == $comparison_base)\n {\n //run the associated code\n $self->evaluate_script($args[$i + 1]);\n }\n }\n }",
"public function test_apply_filter_closure( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}",
"public function _processUrlKeys()\n {\n return true;\n }",
"public function test_add_several_actions_random_priorities() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n $total = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $total += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n $this->assertSame( $times, $total );\n }",
"abstract protected function logicFilter($key, $valueK, $op, $v);",
"function verifyTextSearchReplaceNext(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE));\n $this->click(BUTTON_REPLACENEXT);\n $this->click(BUTTON_REPLACENEXT);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_SEARCH), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }",
"public function test_default_priority() {\n $hook = rand_str();\n global $yourls_filters;\n\n $this->assertArrayNotHasKey( $hook, $yourls_filters );\n yourls_add_filter( $hook, rand_str() );\n $this->assertArrayHasKey( 10, $yourls_filters[$hook] );\n }",
"protected function handleTriggerArguments() {}",
"function Step1_IntegrityHard() { return( $this->stepTest( 'integ_') ); }",
"public function testRun7()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == true (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testRun6()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == true (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"function check_actions($observed_fields, $pas, $start_field_set = null) // {{{\n{\n // Set initial field set to empty if not given\n if ($start_field_set === null)\n $start_field_set = new FieldSet();\n else\n $start_field_set = $start_field_set->getClone();\n // Apply actions\n $pas->applyAll($start_field_set);\n // Compare result with extracted field set\n $diff = $observed_fields->differenceWith($start_field_set);\n return $diff;\n}",
"public function step_2()\n {\n }",
"public function testBypassPipe(): void\n {\n $passable = '(0)';\n $container = new Container();\n $pipeline = new Pipeline($container);\n\n $result = $pipeline\n ->send($passable)\n ->through([\n PipeOne::class => 'a',\n BypassPipe::class => 'c',\n PipeTwo::class => 'b',\n ])\n ->via('handle')\n ->then(function ($passable) {\n return $passable . '(e)';\n })\n ->run();\n\n self::assertEquals('(0)(1a)(-1a)', $result);\n }",
"abstract protected function _preProcess();",
"public function testGetReplenishmentByFilter()\n {\n }",
"public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}",
"public function assertArrayHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayHasKey', func_get_args()));\n }",
"public function assertArrayHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayHasKey', func_get_args()));\n }",
"public function _action_act_preprocess(Doku_Event $event, $param)\n {\n global $ACT, $INFO;\n\n $action =& $event->data;\n\n if (!( /* Valid cases */\n $action == 'changes' // Greebo\n // Frusterick Manners and below... probably\n || is_array($action) && array_key_exists('changes', $action)\n )) return;\n\n /* We check the DokuWiki release */\n if (class_exists('\\\\dokuwiki\\\\ActionRouter', false)) {\n /* release Greebo and above */\n\n /* See ActionRouter->setupAction() and Action\\Preview */\n // WARN: Only works because Action\\Edit methods are public\n $ae = new dokuwiki\\Action\\Edit();\n $ae->checkPreconditions();\n $this->savedraft();\n $ae->preProcess();\n\n $event->stopPropagation();\n $event->preventDefault();\n\n } elseif (function_exists('act_permcheck')) {\n /* release Frusterick Manners and below */\n\n // Same setup as preview: permissions and environment\n if ('preview' == act_permcheck('preview')\n && 'preview' == act_edit('preview'))\n {\n act_draftsave('preview');\n $ACT = 'changes';\n\n $event->stopPropagation();\n $event->preventDefault();\n } else {\n $ACT = 'preview';\n }\n\n } else {\n // Fallback\n $ACT = 'preview';\n }\n }",
"public function test_filter_specified_arguments() {\n // Ask for 2 arguments and provide 2\n $hook = rand_str();\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '' ) { return \"$var1 $var2\"; }, 10, 2 );\n $test = yourls_apply_filter( $hook, 'hello', 'world' );\n $this->assertSame( $test, 'hello world' );\n\n // Ask for 1 argument and provide 2\n $hook = rand_str();\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '' ) { return \"$var1 $var2\"; }, 10, 1 );\n $test = yourls_apply_filter( $hook, 'hello', 'world' );\n $this->assertSame( $test, 'hello ' );\n\n // Ask for 2 arguments and provide 1\n $hook = rand_str();\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '' ) { return \"$var1 $var2\"; }, 10, 2 );\n $test = yourls_apply_filter( $hook, 'hello' );\n $this->assertSame( $test, 'hello ' );\n }",
"function isOnStep($step) {\n global $GLOBAL;\n\tif($GLOBAL['id']==$step)\n\t\treturn true;\n}",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function testGetKeyRevisionHistory()\n {\n }",
"function verifyRegEx(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE_REGEX));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH_REGEX));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE_REGEX));\n $this->click(CHK_REGEX);\n $this->click(BUTTON_REPLACEALL);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }",
"public function enable_step($old_state);",
"public function setExpectedAction($action);",
"function before_filter(&$action, &$args) {\n }",
"public function _presetKeyWizard($step = 1, $value = false)\n\t{\n\t\tif( ! $this->_getExist() ){\n\t\t\t\n\t\t\t$step = (int) $step;\n\t\t\t\n\t\t\t$configs = $this->getConfig();\n\t\t\t$configs = array_keys($configs);\n\n\t\t\tif( $step < 1 ){\n\t\t\t\t$step = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif( ! in_array($step,$configs) ){\n\t\t\t\t$step = 1;\n\t\t\t}\n\n\t\t\t$config = $this->getConfig( $step );\n\t\t\t$config = $this->_merge( $config );\n\t\t\t\n\t\t\t$key = Hash::extract('url');\n\t\t\t\n\t\t\t$this->Session->write( 'Wizard.datas.'.$key , $value );\n\n\t\t}\n\n\t}",
"function test_import_key()\n\t{\n\t\t// Remove the following line when you implement this test.\n\t\treturn $this -> markTestSkipped();\n\t}",
"public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function pass()\n\t{\n\t\t$trace = debug_backtrace();\n\n\t\t// If the test has already failed then we don't want to set it to true.\n\t\tif ( ! empty($trace[2]['function']) and (is_int($trace[2]['function']) or is_string($trace[2]['function']))\n\t\t\tand @array_key_exists($trace[2]['function'], $this->results)\n\t\t and $this->results[$trace[2]['function']] === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->results[$trace[2]['function']] = true;\n\t}",
"private function step1()\n {\n // erte ert\n // replace with er\n if ( ($position = $this->searchIfInR1(array('erte', 'ert'))) !== false) {\n $this->word = preg_replace('#(erte|ert)$#u', 'er', $this->word);\n return true;\n }\n\n // a e ede ande ende ane ene hetene en heten ar er heter as es edes endes enes hetenes ens hetens ers ets et het ast\n // delete\n if ( ($position = $this->searchIfInR1(array(\n 'hetenes', 'hetene', 'hetens', 'heten', 'endes', 'heter', 'ande', 'ende', 'enes', 'edes', 'ede', 'ane',\n 'ene', 'het', 'ers', 'ets', 'ast', 'ens', 'en', 'ar', 'er', 'as', 'es', 'et', 'a', 'e'\n ))) !== false) {\n $this->word = UTF8::substr($this->word, 0, $position);\n return true;\n }\n\n // s\n // delete if preceded by a valid s-ending\n if ( ($position = $this->searchIfInR1(array('s'))) !== false) {\n $word = UTF8::substr($this->word, 0, $position);\n if ($this->hasValidSEnding($word)) {\n $this->word = $word;\n }\n return true;\n }\n }",
"public function testGoodFilter()\n {\n $tests = array(\n array(\n 'label' => __LINE__ .': simple match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', 'value'),\n 'expression' => 'attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '*value...'),\n 'expression' => 'attr-field~=\\\\^\\\\\\*value\\\\.\\\\.\\\\.\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing regex characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '$v?(a)l[u]e|^'),\n 'expression' => 'attr-field~=\\\\^\\\\\\\\\\$v\\\\\\?\\\\\\\\\\(a\\\\\\\\\\)l\\\\\\\\\\[u\\\\\\\\\\]e\\\\\\\\\\|\\\\\\\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing newline/return characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', \"va\\nl\\rue\"),\n 'expression' => \"attr-field~=\\^va\\\\\\\\\\\\\\n\" . \"l\\\\\\\\\\\\\\r\" .'ue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-field match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', 'bar'),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & attr-foo~=\\\\^bar\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-value match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof')),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': multi-value negated match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof'), '!='),\n 'expression' => 'attr-field~=\\\\^value\\\\$ &^ (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': inverted match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_EQUAL\n ),\n 'expression' => '^attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_EQUAL, null, true\n ),\n 'expression' => 'attr-field~=\\\\^[Vv][Aa][Ll][Uu][Ee]\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, case-sensitive',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, with wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '.*value...', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=.*value...'\n ),\n array(\n 'label' => __LINE__ .': inverted regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_REGEX\n ),\n 'expression' => '^attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match alternatives',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '(V|v)alue', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\(V\\\\|v\\\\)alue'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^[Vv]alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\^[Vv]alue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase, with escapes',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX\\\\]\\\\\\\\]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx\\\\\\\\]\\\\\\\\\\\\\\\\][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match question mark',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^v?alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\^v?alue\\$'\n ),\n array(\n 'label' => __LINE__ .': empty string match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', ''),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': null match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', null),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': simple contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS, null, true\n ),\n 'expression' => 'attr-field~=[Ff][Oo][Oo]'\n ),\n array(\n 'label' => __LINE__ .': contains match with special chars',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo bar-', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo\\ bar\\-'\n ),\n );\n\n foreach ($tests as $test) {\n $this->assertSame(\n $test['expression'],\n $test['filter']->getExpression(),\n $test['label']\n );\n }\n }",
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"public function testRun3()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == false (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function test_add_action_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, rand_str() );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Specific function name to test with yourls_do_action\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, 'change_one_global' );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"protected function checkTranslatedShortcut() {}",
"public function test_getOrderLineActivityByFilter() {\n\n }"
] | [
"0.72146386",
"0.5390567",
"0.5371273",
"0.5311302",
"0.53003556",
"0.5131763",
"0.49525613",
"0.48656347",
"0.4828903",
"0.47970685",
"0.4785259",
"0.47845724",
"0.4775462",
"0.47712243",
"0.47585717",
"0.47413877",
"0.4722941",
"0.47062543",
"0.46786904",
"0.46491084",
"0.4618692",
"0.46087435",
"0.45885742",
"0.45640033",
"0.45399287",
"0.45277143",
"0.45235315",
"0.4520761",
"0.45055372",
"0.44732597",
"0.44668868",
"0.4461271",
"0.44558078",
"0.44476712",
"0.44362646",
"0.4425516",
"0.44127584",
"0.441047",
"0.44099945",
"0.44044942",
"0.44019106",
"0.43972415",
"0.4384262",
"0.43750727",
"0.4369158",
"0.4364891",
"0.43611494",
"0.4356895",
"0.4356585",
"0.43522754",
"0.43521324",
"0.434912",
"0.43472826",
"0.43331417",
"0.43164322",
"0.4308769",
"0.43052828",
"0.4294641",
"0.42928052",
"0.42853257",
"0.4272934",
"0.42570624",
"0.4251463",
"0.42315632",
"0.42263198",
"0.4222756",
"0.42193547",
"0.42173126",
"0.42157173",
"0.4205096",
"0.42049202",
"0.4204715",
"0.42045757",
"0.4199027",
"0.41983187",
"0.41910717",
"0.41892096",
"0.41731074",
"0.41731074",
"0.4172954",
"0.41695338",
"0.41688398",
"0.41657478",
"0.41654435",
"0.41653132",
"0.41614413",
"0.41600433",
"0.41567197",
"0.41481546",
"0.41430208",
"0.41430205",
"0.4137564",
"0.4136495",
"0.41231325",
"0.41231242",
"0.4121367",
"0.41175142",
"0.4115641",
"0.4114244",
"0.41116518"
] | 0.7201753 | 1 |
Tests the stepKey replacement with "stepKey + invocationKey" process filter Specific to actions that make are removed by a "require stepKey replacement" filter | public function testStepKeyReplacementFilteredOut()
{
$clickStepKey = "clickStepKey";
$fillFieldStepKey = "fillFieldStepKey";
$clickAction = "click";
$fillFieldAction ="fillField";
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
->withActionObjects([
new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),
new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])
])
->build();
$result = $actionGroupUnderTest->extractStepKeys();
$this->assertNotContains($clickStepKey, $result);
$this->assertNotContains($fillFieldStepKey, $result);
$this->assertCount(0, $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testStepKeyReplacementFilteredIn()\n {\n $createStepKey = \"createDataStepKey\";\n $updateStepKey = \"updateDataStepKey\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject(\n $updateStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[6],\n ['selector' => 'value']\n ),\n new ActionObject(\n $createStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[7],\n ['selector' => 'value']\n )\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertContains($updateStepKey, $result);\n $this->assertContains($createStepKey, $result);\n $this->assertCount(2, $result);\n }",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function testKeyGetsRemoved()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter([\n 'test' => 'test',\n 'test2' => 'test',\n ]);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }",
"protected function executeSpecificStep() {}",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function testFilterByKeys()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action'];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index'];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }",
"public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"function view_key_replace_arguments($values, &$handler) {\n foreach ($values as $value) {\n if (strpos($value, '__arg:') === 0) {\n // Get the argument and make sure its actually on the view still.\n $arg_id = drupal_substr($value, drupal_strlen('__arg:'));\n if (isset($handler->view->argument[$arg_id]) && $handler->view->argument[$arg_id]->argument_validated) {\n // Argument is there and ready to go!\n $argument = clone($handler->view->argument[$arg_id]);\n $arg_value = $argument->get_value();\n // Might need to split this up.\n if (!empty($argument->options['break_phrase'])) {\n views_break_phrase($argument->get_value(), $argument);\n foreach ($argument->value as $new_val) {\n $values[$new_val] = $new_val;\n }\n }\n else {\n $new_val = $argument->get_value();\n $values[$new_val] = $new_val;\n }\n }\n // Always remove the dummy argument value.\n unset($values[$value]);\n }\n }\n\n return $values;\n }",
"public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }",
"public function test_getReplenishmentProcessByFilter() {\n\n }",
"public function testProcessWeirdCase1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '2'],\n false,\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }",
"public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }",
"function spr_section_exclude_lifecycle($event,$step) {\n// $event:\t\"plugin_lifecycle.stm_article_order\"\n// $step:\t\"installed\", \"enabled\", \"disabled\", \"deleted\"\n// TXP 4.5: reinstall/upgrade only triggers \"installed\" event (now have to manually detect whether upgrade required)\nglobal $spr_exclude_debug;\n\nif ($spr_exclude_debug) {\n\techo \"spr_section_exclude_lifecycle start\";\n}\n\n\t$result = '?';\n\tif (($step == 'enabled') or ($step = 'installed')) {\n\t\t\t$result = spr_section_exclude_install();\n\t}\n\telse if ($step == 'deleted') {\n\t\t$result = spr_section_exclude_uninstall();\n\t}\n\tif ($spr_exclude_debug){\n\t\techo \"Event=$event Step=$step Result=$result\";\n\t}\n}",
"public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {\n $this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_7, $field_plugin_method, $expected_process);\n }",
"public function testProcessWeirdCase2()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n false\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }",
"public function testRemoveOnNotExistingKeyWithValues()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter(['test2' => 'test']);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }",
"function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}",
"public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function test_filters($my_filters) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('test_filters', func_get_args()));\n }",
"function walk_test_input(&$value,$key)\n{\n $value=test_input($value);\n}",
"public function test_remove_only_actions_with_given_prio() {\n $hook = rand_str();\n $priorities = array();\n\n $times = mt_rand( 10, 30 );\n for ( $i = 1; $i <= $times; $i++ ) {\n $prio = mt_rand( 1, 100 );\n $priorities[] = $prio;\n yourls_add_action( $hook, rand_str(), $prio );\n }\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n\n // Pick a random number of randomly picked priorities (but not all of them)\n $priorities = array_unique( $priorities );\n $random_priorities = (array) array_rand( $priorities, mt_rand( 1, count( $priorities ) - 1 ) );\n\n // Count how many we're supposed to remove\n $removed = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n if( in_array( $prio, $random_priorities ) )\n $removed += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n // Remove the randomly picked priorities\n foreach( $random_priorities as $random_priority ) {\n yourls_remove_all_actions( $hook, $random_priority );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Count how many are left\n $remaining = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $remaining += count( $yourls_filters[ $hook ][ $prio ] );\n }\n $this->assertSame( $remaining, $times - $removed );\n }",
"public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }",
"public function testFilterByKeysDefault()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action', 0];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', 0 => null];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }",
"public function testFacetSourceFilterKeyOverride() {\n $facet_source = new FacetSource(['filter_key' => 'ab'], 'facets_facet_source');\n\n // Override the container with the new facet source.\n $storage = $this->createMock(EntityStorageInterface::class);\n $storage->expects($this->once())\n ->method('load')\n ->willReturn($facet_source);\n $em = $this->getMockBuilder(EntityTypeManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $em->expects($this->any())\n ->method('getStorage')\n ->willReturn($storage);\n\n $container = \\Drupal::getContainer();\n $container->set('entity_type.manager', $em);\n \\Drupal::setContainer($container);\n\n $facet = new Facet([], 'facets_facet');\n $facet->setFieldIdentifier('test');\n $facet->setFacetSourceId('facet_source__dummy');\n $facet->setUrlAlias('test');\n\n $request = new Request();\n $request->query->set('ab', []);\n\n $this->processor = new QueryString(['facet' => $facet], 'query_string', [], $request, $this->entityManager, $this->eventDispatcher, $this->urlGenerator);\n $results = $this->processor->buildUrls($facet, $this->originalResults);\n\n /** @var \\Drupal\\facets\\Result\\ResultInterface $r */\n foreach ($results as $r) {\n $this->assertInstanceOf(ResultInterface::class, $r);\n $this->assertEquals('route:test?ab%5B0%5D=test%3A' . $r->getRawValue(), $r->getUrl()->toUriString());\n }\n }",
"public function test_form_keygenerate_tests()\n {\n Livewire::test(ConfiguratorForm::class)\n ->set(\"name\", \"Test\")\n ->set(\"stepGenerateKey\", true)\n ->call('submitForm')\n ->assertSee(file_get_contents(base_path(self::DIR_MOCK . \"generate-key.yaml\")));\n\n\n Livewire::test(ConfiguratorForm::class)\n ->set(\"name\", \"Test\")\n ->set(\"stepGenerateKey\", false)\n ->call('submitForm')\n ->assertDontSee(\"run: php artisan key:generate\");\n\n }",
"function duplicateStepsForTestCase($testCase, $relation, $clientID) {\n\n global $definitions;\n\n //DEFINITIONS\n $itemTypeStepsID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $tcParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $relatedStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRelatedID'], $clientID);\n $relatedRelationPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n\n //First, duplicate the steps inside the test case and set the new relation\n //build the return array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $tcParentPropertyID, 'value' => $testCase);\n $filters[] = array('ID' => $relatedStepPropertyID, 'value' => 0);\n\n // get testcase steps\n $steps = getFilteredItemsIDs($itemTypeStepsID, $clientID, $filters, $returnProperties);\n\n foreach ($steps as $step) {\n // make a copy of the step\n $stepCopy = duplicateItem($itemTypeStepsID, $step['ID'], $clientID);\n\n // change some properties\n setPropertyValueByID($relatedStepPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $step['ID'], '', $RSuserID);\n setPropertyValueByID($relatedRelationPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $relation['ID'], '', $RSuserID);\n }\n}",
"public function testDeleteKey()\n {\n }",
"function deleteStepsResultsForATestCase($testCase, $relation, $clientID) {\n\n global $definitions;\n\n //DEFINITIONS\n $itemTypeStepsID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n $resultsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['result'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $tcParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $relatedStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRelatedID'], $clientID);\n $relatedRelationPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n $stepAssocPropertyID = getClientPropertyID_RelatedWith_byName($definitions['resultStepAssociatedID'], $clientID);\n\n //build the return array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $tcParentPropertyID, 'value' => $testCase);\n $filters[] = array('ID' => $relatedStepPropertyID, 'value' => 0, 'mode' => '<>');\n $filters[] = array('ID' => $relatedRelationPropertyID, 'value' => $relation['ID']);\n\n // get testcase steps\n $steps = getFilteredItemsIDs($itemTypeStepsID, $clientID, $filters, $returnProperties);\n\n $stepsList = array();\n\n foreach ($steps as $step) {\n $stepsList[] = $step['ID'];\n }\n\n if (count($stepsList) > 0) {\n // delete steps associated results\n //build the return array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $stepAssocPropertyID, 'value' => implode(',', $stepsList), 'mode' => '<-IN');\n\n //get results\n $res = getFilteredItemsIDs($resultsItemTypeID, $clientID, $filters, $returnProperties);\n\n $resList = array();\n\n foreach ($res as $result) {\n $resList[] = $result['ID'];\n }\n\n if (count($resList) > 0) {\n //Clear results steps list\n deleteItems($resultsItemTypeID, $clientID, implode(',', $resList));\n }\n\n // finally delete steps\n deleteItems($itemTypeStepsID, $clientID, implode(',', $stepsList));\n }\n}",
"public function testFilterKeywords()\n {\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }",
"public function test_remove_all_actions() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n yourls_remove_all_actions( $hook );\n $this->assertFalse( yourls_has_action( $hook ) );\n }",
"function process_action($target, $action) {\n //implement if needed\n }",
"public function test_apply_filter_funcname( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}",
"public function assertArrayNotHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayNotHasKey', func_get_args()));\n }",
"public function assertArrayNotHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayNotHasKey', func_get_args()));\n }",
"public function testSetGetArgumentKeyValueSeparator()\n {\n $this->ruleParse->setArgumentKeyValueDelimiter('==');\n $this->assertEquals('==', $this->ruleParse->getArgumentKeyValueDelimiter());\n }",
"public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"function testAddWithExistingKey() {\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key3\", \"Path 3!\")\r\n );\r\n $counter = $this->actionForwards->size();\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key3\", \"Path 4!\")\r\n );\r\n $actionForward = $this->actionForwards->find(\"key3\");\r\n $this->assertEquals(\"key3\", $actionForward->getName(), \"Found wrong key!\");\r\n $this->assertEquals(\"Path 4!\", $actionForward->getPath(), \"Found wrong path!\");\r\n $this->assertTrue($this->actionForwards->size() == $counter, \"Found wrong number of forwards!\");\r\n }",
"abstract public function doVerify(string $expected, string $payload, Key $key): bool;",
"public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }",
"public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"protected function remove($steps, $key)\n {\n if (isset($steps[$key])) {\n if ($steps[$key]['type'] == 3) {\n unset($steps[$key]);\n } else {\n $removing = false;\n $stepType = $steps[$key]['type'];\n foreach ($steps as $currentKey => $step) {\n $matchesFrom = (isset($step['from']) && $step['from'] == $key);\n $matchesEnd = (isset($step['end']) && $step['end'] == $key);\n if (($stepType == 2 && $currentKey == $key) || $matchesFrom) {\n unset($steps[$currentKey]);\n break;\n } elseif (($stepType == 1 && $currentKey == $key) || $matchesEnd) {\n unset($steps[$currentKey]);\n $removing = true;\n } elseif ($removing) {\n unset($steps[$currentKey]);\n }\n }\n }\n }\n return $steps;\n }",
"public function testTransform($value, $expected_value, $invalid_id = NULL, $skip_exception = FALSE) {\n $configuration = [\n 'bypass' => TRUE,\n 'map' => [\n 'foo' => 'filter_html',\n 'baz' => 'php_code',\n ],\n ];\n $plugin = FilterID::create($this->container, $configuration, 'filter_id', []);\n\n if ($skip_exception) {\n $this->executable\n ->expects($this->exactly(1))\n ->method('saveMessage')\n ->with(\n sprintf('Filter %s could not be mapped to an existing filter plugin; omitted since it is a transformation-only filter. Install and configure a successor after the migration.', $value),\n MigrationInterface::MESSAGE_INFORMATIONAL\n );\n $this->expectException(MigrateSkipProcessException::class);\n $this->expectExceptionMessage(sprintf(\"The transformation-only filter %s was skipped.\", $value));\n }\n\n if (isset($invalid_id)) {\n $this->executable\n ->expects($this->exactly(1))\n ->method('saveMessage')\n ->with(\n sprintf('Filter %s could not be mapped to an existing filter plugin; defaulting to %s and dropping all settings. Either redo the migration with the module installed that provides an equivalent filter, or modify the text format after the migration to remove this filter if it is no longer necessary.', $invalid_id, $expected_value),\n MigrationInterface::MESSAGE_WARNING\n );\n }\n\n $row = new Row();\n $output_value = $plugin->transform($value, $this->executable, $row, 'foo');\n\n $this->assertSame($expected_value, $output_value);\n }",
"function stage_do_action($action, $arg = '')\n{\n // If action starts with \"_\" we request a WooCommerce action\n $action = mb_substr($action, 0, 4) === 'get_' ? str_replace('get', 'woocommerce', $action) : $action;\n return do_action($action, $arg);\n}",
"public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }",
"function check_actions($observed_fields, $pas, $start_field_set = null) // {{{\n{\n // Set initial field set to empty if not given\n if ($start_field_set === null)\n $start_field_set = new FieldSet();\n else\n $start_field_set = $start_field_set->getClone();\n // Apply actions\n $pas->applyAll($start_field_set);\n // Compare result with extracted field set\n $diff = $observed_fields->differenceWith($start_field_set);\n return $diff;\n}",
"public function testFilterByKeysDeepKey()\n {\n $config = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', '?' => ['sort' => 'created', 'direction' => 'asc']];\n $result = Hash::filterByKeys($config, ['controller', '?.sort']);\n $this->assertEquals(['controller' => 'Groups', '?' => ['sort' => 'created']], $result);\n }",
"public function testUpdateActionAndNoKeyword()\n {\n // Mock the property object.\n $oProperty = $this->getMock('Hook\\Commit\\Diff\\Property', array(), array('tag'));\n $oProperty->expects($this->any())\n ->method('getOldValue')\n ->will($this->returnValue(''));\n\n $oProperty->expects($this->any())\n ->method('getNewValue')\n ->will($this->returnValue(''));\n\n $aParams = array(\n 'txn' => '666-1',\n 'rev' => 666,\n 'action' => 'U',\n 'item' => 'file.php',\n 'real' => 'file.php',\n 'ext' => 'php',\n 'isdir' => false,\n 'props' => array('tag' => $oProperty),\n 'lines' => null,\n 'info' => null\n );\n\n $oObject = new Object($aParams);\n\n $this->oIdListener->processAction($oObject);\n\n // Check.\n $aErrors = $oObject->getErrorLines();\n\n $this->assertTrue(empty($aErrors));\n }",
"public function testAddAllFieldProcesses() {\n $expected_process_keys = [\n 'comment_body',\n 'field_integer',\n 'body',\n 'field_text_plain',\n 'field_text_filtered',\n 'field_text_plain_filtered',\n 'field_text_long_plain',\n 'field_text_long_filtered',\n 'field_text_long_plain_filtered',\n 'field_text_sum_plain',\n 'field_text_sum_filtered',\n 'field_text_sum_plain_filtered',\n 'field_tags',\n 'field_image',\n 'field_link',\n 'field_reference',\n 'field_reference_2',\n 'taxonomy_forums',\n 'field_boolean',\n 'field_email',\n 'field_phone',\n 'field_date',\n 'field_date_with_end_time',\n 'field_file',\n 'field_float',\n 'field_images',\n 'field_text_list',\n 'field_integer_list',\n 'field_long_text',\n 'field_term_reference',\n 'field_text',\n 'field_node_entityreference',\n 'field_user_entityreference',\n 'field_term_entityreference',\n 'field_node_reference',\n 'field_user_reference',\n 'field_private_file',\n 'field_datetime_without_time',\n 'field_date_without_time',\n 'field_float_list',\n 'field_training',\n 'field_sector',\n 'field_chancellor',\n ];\n $this->assertFieldProcessKeys($this->fieldDiscovery, $this->migrationPluginManager, '7', $expected_process_keys);\n }",
"function allow_for_array_comparison_in_condition_non_lowercase_function_call() {\n\tif ( Array_Keys( $_GET['actions'], 'my_action', true ) ) { // OK.\n\t\tcheck_admin_referer( 'foo' );\n\t\tfoo();\n\t}\n}",
"public function testRemoveOnNotExistingKey()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter([]);\n\n $this->assertEquals([], $result);\n }",
"public function testCommandProcessSubstitutionChain(): void\n {\n $builder = ShellBuilder::new()->createCommand('diff')\n ->addArgument(\n ShellBuilder::new()->createCommand('ssh')\n ->addShortOption('n', '[email protected]', false)\n ->addArgument('cat', false)\n ->addArgument('/vms/cloudburst.qcow2.*', false)\n ->isProcessSubstitution(),\n false\n )\n ->addArgument(\n ShellBuilder::new()->createCommand('ssh')\n ->addShortOption('n', '[email protected]', false)\n ->addArgument('cat', false)\n ->addArgument('/vms/cloudburst.qcow2', false)\n ->isProcessSubstitution(),\n false\n );\n $result = 'diff <(ssh -n [email protected] cat /vms/cloudburst.qcow2.*) <(ssh -n [email protected] cat /vms/cloudburst.qcow2)';\n $this->assertEquals($result, (string)$builder);\n }",
"public function testMultiDimensionalKeyGetsRemoved()\n {\n $this->filter->value('test.test.test')->remove();\n\n $result = $this->filter->filter([\n 'test' => [\n 'test' => [\n 'test' => 'test',\n ],\n ],\n 'test2' => 'test',\n ]);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }",
"public function testGetStepsWithParameterizedSimpleArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])]\n )\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n // String Literal\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']);\n\n // String Literal w/ data-like structure\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']);\n }",
"public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }",
"abstract public function ForgetStep( $name );",
"public function test_apply_filter_closure( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}",
"public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }",
"public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }",
"public function test_has_filter_return_values() {\n $hook = rand_str();\n\n yourls_add_filter( $hook, 'some_function' );\n yourls_add_filter( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_filter( $hook ) );\n $this->assertSame( 10, yourls_has_filter( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_filter( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_filter( $hook, 'nope_not_this_function' ) );\n }",
"public function testFilter() {\n $data = $this->expanded;\n\n $match1 = $data;\n $match2 = $data;\n unset($match1['empty'], $match2['empty'], $match1['one']['two']['three']['false'], $match1['one']['two']['three']['null']);\n\n $this->assertEquals($match1, Hash::filter($data));\n $this->assertEquals($match2, Hash::filter($data, false));\n\n $data = array(\n 'true' => true,\n 'false' => false,\n 'null' => null,\n 'zero' => 0,\n 'stringZero' => '0',\n 'empty' => array(),\n 'array' => array(\n 'false' => false,\n 'null' => null,\n 'empty' => array()\n )\n );\n\n $this->assertEquals(array(\n 'true' => true,\n 'zero' => 0,\n 'stringZero' => '0'\n ), Hash::filter($data));\n }",
"function qi_add_actions_filters() {\n add_action( 'woocommerce_product_options_inventory_product_data', array( &$this, 'woo_qi_product_fields' ) );\n add_action( 'woocommerce_process_product_meta', array( &$this, 'woo_qi_save_field_input' ) );\n }",
"public function testRemove() {\n $data = $this->expanded;\n $match = $data;\n\n unset($match['boolean']);\n $data = Hash::remove($data, 'boolean');\n $this->assertEquals($match, $data);\n\n unset($match['one']['depth']);\n $data = Hash::remove($data, 'one.depth');\n $this->assertEquals($match, $data);\n\n unset($match['one']['two']['depth']);\n $data = Hash::remove($data, 'one.two.depth');\n $this->assertEquals($match, $data);\n\n unset($match['one']['two']['three']['depth'], $match['one']['two']['three']['zero'], $match['one']['two']['three']['null']);\n $data = Hash::remove($data, 'one.two.three.depth');\n $data = Hash::remove($data, 'one.two.three.zero');\n $data = Hash::remove($data, 'one.two.three.null');\n $this->assertEquals($match, $data);\n\n unset($match['one']['two']['three']['four']['five']['six']['seven']['key']);\n $data = Hash::remove($data, 'one.two.three.four.five.six.seven.key');\n $this->assertEquals($match, $data);\n\n foreach (array(true, false, null, 123, 'foo') as $type) {\n $data = Hash::remove($data, $type);\n $this->assertEquals($match, $data);\n }\n\n $data = Hash::remove($data, 'a.fake.path');\n $this->assertEquals($match, $data);\n }",
"public function testContinueContinues()\n {\n $tierApp = new TierApp(new Injector(), new NullCallback());\n \n $fn1 = function () {\n return false;\n };\n \n $called = false;\n \n $fn2 = function () use (&$called) {\n $called = true;\n return TierApp::PROCESS_END;\n };\n \n $tierApp->addExecutable(0, $fn1);\n $tierApp->addExecutable(1, $fn2);\n $tierApp->executeInternal();\n \n $this->assertTrue($called);\n }",
"function test_import_key()\n\t{\n\t\t// Remove the following line when you implement this test.\n\t\treturn $this -> markTestSkipped();\n\t}",
"public function test_remove_filter_within_class_array( $hook ) {\n $removed = yourls_remove_filter( $hook, array( 'Change_Variable', 'change_it' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"function ywccp_get_custom_fields_key_filtered( $section = 'billing' ){\r\n\r\n\t\tglobal $pagenow;\r\n\r\n\t\t$fields = get_option( 'ywccp_fields_' . $section . '_options', array() );\r\n\r\n\t\tif( empty( $fields ) ) {\r\n\t\t\treturn array();\r\n\t\t}\r\n\r\n\t\t// check where I am\r\n\t\tif( ( is_admin() &&\r\n\t\t ( ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'shop_order' )\r\n\t\t || ( $pagenow == 'post.php' && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) ) ) || is_account_page() ) {\r\n\r\n\t\t\t$where_im = '';\r\n\t\t}\r\n\t\telseif( is_order_received_page() ) {\r\n\t\t\t$where_im = 'show_in_order';\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$where_im = 'show_in_email';\r\n\t\t}\r\n\t\t// remove fields based on where I am\r\n\t\tif( $where_im ) {\r\n\t\t\tforeach ( $fields as $key => $value ) {\r\n\t\t\t\tif( isset( $value[ $where_im ] ) && ! $value[ $where_im ] ) {\r\n\t\t\t\t\tunset( $fields[$key] );\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// default section keys\r\n\t\t$default_keys = ywccp_get_default_fields_key( $section );\r\n\t\t// fields keys\r\n\t\t$fields_keys = array_keys( $fields );\r\n\t\t// custom keys\r\n\t\t$fields_custom = array_diff( $fields_keys, $default_keys );\r\n\t\t// remove section\r\n\t\tforeach ( $fields_custom as &$value ) {\r\n\t\t\t$value = str_replace( $section . '_', '', $value );\r\n\t\t}\r\n\r\n\t\treturn $fields_custom;\r\n\t}",
"public function test_deleteReplenishmentProcessTag() {\n\n }",
"function testAddWithNewKey() {\r\n $counter = $this->actionForwards->size();\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key2\", \"Path 2!\")\r\n );\r\n $actionForward = $this->actionForwards->find(\"key2\");\r\n $this->assertEquals(\"key2\", $actionForward->getName(), \"Found wrong key!\");\r\n $this->assertEquals(\"Path 2!\", $actionForward->getPath(), \"Found wrong path!\");\r\n $this->assertTrue($this->actionForwards->size() == $counter + 1, \"Found wrong number of forwards!\");\r\n }",
"function process_bulk_action() {\r\n if( 'apporve'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n elseif( 'reject'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n \r\n }",
"public function testPostUpdatePermissionKeys() {\n // Login using root user.\n $this->drupalLogin($this->rootUser);\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that before updates the permission keys are in camelcase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertTrue($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertFalse($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertTrue($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertFalse($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n\n $this->runUpdates();\n\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that after updates the permission keys are in lowercase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertFalse($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertTrue($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertFalse($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertTrue($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n }",
"function remove($targetPath, $filter);",
"public function testPreprocessingUnrotate()\n {\n }",
"public function testAddActionAndNoKeyword()\n {\n // Mock the property object.\n $oProperty = $this->getMock('Hook\\Commit\\Diff\\Property', array(), array('tag'));\n $oProperty->expects($this->any())\n ->method('getOldValue')\n ->will($this->returnValue(''));\n\n $oProperty->expects($this->any())\n ->method('getNewValue')\n ->will($this->returnValue(''));\n\n $aParams = array(\n 'txn' => '666-1',\n 'rev' => 666,\n 'action' => 'A',\n 'item' => 'file.php',\n 'real' => 'file.php',\n 'ext' => 'php',\n 'isdir' => false,\n 'props' => array('tag' => $oProperty),\n 'lines' => null,\n 'info' => null\n );\n\n $oObject = new Object($aParams);\n\n $this->oIdListener->processAction($oObject);\n\n // Check.\n $aErrors = $oObject->getErrorLines();\n\n $this->assertSame(1, count($aErrors), 'Error count not 1.');\n $sMsg = 'Please add the \"svn:keywords - Id\" tag to the file.';\n $this->assertSame($sMsg, $aErrors[0], 'Error wrong.');\n }",
"function flag_note_for_deletion($module_key,$space_key,$link_key,$delete_action) \r\n{\r\n \r\n\treturn true;\r\n\r\n}",
"public function removeFilter($key);",
"public function testMultipleMultiDimensionalKeyGetsRemoved()\n {\n $this->filter->values([\n 'test.test.test',\n 'test.test2',\n 'test.test3.test'\n ])->remove();\n\n $result = $this->filter->filter([\n 'test' => [\n 'test' => [\n 'test' => 'test',\n ],\n 'test2' => 'test',\n 'test3' => [\n 'test' => 'test',\n ],\n ],\n 'test2' => 'test',\n ]);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }",
"public function testFilterWillNotPerformFilteringWithoutFilterKey(): void\n {\n $manager = new QueryFilterManager($this->filterFactory, $this->sortFactory);\n\n $this->queryBuilder->expects($this->once())\n ->method('getEntityManager')\n ->willReturn($this->entityManager);\n\n $this->entityManager->expects($this->once())\n ->method('getClassMetadata')\n ->with($this->entityName)\n ->willReturn($this->metadata);\n\n $this->filterFactory->expects($this->never())->method('create');\n\n $manager->filter($this->queryBuilder, $this->entityName, []);\n }",
"public function beforeStep($filter, $callback)\n {\n $this->hooks['step.before'][] = array($filter, $callback);\n }",
"public function test_add_several_actions_random_priorities() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n $total = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $total += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n $this->assertSame( $times, $total );\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 }",
"function test_init_action_is_run() {\n\t}",
"public function testGetReplenishmentByFilter()\n {\n }",
"public function processDeletePlaceholder() {}",
"public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}",
"public function test_remove_all_actions_random_prio() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str(), mt_rand( 1, 10 ) );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n yourls_remove_all_actions( $hook );\n $this->assertFalse( yourls_has_action( $hook ) );\n }",
"public function test_get_actions() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $actions = yourls_get_actions( $hook );\n $this->assertTrue(isset($actions[10]['some_function']));\n $this->assertTrue(isset($actions[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_actions( rand_str() ) );\n }",
"public function testNonExistentKey() {\n $source = [\n ['bar' => 'foo'],\n ];\n $this->expectException(MigrateException::class);\n $this->expectExceptionMessage(\"The key 'foo' does not exist\");\n $this->plugin->transform($source, $this->migrateExecutable, $this->row, 'destination_property');\n }",
"public function test_add_action_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, rand_str() );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Specific function name to test with yourls_do_action\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, 'change_one_global' );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}",
"public function testBypassPipe(): void\n {\n $passable = '(0)';\n $container = new Container();\n $pipeline = new Pipeline($container);\n\n $result = $pipeline\n ->send($passable)\n ->through([\n PipeOne::class => 'a',\n BypassPipe::class => 'c',\n PipeTwo::class => 'b',\n ])\n ->via('handle')\n ->then(function ($passable) {\n return $passable . '(e)';\n })\n ->run();\n\n self::assertEquals('(0)(1a)(-1a)', $result);\n }",
"function updateFilter($filter, $commands)\n{\n $result = $filter;\n if (is_array($commands))\n {\n //Go through all commands\n foreach ($commands as $key => $value):\n //Split operator and value\n $op = $key[0];\n $key = trim(substr($key, 1));\n //Only work if there is a value\n if ($value){\n //Delete value \n if (($op == 'd') && (is_array($result))){\n //Only delete if the key exists\n \tif (array_key_exists($key, $result)){\n \t //If the key is 'key' or 'genre' need to exclude from inner array\n \t\tif (($key == 'key') || ($key == 'genre')){\n \t\t //Only have to delete if the value is on the array\n \t\t\tif (($refKey = array_search($value, $result[$key])) !== false)\n \t\t\t //Delete the value from inner array\n \t\t\t\tunset($result[$key][$refKey]);\n\n \t\t//If it is a commom key, only delete the key\n \t\t} elseif (($key == 'language') || ($key == 'user_id') || ($key == 'serie') || ($key == 'author')) {\n \t\t\t\tunset($result[$key]);\n \t\t}\n \t}\n //Add or reset value\n } elseif ($op == 'a') {\n //If there is no array yet, it creates one\n if (!is_array($result))\n $result = array($key => null);\n\n //If the key doesn't exist yet, it creates it\n if (!array_key_exists($key, $result))\n $result = array_merge($result, array($key => null));\n\n //If the key is 'genre', need to add value to inner array\n \tif ($key == 'genre'){\n \t //If there is no inner array, it creates one\n if (!is_array($result[$key]))\n $result[$key] = array();\n \t //Only add the value to inner array if it doesn't exist\n \t if (($refKey = array_search($value, $result[$key])) == false)\n \t\t\tarray_push($result[$key], $value);\n\n \t//If the key is 'key', it will need to include every word on the inner array\n \t} elseif ($key == 'key'){\n \t //If there is no inner array, it creates one\n \t if (!is_array($result[$key]))\n $result[$key] = array();\n \t //Go through all the words\n $valueList = explode(' ', $value);\n \t\tforeach ($valueList as $subValue):\n \t //Only add the value to inner array if it doesn't exist\n \t\t if (($refKey = array_search($subValue, $result[$key])) == false)\n \t\t\t array_push($result[$key], $subValue);\n \t\tendforeach;\n\n //If it is a commom key, just change the value\n \t} elseif (($key == 'language') || ($key == 'user_id') || ($key == 'serie') || ($key == 'author')) {\n $result = Util::updateParam($result, array($key => $value));\n \t}\n }\n }\n endforeach;\n }\n \n //Delete keys with empty inner array\n if (is_array($filter)){\n if (array_key_exists('key', $filter))\n if ($result['key'] == null)\n unset($result['key']);\n \n if (array_key_exists('genre', $filter))\n if ($result['genre'] == null)\n unset($result['genre']);\n }\n \n return $result;\n}",
"function Step1_IntegrityHard() { return( $this->stepTest( 'integ_') ); }",
"public function test_multiple_filter_with_priority() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 9 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"2\" . \"1\", $filtered );\n\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; }, 10 );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; }, 11 );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n }",
"public function testGetCacheKey(): void\n {\n // If I have a method\n $uut = $this->getMethod($this->method);\n\n // I expect the active modules tracker key to be returned\n $moduleManager = $this->getMockManager($this->method);\n $expected = \"modules-cache\";\n $this->assertSame($expected, $uut->invoke($moduleManager));\n }",
"public function assertArrayHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayHasKey', func_get_args()));\n }",
"public function assertArrayHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayHasKey', func_get_args()));\n }",
"public function testRetryStepShouldNotFailStep()\n {\n $moduleContainer = Stub::make(ModuleContainer::class, [\n 'moduleForAction' => $this\n ]);\n // run an action from this class\n $retry = new \\Codeception\\Step\\Retry('_executeFailedCode', [], 2, 0);\n $retry->run($moduleContainer);\n // see a first failed action should not fail step\n $this->assertFalse($retry->hasFailed(), 'successful retry still marks test as failed');\n }",
"public function _processUrlKeys()\n {\n return true;\n }"
] | [
"0.71910894",
"0.5436694",
"0.5326946",
"0.51743805",
"0.5116195",
"0.49828285",
"0.49818963",
"0.49506244",
"0.48371398",
"0.48229936",
"0.48151606",
"0.4800575",
"0.47229818",
"0.4705595",
"0.46993807",
"0.46828488",
"0.46654025",
"0.46615893",
"0.46502796",
"0.46337062",
"0.46166137",
"0.46018928",
"0.457826",
"0.4577247",
"0.45474544",
"0.4541196",
"0.45285097",
"0.4525837",
"0.45245892",
"0.45212746",
"0.45166308",
"0.45106092",
"0.4475412",
"0.44737887",
"0.44666716",
"0.4457902",
"0.4457902",
"0.44561264",
"0.44529995",
"0.44298762",
"0.4424247",
"0.4410809",
"0.4404192",
"0.43827984",
"0.43569627",
"0.43478987",
"0.4338036",
"0.4337559",
"0.43331817",
"0.43307823",
"0.43266362",
"0.43224356",
"0.43200117",
"0.43184584",
"0.43151993",
"0.4309624",
"0.43059367",
"0.42918366",
"0.42879286",
"0.4286992",
"0.42780972",
"0.42777172",
"0.42726398",
"0.42712417",
"0.42694047",
"0.42628127",
"0.42605263",
"0.42509052",
"0.4250247",
"0.42355976",
"0.42337924",
"0.4231691",
"0.42301813",
"0.42234758",
"0.4216263",
"0.4214481",
"0.4206224",
"0.41811934",
"0.41776642",
"0.417537",
"0.41735256",
"0.41695425",
"0.41629675",
"0.41591507",
"0.41587263",
"0.415318",
"0.41482475",
"0.4143018",
"0.4141633",
"0.4139266",
"0.41392383",
"0.41370493",
"0.41361555",
"0.41361526",
"0.41353717",
"0.4133072",
"0.41300592",
"0.41300592",
"0.4122406",
"0.41201687"
] | 0.74772835 | 0 |
This function takes a desired return for the EntityObjectHandler mock and performs set up of the mock for the duration of a single test case. | private function setEntityObjectHandlerReturn($return)
{
$instance = AspectMock::double(DataObjectHandler::class, ['getObject' => $return])
->make(); // bypass the private constructor
AspectMock::double(DataObjectHandler::class, ['getInstance' => $instance]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setUp()\n {\n $this->mock = m::mock('Eloquent', 'App\\User', $this->value);\n $this->object = new UserEntity($this->mock);\n }",
"protected function _prepareMockObjects()\n {\n $this->requestMock = $this->getMockBuilder(\\Magento\\Framework\\App\\Request\\Http::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->objectManagerMock = $this->createMock(\\Magento\\Framework\\ObjectManagerInterface::class);\n $this->storeManagerMock = $this->getMockForAbstractClass(\\Magento\\Store\\Model\\StoreManagerInterface::class);\n $this->storeModelMock = $this->createPartialMock(\\Magento\\Store\\Model\\Store::class, ['__wakeup', 'getId']);\n $this->reviewMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Review::class,\n ['__wakeup', 'create', 'save', 'getId', 'getResource', 'aggregate', 'getEntityIdByCode']\n );\n $this->reviewFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\ReviewFactory::class, ['create']);\n $this->ratingMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Rating::class,\n ['__wakeup', 'setRatingId', 'setReviewId', 'addOptionVote']\n );\n $this->ratingFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\RatingFactory::class, ['create']);\n $this->resultFactoryMock = $this->getMockBuilder(\\Magento\\Framework\\Controller\\ResultFactory::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->resultRedirectMock = $this->getMockBuilder(\\Magento\\Backend\\Model\\View\\Result\\Redirect::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->resultFactoryMock->expects($this->any())\n ->method('create')\n ->with(ResultFactory::TYPE_REDIRECT, [])\n ->willReturn($this->resultRedirectMock);\n }",
"protected function setUp()\n {\n $this->object = new Entity;\n }",
"public function setUp() {\n\t\t$this->mockDecoratedRequestEngine = $this->getMockBuilder('TYPO3\\Flow\\Http\\Client\\RequestEngineInterface')->getMock();\n\t\t$this->cacheAwareRequestEngine = new CacheAwareRequestEngine($this->mockDecoratedRequestEngine);\n\n\t\t$this->mockRequestCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\VariableFrontend')->disableOriginalConstructor()->getMock();\n\t\t$this->inject($this->cacheAwareRequestEngine, 'requestCache', $this->mockRequestCache);\n\n\t\t# simulating a date in order to test absolute expiration dates\n\t\t$this->mockNow = new Now('Sat, 13 Dec 2014 20:00:00 +0100');\n\t\t$this->inject($this->cacheAwareRequestEngine, 'now', $this->mockNow);\n\n\t\t# we use real request/response objects by intention (otherwise there are too many mocks to create)\n\t\t$this->mockRequest = new Request(array(), array(), array(), array());\n\t\t$this->mockResponse = new Response();\n\t}",
"protected function setUp() : void {\n $this->databaseConnector = \\Mockery::mock(DataBaseConnector::class);\n $this->entityManagerOK = \\Mockery::mock(EntityManager::class);\n $this->entityManagerOK->shouldReceive('insertUser')->andReturn(true);\n }",
"protected function setUp()\n {\n $this->object = $this->createMock(AbstractRequest::class, [\n $this->getHttpClient(),\n $this->getHttpRequest(),\n self::TOKEN,\n \\Omnipay\\Rede\\Gateway::TEST_ENDPOINT\n ]);\n }",
"protected function setUp()\n {\n $this->entity = $this->getMockForAbstractClass('VisioCrudModeler\\Model\\TableGateway\\Entity\\AbstractEntity');\n }",
"protected function setUp()\n {\n $this->object = $this->getMockForAbstractClass('Ise\\Bread\\Entity\\AbstractEntity');\n }",
"protected function mockEntityManager()\n {\n $originA = $this->makeOrigin('192.168.21', 'Sede A', true); \n $originRepository = $this->createMock(OriginRepository::class);\n $originRepository->expects($this->once())\n ->method('findAll')\n ->willReturn([$originA]);\n $entityManager = $this->createMock(EntityManagerInterface::class);\n $entityManager->expects($this->exactly(1))\n ->method('getRepository')\n ->withConsecutive([Origin::class])\n ->willReturnOnConsecutiveCalls($originRepository);\n $entityManager->expects($this->once())\n ->method('persist');\n $entityManager->expects($this->once())\n ->method('flush');\n return $entityManager;\n }",
"public function setUp(): void\n {\n $this->objectManager = Bootstrap::getObjectManager();\n $this->auth = $this->objectManager->create(Auth::class);\n $this->urlBuilder = $this->objectManager->create(UrlBuilder::class);\n\n $this->httpResponseGet = $this->createPartialMock(HttpResponse::class, [\n 'getBody'\n ]);\n $this->httpClientGet = $this->getMockBuilder(HttpClient::class)\n ->disableOriginalConstructor()\n ->setMethods([\n 'request'\n ])\n ->getMock();\n $this->httpClientFactoryGet = $this->createConfiguredMock(\n HttpClientFactory::class,\n ['create' => $this->httpClientGet]\n );\n $this->inventoryCenterApiGet = $this->objectManager->create(InventoryCenterApiGet::class, [\n 'httpClientFactory' => $this->httpClientFactoryGet,\n ]);\n\n $this->storeManager = $this->objectManager->create(StoreManager::class);\n\n $this->jsonSerializer = $this->objectManager->create(Json::class);\n\n $this->dataObjectFactory = $this->objectManager->create(DataObjectFactory::class);\n\n $this->subject = $this->objectManager->create(Subject::class, [\n 'flowCentersApiClient' => $this->inventoryCenterApiGet\n ]);\n }",
"public function setUp() {\n\t\t$this->mockObjectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface');\n\t\t$this->mockObjectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface');\n\t\t$this->mockReflectionService = $this->getMock('F3\\FLOW3\\Reflection\\ReflectionService');\n\t\t$this->mockReflectionService->expects($this->any())->method('getPropertyNamesByTag')->will($this->returnValue(array()));\n\n\t\t$this->objectBuilder = new \\F3\\FLOW3\\Object\\ObjectBuilder();\n\t\t$this->objectBuilder->injectObjectManager($this->mockObjectManager);\n\t\t$this->objectBuilder->injectObjectFactory($this->mockObjectFactory);\n\t\t$this->objectBuilder->injectReflectionService($this->mockReflectionService);\n\t}",
"protected function setUp()\n\t{\n\t\t$this->instance = new Entity($this->getTestFields(), $this->getTestData());\n\t}",
"public function setUp() {\n $this->request = $this->getMock('Imbo\\Http\\Request\\RequestInterface');\n $this->response = $this->getMock('Imbo\\Http\\Response\\ResponseInterface');\n $this->database = $this->getMock('Imbo\\Database\\DatabaseInterface');\n $this->storage = $this->getMock('Imbo\\Storage\\StorageInterface');\n $this->event = $this->getMock('Imbo\\EventManager\\EventInterface');\n $this->manager = $this->getMock('Imbo\\EventManager\\EventManager');\n $this->event->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));\n $this->event->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));\n $this->event->expects($this->any())->method('getDatabase')->will($this->returnValue($this->database));\n $this->event->expects($this->any())->method('getStorage')->will($this->returnValue($this->storage));\n $this->event->expects($this->any())->method('getManager')->will($this->returnValue($this->manager));\n\n $this->resource = $this->getNewResource();\n }",
"protected function setUp(): void\n {\n $this->mockObjectManager = $this->createMock(ObjectManagerInterface::class);\n $this->route = $this->getAccessibleMock(Routing\\Route::class, ['dummy']);\n $this->route->_set('objectManager', $this->mockObjectManager);\n\n $this->mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);\n $this->mockPersistenceManager->method('convertObjectsToIdentityArrays')->will(self::returnCallBack(function ($array) {\n return $array;\n }));\n $this->inject($this->route, 'persistenceManager', $this->mockPersistenceManager);\n }",
"protected function setUp() {\n $this->object = new UploadHandler;\n }",
"protected function setUp() {\n $this->object = new ConfigHandler;\n }",
"public function setUp(): void\n {\n $this->tokenMock = $this->createMock('Omise\\Payment\\Helper\\TokenHelper');\n $this->urlMock = $this->createMock('Magento\\Framework\\UrlInterface');\n $this->model = new ReturnUrlHelper($this->urlMock, $this->tokenMock);\n }",
"protected function setUp(): void\n {\n $this->object = new OpenID_Extension_Mock(OpenID_Extension::REQUEST);\n }",
"protected function setUp()\n\t{\n\t\t$this->object = new Response;\n\t}",
"public function setUp(): void\n {\n $this->eventName = EntityEventName::UPDATE;\n\n $this->persistService = $this->createMock(PersistServiceInterface::class);\n\n $this->entityManager = $this->createMock(EntityManagerInterface::class);\n\n $this->logger = $this->createMock(LoggerInterface::class);\n }",
"protected function setUp() {\n\t\t$this->object = $this->getMockBuilder('hypeJunction\\\\Scraper\\\\Hasher')->disableOriginalConstructor()->getMock();\n\t}",
"public function setup()\n {\n $mock = new MockHandler([\n new Response(200, ['X-Foo' => 'Bar'], json_encode([\n 'output_ResponseCode' => 'INS-0',\n 'output_ResponseDesc' => 'Request processed successfully',\n 'output_SessionID' => 1\n ])),\n new Response(200, ['X-Foo' => 'Bar'], json_encode([\n 'output_ResponseCode' => 'INS-0',\n 'output_ResponseDesc' => 'Request processed successfully',\n 'output_TransactionID' => 2,\n 'output_ConversationID' => 'f1ddae567e6c45e580504764571dbe2f',\n 'output_ThirdPartyConversationID' => 'Narration',\n ])),\n new Response(202, ['Content-Length' => 0]),\n new RequestException('Error Communicating with Server', new Request('GET', 'test'))\n ]);\n\n $handlerStack = HandlerStack::create($mock);\n\n $client = new Client(['handler' => $handlerStack]);\n\n $this->forodha = new Forodha([\n 'api_key' => Fixture::$apiKey,\n 'public_key' => Fixture::$publicKey,\n ], $client);\n }",
"public function setUp()\n {\n // Create a mock handler\n $this->mock = new MockHandler();\n $handler = HandlerStack::create($this->mock);\n\n // Add history middleware to the client for inspecting requests\n $this->history = [];\n $handler->push(Middleware::history($this->history));\n\n // Create a Guzzle client whose requests can be inspected and responses\n // are mocked\n $this->guzzle = new Client(['handler' => $handler]);\n\n // Create faker instance for faking data\n $this->faker = \\Faker\\Factory::create();\n\n // Create an event loop\n $this->loop = Factory::create();\n\n // Create the API client\n $this->client = new ApiClient($this->loop, $this->guzzle);\n\n // Initialize exception queue\n $this->exceptionQueue = new \\SplQueue();\n }",
"protected function setUp()\r\n {\r\n $this->object = new TestAsset\\ConcreteEntity;\r\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->data[$this->identifier] = 1;\n\n $this->entity = new $this->class($this->data);\n }",
"protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }",
"protected function setUp() {\n $this->object = new HttpRequestBuilder();\n }",
"public function setUp(): void\n {\n $this->objectManager = Bootstrap::getObjectManager();\n $this->httpResponse = $this->createPartialMock(HttpResponse::class, ['getStatusCode']);\n $httpPromise = $this->objectManager->create(HttpPromise::class, [\n 'waitFn' => function () use (&$httpPromise) {\n $httpPromise->resolve($this->httpResponse);\n }\n ]);\n $this->httpPromise = $httpPromise;\n $this->httpClient = $this->getMockBuilder(HttpClient::class)\n ->disableOriginalConstructor()\n ->setMethods([\n 'postAsync'\n ])\n ->getMock();\n\n $this->httpClientFactory = $this->createConfiguredMock(\n HttpClientFactory::class,\n ['create' => $this->httpClient]\n );\n $this->itemUpdateApiClient = $this->objectManager->create(InventoryUpdatesApiClient::class, [\n 'httpClientFactory' => $this->httpClientFactory,\n ]);\n $this->subject = $this->objectManager->create(Subject::class, [\n 'itemUpdateApiClient' => $this->itemUpdateApiClient,\n ]);\n $this->createProductsFixture = $this->objectManager->create(CreateProductsWithCategories::class);\n $this->productRepository = $this->objectManager->create(ProductRepository::class);\n $this->inventorySyncRepository = $this->objectManager->create(InventorySyncRepository::class);\n $this->searchCriteriaBuilder = $this->objectManager->create(SearchCriteriaBuilder::class);\n $this->auth = $this->objectManager->create(Auth::class);\n $this->urlBuilder = $this->objectManager->create(UrlBuilder::class, [\n 'auth' => $this->auth\n ]);\n $this->storeManager = $this->objectManager->create(StoreManager::class);\n }",
"private function configureMock()\n {\n $this->controller->expects($this->once())->method('doSomething')->with($this->parameters);\n }",
"protected function setUp()\n {\n $this->storeManager = $this->getMockBuilder(StoreManager::class)\n ->disableOriginalConstructor()\n ->setMethods(['getStore'])\n ->getMockForAbstractClass();\n $this->coreRegistry = $this->getMockBuilder(Registry::class)\n ->disableOriginalConstructor()\n ->setMethods(['registry'])\n ->getMock();\n\n $objectManager = new ObjectManagerHelper($this);\n\n $this->resolver = $objectManager->getObject(\n CategoryName::class,\n [\n 'storeManager' => $this->storeManager,\n 'coreRegistry' => $this->coreRegistry,\n ]\n );\n }",
"protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$this->options = new Registry;\n\t\t$this->object = $this->getMockForAbstractClass('JAmazons3Object', array($this->options));\n\t}",
"protected function setUp()\n {\n $this->object = new Ticket(new Mapper());\n }",
"protected function setUp()\n {\n $this->object = $this->getMock\n (__NAMESPACE__ . '\\\\FastStatement',\n array ('SQL', $this->getMock('proof\\sql\\PDOProvider')));\n\n }",
"final protected function getMockHandler(): MockHandler\n {\n $this->mockHandler = new MockHandler();\n\n return $this->mockHandler;\n }",
"function mockCreateInitialProducts() {\n $listaProdutos = &obterListaProdutos();\n\n $produto = createProduct(\"Caneca de Vidro\", \"Caneca\", \"Suporta 350 ml\", 100, 50.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n\n $produto = createProduct(\"Caneca de Plastico\", \"Caneca\", \"Suporta 500 ml\", 200, 20.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n}",
"protected function setUp()\n {\n $this->object = new AsyncTraitStub;\n }",
"protected function setUp()\n {\n $this->object = new TestAutoGetSetProps;\n }",
"protected function setUp()\n {\n// $this->object = new DomainUtils;\n }",
"public function setUp()\n {\n $this->purchase = new Purchase();\n // Now, mock the repository so it returns the mock of the purchase repo\n $this->purchaseRepository = $this->createMock(PurchaseRepository::class);\n // Last, mock the EntityManager to return the mock of the repository\n $this->em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')\n ->disableOriginalConstructor()\n ->setMethods(['getRepository']) // We indicates that a method will be defined\n ->getMock();\n $this->em->method('getRepository')->willReturn($this->purchaseRepository);\n }",
"public function setUp() {\n $this->itemCommandFactoryMock = $this->getMockBuilder(\n CommandFactoryInterface::class\n )->getMock();\n $this->itemCommandFactoryMock->expects($this->any())\n ->method('create')\n ->will($this->returnCallback(function($value) {\n return 'mocked ' . $value;\n }));\n \n }",
"protected function setUp() {\n\t\t$this->_tableGateway = $this->_getCleanMock('Zend_Db_Table_Abstract');\n\t\t$this->_adapter = $this->_getCleanMock('Zend_Db_Adapter_Abstract');\n\t\t$this->_rowset = $this->_getCleanMock('Zend_Db_Table_Rowset_Abstract');\n\t\t$this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));\n\n\t\t$this->object = new GTW_Model_User_Mapper($this->_tableGateway);\n\t}",
"protected function setUp()\n {\n //$this->object = new Middleware;\n }",
"public function setUp() {\n\t\t_elgg_services()->setValue('session', \\ElggSession::getMock());\n\n\t\t$this->obj = $this->getMockBuilder('\\ElggUpgrade')\n\t\t\t\t->setMethods(null)\n\t\t\t\t->getMock();\n\n\t\t$this->obj->_callable_egefps = array($this, 'mock_egefps');\n\t}",
"public function setUp()\n {\n $this->mockConnection = $this->getMock('stubDatabaseConnection');\n $this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));\n $this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();\n $databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);\n $databaseQueryBuilderProvider->expects($this->any())\n ->method('create')\n ->will($this->returnValue($this->mockQueryBuilder));\n $this->dbEraser = new stubDatabaseEraser($databaseQueryBuilderProvider);\n }",
"private function mockEmployee()\n {\n $this->employeeS = $this->getMockBuilder('Employee')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->employeeS\n ->method('can')\n ->willReturn(true);\n }",
"protected function setUp()\n\t{\n\t\t$this->_mock = $this->getMock( 'T3Cache' );\n\t\t$this->_object = new MW_Cache_Typo3( array(), $this->_mock );\n\t}",
"protected function setUp() {\n parent::setUp();\n\n $this->object = new BaseStub();\n }",
"public function setUp()\n {\n $this->request = Phake::mock('Symfony\\Component\\HttpFoundation\\Request');\n Phake::when($this->request)->getLocale()->thenReturn($this->locale);\n $this->media = Phake::mock('OpenOrchestra\\Media\\Model\\MediaInterface');\n $this->templating = Phake::mock('Symfony\\Bundle\\FrameworkBundle\\Templating\\EngineInterface');\n $this->mediaStorageManager = Phake::mock('OpenOrchestra\\Media\\Manager\\MediaStorageManagerInterface');\n\n $this->container = Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerInterface');\n Phake::when($this->container)->get('templating')->thenReturn($this->templating);\n Phake::when($this->container)->get('open_orchestra_media.manager.storage')->thenReturn($this->mediaStorageManager);\n }",
"protected function setUp()\n\t{\n\t\t$this->values = array(\n\t\t\t'id' => 'product/id/1:detail-body',\n\t\t\t'siteid' => 1,\n\t\t\t'value' => 'test',\n\t\t\t'expire' => '2000-01-01 00:00:00',\n\t\t\t'tags' => array( 'tag:1', 'tag:2' ),\n\t\t);\n\n\t\t$this->object = new \\Aimeos\\MAdmin\\Cache\\Item\\Standard( $this->values );\n\t}",
"protected function setUp() {\n\t\tinclude ('config.php');\n\t\t\n\t\t$transport = getTransport($config);\t\n\t\t$mapper = new XmlMapper();\n\t\t$this->apiConnector = new ApiConnector($config['clientname'], $transport, $mapper);\n\t\t$this->service = $this->apiConnector->getService('Invoice');\n\t\tif (!is_null(self::$invoiceId)) {\n\t\t\t$this->object = $this->service->getById(self::$invoiceId);\n\t\t}\n\t}",
"protected function setUp() {\n $this->object = new acModel;\n }",
"public function mockAllTheThings()\n {\n // Mock Classes\n $this->settings = Mockery::mock(SettingsInterface::class);\n $this->container = Mockery::mock('alias:Container');\n $this->collection = Mockery::mock(CollectionInterface::class);\n $this->idxfactory = Mockery::mock(IDXFactoryInterface::class);\n $this->db = Mockery::mock(DBInterface::class);\n $this->idx = Mockery::mock(IDX::class);\n $this->cache = Mockery::mock('alias:Cache');\n $this->cache->shouldReceive('getCache')->andReturnNull();\n $this->cache->shouldReceive('setCache');\n\n // Mock IDX methods\n $this->idxfactory->shouldReceive('getIdx')->andReturn($this->idx);\n $this->idxfactory->shouldReceive('getDatabase')->andReturn($this->db);\n $this->idx->shouldReceive('getTable')->andReturn('_rewidx_listings');\n $this->idx->shouldReceive('getName')->andReturn('MFR');\n $this->db->shouldReceive('db')->andReturn('rewidx_mfr');\n $this->idx->shouldReceive('executeSearchWhereCallback');\n\n // Mock methods\n $this->container->shouldReceive('getInstance')->andReturn($this->container);\n $this->settings->IDX_FEED = self::IDX_FEED;\n $this->container->shouldReceive('get')->with(SettingsInterface::class)->andReturn($this->settings);\n $this->container->shouldReceive('get')->with(IDXFactoryInterface::class)->andReturn($this->idxfactory);\n // Mock Collection and Hooks objects\n $this->collection = Mockery::mock(CollectionInterface::class);\n $this->hooks = Mockery::mock(HooksInterface::class)->makePartial();\n $this->locale = Mockery::mock('alias:Locale')\n ->shouldReceive('spell')->andReturn('string')->getMock();\n\n // Make sure hooks run\n $this->hooks->shouldReceive('hook')->with(HooksInterface::HOOK_IDX_PANEL_SETTINGS)\n ->andReturn($this->collection);\n $this->collection->shouldReceive('run');\n $this->hooks->shouldReceive('hook')->with(HooksInterface::HOOK_IDX_PANEL_CONSTRUCT)\n ->andReturn($this->collection);\n $this->collection->shouldReceive('run')->with(IDX_Panel::class);\n $this->container->shouldReceive('get')->with(HooksInterface::class)->andReturn($this->hooks);\n // Mock methods\n $this->container->shouldReceive('getInstance')->andReturn($this->container);\n $this->settings->IDX_FEED = self::IDX_FEED;\n $this->container->shouldReceive('get')->with(SettingsInterface::class)->andReturn($this->settings);\n $this->container->shouldReceive('get')->with(IDXFactoryInterface::class)->andReturn($this->idxfactory);\n }",
"protected function setUp()\n {\n $this->serializerMock = $this->getMockBuilder(\\Magento\\Framework\\Serialize\\Serializer\\Json::class)\n ->disableOriginalConstructor()\n ->setMethods(['serialize', 'unserialize'])\n ->getMock();\n\n $this->serializerMock->expects($this->any())\n ->method('serialize')\n ->will(\n $this->returnCallback(\n function ($value) {\n return json_encode($value);\n }\n )\n );\n\n $this->serializerMock->expects($this->any())\n ->method('unserialize')\n ->will(\n $this->returnCallback(\n function ($value) {\n return json_decode($value, true);\n }\n )\n );\n\n $this->attributeMock = $this->getMockBuilder(\\Magento\\Eav\\Model\\Entity\\Attribute::class)\n ->disableOriginalConstructor()\n ->setMethods(['getAttributeCode'])\n ->getMock();\n\n $this->attributeMock->expects($this->any())\n ->method('getAttributeCode')\n ->will($this->returnValue('json_encoded'));\n\n $this->model = new JsonEncoded($this->serializerMock);\n $this->model->setAttribute($this->attributeMock);\n }",
"protected function setUp(): void\n {\n resetLog();\n $this->object = new AmazonFulfillmentOrder('testStore', null, true, null);\n }",
"protected function setUp()\n {\n $this->object = Factory::slim();\n }",
"protected function setUp()\n {\n $objectManager = new ObjectManager($this);\n $this->conditionFactoryMock = $this->getMock(ConditionInterfaceFactory::class, ['create'], [], '', false);\n\n $this->model = $objectManager->getObject(\n ConditionConverter::class,\n ['conditionFactory' => $this->conditionFactoryMock]\n );\n }",
"protected function createMockEntity() {\n $entity = $this->getMockBuilder('Drupal\\entity_test\\Entity\\EntityTest')\n ->disableOriginalConstructor()\n ->getMock();\n\n $entity->expects($this->any())\n ->method('hasTranslation')\n ->willReturnMap([\n [LanguageInterface::LANGCODE_NOT_SPECIFIED, TRUE],\n ['xx-lolspeak', FALSE],\n ]);\n $entity->expects($this->any())\n ->method('hasField')\n ->willReturnMap([\n ['valid', TRUE],\n ['not_valid', FALSE],\n ]);\n\n return $entity;\n }",
"protected function setUp()\n {\n\n $controller = $this->getMock(__NAMESPACE__.\"\\\\Controller\");\n\n $aggregate = $this->getMockForAbstractClass(\"proof\\util\\AbstractAggregate\");\n\n $this->object = new Fork (new \\stdClass, $controller, $aggregate);\n\n }",
"public function setUp()\n {\n $this->mockLogger = $this->getMock('stubLogger',\n array(),\n array($this->getMock('stubLogEntryFactory'))\n );\n $this->emptyLogEntryFactory = new stubEmptyLogEntryFactory();\n $this->logEntry = $this->emptyLogEntryFactory->create('testTarget', $this->mockLogger);\n }",
"protected function setUp()\n {\n parent::setUp();\n $this->service = $this->getMockForAbstractClass(\n AbstractEntityService::class\n );\n }",
"protected function setUp()\r\n {\r\n $this->object = new AuthClientResource;\r\n $this->ref = new \\ReflectionObject($this->object);\r\n $this->identityRef = $this->ref->getProperty('identity');\r\n $this->identityRef->setAccessible(true);\r\n $this->propertiesRef = $this->ref->getProperty('properties');\r\n $this->propertiesRef->setAccessible(true);\r\n $this->innerIdRef = $this->ref->getProperty('innerId');\r\n $this->innerIdRef->setAccessible(true);\r\n }",
"protected function setUp()\n {\n parent::setUp();\n $this->em = $this->getMockBuilder('\\Doctrine\\ORM\\EntityManager')\n ->disableOriginalConstructor()->setMethods(array(\"getMetadataFactory\", \"getMetadataFor\", \"getName\", \"getClassMetadata\"))\n ->getMock();\n\n $this->photo = $this->getMockBuilder(Photo::class)\n ->disableOriginalConstructor()->getMock()\n ->expects($this->any())\n ->method('getId')\n ->will($this->returnValue(1));\n\n $this->video = $this->getMockBuilder(Video::class)\n ->disableOriginalConstructor()->getMock()\n ->expects($this->any())\n ->method('getId')\n ->will($this->returnValue(1));\n\n $this->keywords = new ArrayCollection();\n $tag1 = new Keyword();\n $tag1->setContent(\"test1\");\n $tag2 = new Keyword();\n $tag2->setContent(\"test2\");\n $this->keywords->add($tag1);\n $this->keywords->add($tag2);\n }",
"protected function setUp()\n {\n $this->object = $this->getMockForAbstractClass('Versionable\\Prospect\\Header\\Header');\n }",
"protected function setUp()\n {\n global $db;\n $this->object = new testSmartObject();\n $this->object->db = $db;\n }",
"public function setup() {\n parent::setUp();\n $this->assertEquals(true, is_object($this->_em));\n $this->model = $this->_em->getRepository('Auth_Model_AccountEvent');\n }",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n 'Ruon\\\\Loader\\\\LoaderAutoloadAbstract'\n );\n\t}",
"public function setUp(): void\n {\n parent::setUp();\n\n $this->repository = \\Mockery::mock(ApplicantRepository::class);\n $this->manager = new DatabaseManager($this->repository);\n }",
"protected function setUp() {\n\t\t$this->objectRegistry = new \\F3\\FLOW3\\Object\\TransientRegistry();\n\t}",
"public function getEntityTypeManagerMock(){\n $manager = $this->prophet->prophesize('Drupal\\Core\\Entity\\EntityTypeManagerInterface');\n $storage = $this->getStorageMock()->reveal();\n try {\n $manager->getStorage(Argument::type('string'))->willReturn($storage);\n } catch (InvalidPluginDefinitionException $e) {\n } catch (PluginNotFoundException $e) {\n }\n return $manager;\n }",
"protected function setUp()\n {\n $this->object = new QueryDelete('foobar');\n }",
"public function setUp() : void {\n parent::setUp();\n\n $this->companyRepositoryInterface = Mockery::mock(CompanyRepositoryInterface::class);\n $this->app->instance(CompanyRepositoryInterface::class, $this->companyRepositoryInterface);\n\n $this->companyGetService = App::make(CompanyGetService::class);\n }",
"public function setUp()\n {\n $this->logger = NewInstance::stub(Logger::class);\n $this->timedLogEntryFactory = new TimedLogEntryFactory();\n $this->logEntry = $this->timedLogEntryFactory->create(\n 'testTarget',\n $this->logger\n );\n }",
"protected function setUp()\n {\n $this->media = new Media();\n $this->object = new RemoteAudioHelper($this->media);\n }",
"protected function setUp() {\n\t\tparent::setUp ();\n\t\t\n\n\t\t$this->_modelBase = new ModelConcreteClassStubbed(/* parameters */);\n\t\n\t}",
"protected function setUp() {\n $this->object = new LyvDAL;\n }",
"public function setUp()\n\t{\n\t\t$this->handler = new DbHandler();\n\t}",
"public function setUp()\n {\n $this->mockConnection = $this->getMock('stubDatabaseConnection');\n $this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));\n $this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();\n $databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);\n $databaseQueryBuilderProvider->expects($this->any())\n ->method('create')\n ->will($this->returnValue($this->mockQueryBuilder));\n $this->dbFinder = new stubDatabaseFinder($databaseQueryBuilderProvider);\n }",
"protected function setUp()\n {\n $this->object = new Client;\n }",
"protected function setUp()\n {\n $cache = new VoidCache();\n $this->client = new MockClient($cache);\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->autorizacao = $this->getMockBuilder(Autorizacao::class)->disableOriginalConstructor()->getMock();\n $this->transacao = $this->getMockBuilder(Transacao::class)->disableOriginalConstructor()->getMock();\n $this->object = $this->getMockForAbstractClass(Requisicao::class, [$this->autorizacao, $this->transacao]);\n }",
"public function setUp()\n {\n parent::setUp();\n $this->mock = $this->initMock(TodayService::class);\n $this->target = $this->app->make(TodayController::class);\n }",
"protected function setUp() {\t\t\r\n\t\t$this->object = new Expression();\r\n\t}",
"protected function setUp()\n {\n $this->converter = $this->getMockBuilder(ConverterInterface::class)\n ->disableOriginalConstructor()\n ->setMethods(['convert'])\n ->getMockForAbstractClass();\n $objectManager = new ObjectManagerHelper($this);\n\n $this->resolver = $objectManager->getObject(\n \\Magento\\Elasticsearch\\Model\\Adapter\\FieldMapper\\Product\\FieldProvider\\FieldIndex\\IndexResolver::class,\n [\n 'converter' => $this->converter\n ]\n );\n }",
"protected function setUp()\n {\n $this->object = new QueryCreate('foobar');\n }",
"protected function setUp()\n {\n $this->object = new QueryCreate('foobar');\n }",
"protected function setUp()\n\t{\n\t\t$this->object = new object('obj att', 'obj att2');\n\t}",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n\t\t\t'Ruon\\\\Loader\\\\LoaderAbstract'\n\t\t);\n\t}",
"protected function setUp()\n {\n parent::setUp();\n\n $objectManager = new ObjectManager($this);\n\n $this->jsonHelperMock = $this->getMockBuilder(Data::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->urlBuilderMock = $this->getMockBuilder(UrlInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->layoutBlockMock = $this->getMockBuilder(LayoutBlock::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->plugin = $objectManager->getObject(Layout::class, [\n 'urlBuilder' => $this->urlBuilderMock,\n 'jsonHelper' => $this->jsonHelperMock\n ]);\n }",
"protected function setUp()\n {\n $this->object = new Request;\n }",
"protected function setUp() {\n $this->object = new HeaderModel;\n }",
"protected function setUp()\n {\n $this->object = new \\Yana\\Db\\Ddl\\Functions\\Implementation();\n }",
"protected function setUp() {\n $this->object = new CallableActionProxy(function() {\n return 'test_proxy';\n });\n }",
"protected function setUp()\r\n {\r\n $this->object = new DocumentStructureMapper(3, 'documentmapper', '#', 'MockObject');\r\n }",
"protected function setUp()\n {\n $this->object = new HttpParams();\n\n }",
"public function setUp()\n {\n $this->mockVariantsMap = $this->getMock('stubVariantsMap');\n $this->abstractVariantFactory = new TeststubAbstractVariantFactory($this->mockVariantsMap);\n }",
"protected function setUp() {\n $this->object = new ServiceStructure;\n $this->object->setId(1);\n $this->object->setName('service');\n $this->object->setObjectId(2);\n }",
"protected function setUp()\n {\n $this->object = new Factory();\n }",
"protected function setUp()\n {\n $this->object = new CommonTransformer;\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}",
"private function mockCache()\n {\n $this->objectManager->configure([\n 'preferences' => [\n Cache::class => DummyCache::class\n ]\n ]);\n }"
] | [
"0.6571329",
"0.6288633",
"0.6287574",
"0.61066675",
"0.60748005",
"0.600548",
"0.59620893",
"0.59560007",
"0.5941131",
"0.5935079",
"0.5923942",
"0.5920214",
"0.5917649",
"0.59144336",
"0.59088993",
"0.5873484",
"0.5873246",
"0.5869505",
"0.58603555",
"0.58421516",
"0.58403236",
"0.58374846",
"0.58305335",
"0.5822978",
"0.58228946",
"0.58101666",
"0.5804029",
"0.58021057",
"0.5779152",
"0.5763991",
"0.5749681",
"0.5747035",
"0.57416433",
"0.5714626",
"0.5707407",
"0.56854486",
"0.56723404",
"0.56721115",
"0.56688803",
"0.56644475",
"0.5661822",
"0.56594676",
"0.5647131",
"0.5645198",
"0.5642589",
"0.56181836",
"0.5616405",
"0.56148565",
"0.56124747",
"0.5604041",
"0.5599358",
"0.5592284",
"0.5590349",
"0.5584128",
"0.5582867",
"0.5564658",
"0.5562949",
"0.5554685",
"0.5541276",
"0.55327404",
"0.55248195",
"0.5518499",
"0.550999",
"0.550675",
"0.55026275",
"0.54993474",
"0.5493701",
"0.54747695",
"0.5472996",
"0.54702955",
"0.5464058",
"0.54596204",
"0.54588336",
"0.545863",
"0.545858",
"0.5453375",
"0.54533726",
"0.5452721",
"0.54480255",
"0.5447656",
"0.5444679",
"0.5440644",
"0.54389197",
"0.54383117",
"0.54383117",
"0.5436188",
"0.54352945",
"0.54278",
"0.5427255",
"0.54253477",
"0.54250443",
"0.5424237",
"0.542021",
"0.5420073",
"0.541902",
"0.5415434",
"0.5413653",
"0.5400127",
"0.5397454",
"0.53961265"
] | 0.6584198 | 0 |
Given a set of steps and an expected custom attribute value, this function performs a set of asserts to validate information such as step key and step attribute value. | private function assertOnMergeKeyAndActionValue($actions, $expectedValue, $expectedMergeKey = null)
{
$expectedMergeKey = $expectedMergeKey ??
ActionGroupObjectBuilder::DEFAULT_ACTION_OBJECT_NAME . self::ACTION_GROUP_MERGE_KEY;
$this->assertArrayHasKey($expectedMergeKey, $actions);
$action = $actions[$expectedMergeKey];
$this->assertEquals($expectedMergeKey, $action->getStepKey());
$this->assertEquals($expectedValue, $action->getCustomActionAttributes());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function passes($attribute, $value)\n {\n\n\n }",
"public function passes($attribute, $value)\n {\n $request = app(\\Illuminate\\Http\\Request::class);\n if (isset($request->quantity) || isset($request->new_item_quantity) || isset($request->item_quantity)) {\n if ( isset($request->quantity) ) {\n for ($i = 0; $i < count($request->quantity); $i++) {\n if (validateNumbers($request->quantity[$i]) <= 0) {\n return false;\n }\n }\n }\n if ( isset($request->new_item_quantity) ) { \n for ($i = 0; $i < count($request->new_item_quantity); $i++) {\n if (validateNumbers($request->new_item_quantity[$i]) <= 0) {\n return false;\n }\n }\n }\n if ( isset($request->item_quantity) ) { \n for ($i = 0; $i < count($request->item_quantity); $i++) {\n if (validateNumbers($request->item_quantity[$i]) <= 0) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }",
"public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }",
"public function testAssertElementAttributeExists(): void\n {\n $webAssert = $this->createMock(WebAssert::class);\n $webAssert->expects($this->once())->method('elementAttributeExists')->with($this->equalTo('css'), $this->equalTo('a.action_bar__next'));\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->once())->method('assertSession')->willReturn($webAssert);\n $trait->expects($this->once())->method('fixStepArgument')->with($this->equalTo('disabled'));\n\n $trait->assertElementAttributeExists('a.action_bar__next', 'disabled'); // @phpstan-ignore-line\n }",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decideForKeys(FLAG_KEYS);\n\n $this->printDecisions($decision, \"Check that the following decisions' properties are expected\");\n }",
"public function passes($attribute, $value)\n {\n foreach($value as $v){\n if($v['merge_type'] == 1 && count($v['prev_step_key'])==1){\n $next = $this->checkMergeType($value,$v['prev_step_key'][0]);\n if(count($next)>1){\n $this->msg =$v['name'].' 步骤不能配置合并';\n return false;\n }\n }\n }\n return true;\n }",
"public function passes($attribute, $value)\n {\n $counter = 0;\n if ($this->attr1 == 0) $counter++;\n if ($this->attr2 == 0) $counter++;\n if ($this->attr3 == 0) $counter++;\n\n if ($counter == 2) {\n return true;\n } else {\n return false;\n }\n }",
"public function assert() {\r\n\t\t$this->p('*** ASSERTING: '.$this->name);\r\n\t\t$this->assertRef();\r\n\t\t$this->assertType();\r\n\t\t$this->assertArray();\r\n\t\tif (count($this->properties)) {\r\n\t\t\tforeach ($this->properties as $prop) {\r\n\t\t\t\t$prop->assert();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($this->arrayType) {\r\n\t\t\t$this->arrayType->assert();\r\n\t\t}\r\n\t}",
"protected function assertObjectHasAttributes()\n {\n $args = func_get_args();\n $object = array_shift($args);\n\n foreach ($args as $attribute) {\n\n $this ->assertObjectHasAttribute($attribute, $object);\n\n }\n }",
"public function getPassedAssertions(/* ... */)\n {\n return $this->_passedAssertions;\n }",
"public function runAssert()\n {\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'city');\n $this->assertTrue(in_array('基隆市', $reflected_data));\n $this->assertTrue(in_array('連江縣', $reflected_data));\n // print_r($reflected_data);\n // $reflected_data = $this->_getInnerPropertyValueByReflection($this->TWStreet, 'cityArea');\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'cityArea');\n $this->assertTrue(in_array('仁愛區', $reflected_data));\n $this->assertTrue(in_array('東引鄉', $reflected_data));\n // print_r($reflected_data);\n // $reflected_data = $this->_getInnerPropertyValueByReflection($this->TWStreet, 'cityAreaCount');\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'cityAreaCount');\n $this->assertTrue(in_array(7, $reflected_data));\n $this->assertTrue(in_array(367, $reflected_data));\n // print_r($reflected_data);\n }",
"public function assert(\\PHPUnit\\Framework\\Assert $assertions, array $actualData);",
"public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }",
"public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }",
"public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }",
"public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }",
"public function passedAssertions(/* ... */)\n {\n return $this->_assertionPass;\n }",
"public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }",
"public function passes($attribute, $value)\n {\n return in_array('team_id', $value)\n && in_array('phone', $value)\n && in_array('sticky_phone_number_id', $value);\n }",
"public function isValidComparisonExpectations() {}",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }",
"public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }",
"public function generateTestCases(): iterable\n {\n yield 'When arrays are same without fuzzy' => [\n 'actual' => ['key' => 'value'],\n 'expected' => ['key' => 'value'],\n 'exception' => null\n ];\n\n yield 'Test array same with fuzzy' =>\n [\n 'actual' => ['key' => 'value', 'date' => '2010-10-10T01:03:06Z'],\n 'expected' => ['key' => 'value', 'date' => ':fuzzy:'],\n 'exception' => null\n ];\n\n yield 'Test array same fails' =>\n [\n 'actual' => ['key' => 'value'],\n 'expected' => ['key' => 'missing'],\n 'exception' => new AssertionFailedError(\n 'Failed asserting that two arrays are identical.'\n ),\n 'comparisionCreated' => true\n ];\n\n yield 'Test when actual is not an array' =>\n [\n 'actual' => '',\n 'expected' => ['key' => 'value'],\n 'exception' => new AssertionFailedError('Failed asserting that string is an array.'),\n 'comparisionCreated' => false\n ];\n }",
"public function passes($attribute, $value)\n\t{\n\t\t$zip_handler = resolve(ZipWithXMLHandler::class)->buildZip($value->path());\n\n\t\t$xml = $zip_handler->getSimpleXMLElement();\n\n\t\t$passes = $this->hasValidIdentification($xml)\n\t\t\t&& $this->hasEstablishmentAndProfessionals($xml);\n\n\t\t$zip_handler->closeZip();\n\n\t\treturn $passes;\n\t}",
"function check_actions($observed_fields, $pas, $start_field_set = null) // {{{\n{\n // Set initial field set to empty if not given\n if ($start_field_set === null)\n $start_field_set = new FieldSet();\n else\n $start_field_set = $start_field_set->getClone();\n // Apply actions\n $pas->applyAll($start_field_set);\n // Compare result with extracted field set\n $diff = $observed_fields->differenceWith($start_field_set);\n return $diff;\n}",
"public function getFailedSteps();",
"public function passes()\n {\n $methods = [];\n\n foreach (func_get_args() as $method) {\n $methods[] = $this->$method();\n }\n\n return $this->assertAllTrue($methods);\n }",
"public function passes($attribute, $value) {\n return preg_match(\"/^((?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^a-zA-Z0-9])|(?=.*?[A-Z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])|(?=.*?[a-z])(?=.*?\\d)(?=.*?[^a-zA-Z0-9])).{8,}$/\", $value);\n }",
"public function validate($attributes);",
"public function testMultipleAttributes()\n {\n $result = null;\n\n try {\n $quill = new QuillRender($this->delta_multiple_attributes);\n $result = $quill->render();\n } catch (\\Exception $e) {\n $this->fail(__METHOD__ . 'failure, ' . $e->getMessage());\n }\n\n $this->assertEquals(\n $this->expected_multiple_attributes,\n trim($result),\n __METHOD__ . ' Multiple attributes failure'\n );\n }",
"function do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed, $assertionstrue = false) {\n $this->assertTrue($assertionstrue || $ismatchpassed, \"$matchername failed 'is_match' check on regex '$regex' and string '$str'\");\n if (!$ismatchpassed) {\n echo 'obtained result ' . $obtained['is_match'] . ' for \\'is_match\\' is incorrect<br/>';\n }\n $this->assertTrue($assertionstrue || $fullpassed, \"$matchername failed 'full' check on regex '$regex' and string '$str'\");\n if (!$fullpassed) {\n echo 'obtained result ' . $obtained['full'] . ' for \\'full\\' is incorrect<br/>';\n }\n if (array_key_exists('index_first', $obtained)) {\n $this->assertTrue($assertionstrue || $indexfirstpassed, \"$matchername failed 'index_first' check on regex '$regex' and string '$str'\");\n if (!$indexfirstpassed) {\n echo 'obtained result '; print_r($obtained['index_first']); echo ' for \\'index_first\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('index_last', $obtained)) {\n $this->assertTrue($assertionstrue || $indexlastpassed, \"$matchername failed 'index_last' check on regex '$regex' and string '$str'\");\n if (!$indexlastpassed) {\n echo 'obtained result '; print_r($obtained['index_last']); echo ' for \\'index_last\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('next', $obtained)) {\n $this->assertTrue($assertionstrue || $nextpassed, \"$matchername failed 'next' check on regex '$regex' and string '$str'\");\n if (!$nextpassed) {\n echo 'obtained result \\'' . $obtained['next'] . '\\' for \\'next\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('left', $obtained)) {\n $this->assertTrue($assertionstrue || $leftpassed, \"$matchername failed 'left' check on regex '$regex' and string '$str'\");\n if (!$leftpassed) {\n echo 'obtained result \\'' . $obtained['left'] . '\\' for \\'left\\' is incorrect<br/>';\n }\n }\n }",
"public function passes($attribute, $values)\n {\n// if ( $value == 'ADMIN' || $value == 'DOCTOR' || $value == 'NURSE' ) return true;\n// return false;\n try{\n foreach ($values as $value) {\n if ($value != 1 && $value != 2 && $value != 3) return false;\n }\n return true;\n } catch (\\Exception $e){\n return false;\n }\n }",
"static function attributeEqualTo($attributeName, $value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::attributeEqualTo', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"private function _testParse($cliParams, $expectedValues)\n {\n self::pushToArgv($cliParams);\n\n $args = new cli\\Arguments($this->settings);\n $args->parse();\n\n foreach ($expectedValues as $name => $value) {\n if ($args->isFlag($name)) {\n $this->assertEquals($value, $args[$name]);\n }\n\n if ($args->isOption($name)) {\n $this->assertEquals($value, $args[$name]);\n }\n }\n }",
"public function testMatchAttributeValues()\n {\n $config = array(\n\t\t'eduPersonAffiliation' => array('member')\n );\n\n $result = self::processFilter($config, self::$request);\n $attributes = $result['Attributes'];\n $this->assertCount(1, $attributes);\n $this->assertArrayHasKey('eduPersonAffiliation', $attributes);\n $this->assertEquals($attributes['eduPersonAffiliation'], array('member'));\n\n $config = array(\n\t\t'eduPersonAffiliation' => array('member','staff')\n );\n\n $result = self::processFilter($config, self::$request);\n $attributes = $result['Attributes'];\n $this->assertCount(1, $attributes);\n $this->assertArrayHasKey('eduPersonAffiliation', $attributes);\n $this->assertEquals($attributes['eduPersonAffiliation'], array('member'));\n\n $config = array(\n\t\t'eduPersonAffiliation' => array('student')\n );\n $result = self::processFilter($config, self::$request);\n $attributes = $result['Attributes'];\n $this->assertCount(0, $attributes);\n\n $config = array(\n\t\t'eduPersonAffiliation' => array('student','staff')\n );\n $result = self::processFilter($config, self::$request);\n $attributes = $result['Attributes'];\n $this->assertCount(0, $attributes);\n }",
"protected function assertConditionsMet(): void\n {\n $this->assertThat(null, new ExpectationsMet());\n }",
"static function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertAttributeEquals', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function testValidateAndDelete() {\r\n\t\ttry {\r\n\t\t\t$postData = array();\r\n\t\t\t$this->ShopProductAttribute->validateAndDelete('invalidShopProductAttributeId', $postData);\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'Invalid Shop Product Attribute');\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$postData = array(\r\n\t\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t\t'confirm' => 0));\r\n\t\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'You need to confirm to delete this Shop Product Attribute');\r\n\t\t}\r\n\r\n\t\t$postData = array(\r\n\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t'confirm' => 1));\r\n\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t$this->assertTrue($result);\r\n\t}",
"function getParamsAndResultsForAStep($step, $parentStudyID, $parentSubjectID, $markedStepsUnitsIDs, $clientID) {\n\n global $definitions;\n\n //we need get the associated parameters and their result\n $itemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['stepUnits'], $clientID);\n\n $parentStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsStepParentID'], $clientID);\n $unitPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsUnit'], $clientID);\n $conversionValuePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsConversionValue'], $clientID);\n $parentStudyPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsParentStudy'], $clientID);\n $isGlobalPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsIsGlobal'], $clientID);\n $valuesListPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsValuesList'], $clientID);\n\n $mainPropertyID = getMainPropertyID($itemTypeID, $clientID);\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $mainPropertyID, 'name' => 'mainValue');\n $returnProperties[] = array('ID' => $unitPropertyID, 'name' => 'unit');\n $returnProperties[] = array('ID' => $conversionValuePropertyID, 'name' => 'conversionValue');\n $returnProperties[] = array('ID' => $parentStudyPropertyID, 'name' => 'studyID');\n $returnProperties[] = array('ID' => $isGlobalPropertyID, 'name' => 'isGlobal');\n $returnProperties[] = array('ID' => $valuesListPropertyID, 'name' => 'valuesList');\n\n //build the filter for all the units that are global to the study\n $filters = array();\n $filters[] = array('ID' => $parentStudyPropertyID, 'value' => $parentStudyID);\n $filters[] = array('ID' => $isGlobalPropertyID, 'value' => 1);\n\n $stepUnits = getFilteredItemsIDs($itemTypeID, $clientID, $filters, $returnProperties);\n\n //Seguidamente, cogemos las unidades própias del step\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $mainPropertyID, 'name' => 'mainValue');\n $returnProperties[] = array('ID' => $unitPropertyID, 'name' => 'unit');\n $returnProperties[] = array('ID' => $conversionValuePropertyID, 'name' => 'conversionValue');\n $returnProperties[] = array('ID' => $parentStudyPropertyID, 'name' => 'studyID');\n $returnProperties[] = array('ID' => $isGlobalPropertyID, 'name' => 'isGlobal');\n $returnProperties[] = array('ID' => $valuesListPropertyID, 'name' => 'valuesList');\n\n //build the filter for all the units that are global to the study\n $filters = array();\n $filters[] = array('ID' => $parentStudyPropertyID, 'value' => $parentStudyID);\n $filters[] = array('ID' => $parentStepPropertyID, 'value' => $step['stepRelated']);\n $filters[] = array('ID' => $isGlobalPropertyID, 'value' => 0);\n\n $noGlobalStepUnits = getFilteredItemsIDs($itemTypeID, $clientID, $filters, $returnProperties);\n\n //Juntamos los dos arrays\n $stepUnits = array_merge($stepUnits, $noGlobalStepUnits);\n\n //añadimos más informaciones a los stepUnits\n for ($i = 0; $i < count($stepUnits); $i++) {\n $stepUnits[$i]['parentStepID'] = $step['ID'];\n $stepUnits[$i]['isStep'] = 'False';\n $stepUnits[$i]['order'] = $i;\n $stepUnits[$i]['unit'] = base64_encode($stepUnits[$i]['unit']);\n $stepUnits[$i]['mainValue'] = base64_encode($stepUnits[$i]['mainValue']);\n $stepUnits[$i]['systemConversionValue'] = base64_encode(getAppRelatedListUnitValue($stepUnits[$i]['conversionValue']));\n $stepUnits[$i]['conversionValue'] = base64_encode($stepUnits[$i]['conversionValue']);\n\n }\n\n //añadimos el valor de conversión de la lista de tipos de valores\n\n $stepUnitsChecked = array();\n for ($i = 0; $i < count($stepUnits); $i++) {\n if (in_array($stepUnits[$i]['ID'], $markedStepsUnitsIDs)) {\n $stepUnitsChecked[] = $stepUnits[$i];\n }\n }\n\n //Seguidamente, hemos de coger el order que tiene cada una de las unidades dentro del estudio\n $orderUnitsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['orderUnits'], $clientID);\n $orderUnitsStepPropID = getClientPropertyID_RelatedWith_byName($definitions['orderUnitsStepID'], $clientID);\n $orderUnitsUnitPropID = getClientPropertyID_RelatedWith_byName($definitions['orderUnitsUnitID'], $clientID);\n $orderUnitsOrderPropID = getClientPropertyID_RelatedWith_byName($definitions['orderUnitsOrder'], $clientID);\n\n // build return properties array\n $returnPropertiesOrder = array();\n $returnPropertiesOrder[] = array('ID' => $orderUnitsOrderPropID, 'name' => 'order');\n $returnPropertiesOrder[] = array('ID' => $orderUnitsUnitPropID, 'name' => 'unitID');\n\n //build the filter\n $filtersOrder = array();\n $filtersOrder[] = array('ID' => $orderUnitsStepPropID, 'value' => $step['ID']);\n\n $OrderUnits = getFilteredItemsIDs($orderUnitsItemTypeID, $clientID, $filtersOrder, $returnPropertiesOrder);\n\n $orders = array();\n foreach ($OrderUnits as $order) {\n $orders[$order['unitID']] = $order['order'];\n }\n\n for ($i = 0; $i < count($stepUnitsChecked); $i++) {\n\n if (isset($orders[$stepUnitsChecked[$i]['ID']])) {\n $stepUnitsChecked[$i]['order'] = $orders[$stepUnitsChecked[$i]['ID']];\n } else {\n $stepUnitsChecked[$i]['order'] = 0;\n }\n }\n\n //Reordenamos el array en función del orden\n usort($stepUnitsChecked, make_comparer(array('order', SORT_DESC)));\n\n //Una vez tenemos los parámetros ordenados, hemos de coger sus valores\n for ($i = 0; $i < count($stepUnitsChecked); $i++) {\n $resultsValues = array();\n $resultsValues = getValuesForAStepUnit($stepUnitsChecked[$i]['ID'], $parentSubjectID, $step['ID'], $clientID);\n\n $stepUnitsChecked[$i]['executionValue'] = $resultsValues['executionValue'];\n $stepUnitsChecked[$i]['resultID'] = $resultsValues['resultID'];\n }\n\n return $stepUnitsChecked;\n}",
"protected function verifyAttributes()\n {\n $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']);\n $fixtureOptions = $this->prepareFixtureOptions();\n $errors = $this->verifyData($fixtureOptions, $formOptions, true, false);\n return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:');\n }",
"public function assertArrayHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayHasKey', func_get_args()));\n }",
"public function assertArrayHasKey($key, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArrayHasKey', func_get_args()));\n }",
"public function assertValid()\n {\n }",
"public function passes($attribute, $value)\n {\n $request = app(\\Illuminate\\Http\\Request::class);\n if(!empty($value) && $request->type == 'STOCKOUT'){\n if (isset($request->id)) {\n for ($i = 0; $i < count($request->id); $i++) { \n $check = DB::table('stock_moves')\n ->select(DB::raw('sum(quantity) as total'))\n ->where(['item_id' => $request->id[$i], 'location_id' => $request->location])\n ->groupBy('location_id')\n ->first();\n\n $currentQty = validateNumbers($request->quantity[$i]);\n $currentTotal = isset($check->total) ? $check->total : 0;\n if($currentQty > $currentTotal) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }",
"public function processAssert(\n AdvancedSearch $advancedSearch,\n array $attributeForSearch\n ) {\n $advancedSearch->open();\n $availableAttributes = $advancedSearch->getForm()->getFormLabels();\n if (isset($attributeForSearch['isVisible'])) {\n \\PHPUnit\\Framework\\Assert::assertTrue(\n (false !== array_search($attributeForSearch['name'], $availableAttributes)),\n 'Attribute ' . $attributeForSearch['name'] . 'was not found in Advanced Search Page.'\n );\n } else {\n \\PHPUnit\\Framework\\Assert::assertTrue(\n (false == array_search($attributeForSearch['name'], $availableAttributes)),\n 'Attribute ' . $attributeForSearch['name'] . ' was found in Advanced Search Page.'\n );\n }\n }",
"public function passes($attribute, $value)\n {\n if (empty($this->request['invoices'])) {\n return true;\n }\n\n if (!$this->validate($this->request['invoices'])) {\n return false;\n }\n\n return true;\n }",
"public function passes($attribute, $value)\n {\n $file = File::find($value);\n\n if (! $file) {\n $this->error = [\n 'type' => 'not_exist',\n ];\n\n return false;\n }\n\n foreach ($this->criteria as $rule) {\n $status = $this->{'check' . Str::ucfirst($rule['type']) . 'Rule'}(\n $file,\n $rule['payload'] ?? null,\n $attribute,\n $value\n );\n\n if (! $status) {\n $this->error['attribute'] = $attribute;\n $this->error['value'] = $value;\n\n return false;\n }\n }\n\n return true;\n }",
"static function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertAttributeInstanceOf', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function testMatchAttributeValuesNotArray()\n {\n $config = array(\n );\n\n $request = array(\n 'Attributes' => array(\n 'eduPersonTargetedID' => array('[email protected]'),\n 'eduPersonAffiliation' => array('member'),\n 'cn' => array('user name'),\n 'mail' => array('[email protected]'),\n 'discardme' => array('somethingiswrong'),\n ),\n 'Destination' => array(\n 'attributes' => array('eduPersonAffiliation' => 'student'),\n ),\n 'Source' => array(\n ),\n );\n\n\n $result = self::processFilter($config, $request);\n }",
"public function passes($attribute, $value)\n {\n $value = str_replace('T', ' ', $value);\n $this->date = date('Y-m-d', strtotime($value));\n\n $filmevents = FilmEvent::get()\n ->filter(function($r) { return Str::startsWith($r->start, $this->date);})\n ->where('hall_id', '=', $this->hall_id);\n\n if(count($filmevents) >= 3) {\n return false;\n }\n\n return true; \n }",
"protected function assertHasAttributes(\\SimpleXMLElement $element, array $expected_attributes) {\n foreach ($expected_attributes as $attribute => $value) {\n if ($value === NULL) {\n $this->assertNull($element[$attribute]);\n }\n else {\n $this->assertSame((string) $value, (string) $element[$attribute]);\n }\n }\n }",
"public function passes($attribute, $value)\n {\n return $this->validarCedula($value);\n }",
"public function assertValid() : void\n {\n }",
"public function assertValid() : void\n {\n }",
"public function testGetErrors0()\n{\n\n $actual = $this->collecting->getErrors();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function passes($attribute, $value)\n {\n if (empty($this->planId))\n {\n return TRUE;\n }\n $plan = Plan::find($this->planId);\n $firstPlanData = $plan->planData->sortBy('simple_date')->first();\n Log::debug('first plan data date '.$this->startDate);\n $lastPlanData = $plan->planData->sortBy('simple_date')->last();\n Log::debug('last plan data date '.$this->goalDate);\n if (!$firstPlanData)\n {\n return TRUE;\n }\n if (strtotime($firstPlanData->simple_date) < strtotime($this->startDate))\n {\n return FALSE;\n }\n elseif (strtotime($lastPlanData->simple_date) > strtotime($this->goalDate))\n {\n return FALSE;\n }\n\n return TRUE;\n }",
"public function passes($attribute, $value)\n {\n $user= Auth::user();\n $semester= Semester::findOrFail($value);\n $batches= $semester->batches;\n\n if (count($batches)<1) {\n return false;\n }\n\n $match_dep=1;\n foreach ($user->departments as $dep) {\n foreach ($batches as $batch) {\n foreach ($batch->department as $depar) {\n if ($depar->id == $dep->id) {\n $match_dep=2;\n }\n }\n }\n } \n if ($match_dep==1) {\n return false;\n }\n\n foreach ($user->subjects as $subject) {\n foreach ($subject->semesters as $u_semester) {\n if ($u_semester->id == $semester->id) {\n return true;\n }\n }\n }\n return false;\n }",
"public function passes($attribute, $value)\n {\n return !$this->exercise->where(['user_id' => $this->user->id, 'name' => $value])->exists();\n }",
"public function assertHasFields(ActiveRecord $model) {\n $this->assertions++;\n $table = $model->_TableName();\n require_once INST_PATH.\"migrations/create_{$table}.php\";\n $migrationName = 'Create'.Camelize(Singulars($table));\n $migration = new $migrationName();\n $fields = $migration->getFields();\n $expected = $model->getRawFields();\n $passed = !empty($fields) & !empty($expected) & empty(array_diff($fields, $expected));\n\n $this->_passed += $passed;\n $this->_log('Assert if ' . get_class($model) . ' has the fields ' . implode(',',$fields) . ': '.$this->_colors->getColoredString($this->_textOutputs[$passed], $this->_colorsPalete[$passed]));\n\n !$passed && $this->_log('Missing fields: '.implode(',', array_diff($fields, $expected)));\n\n $this->_progress($passed);\n\n $passed or $this->_triggerError('Asserts Has Fields');\n }",
"public function passes($attribute, $value)\n {\n return Hash::check($value, $this->input);\n }",
"public function passes($attribute, $value)\n {\n return Action::where('id', $this->id == null ? $value : $this->id)->count() != 0;\n }",
"public function passes($attribute, $value)\n {\n if(is_null($this->column))\n {\n $items = $value;\n } else {\n $items = array_column($value, $this->column);\n }\n $itemsUnique = array_unique($items);\n $itemsDiffAsoc = array_diff_assoc($items, $itemsUnique);\n if(count($itemsDiffAsoc) > 0)\n {\n return false;\n } else {\n return true;\n }\n }",
"static function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::attribute', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function passes($attribute, $value)\n {\n return $this->numericValidation() && $this->testUnique();\n }",
"static function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertAttributeSame', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"function my_assert_handler($file, $line, $code, $desc = null)\n{\n echo \"Assertion failed at $file:$line: $code\";\n if ($desc) {\n echo \": $desc\";\n }\n echo \"\\n\";\n}",
"public function addAssertions($assertions) {\n $total = $this->getAssertions() + $assertions;\n $this->setAssertions($total);\n }",
"public function passes($attribute, $value)\n {\n $times = preg_match('/(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)/', $value);\n if (!$times)\n return false;\n if (Carbon::now()->subYears($this->age)->lt(Carbon::createFromDate(substr($value, 6, 4), substr($value, 10, 2),\n substr($value, 12, 2)))) {\n return false;\n }\n return true;\n }",
"public function test_validation()\n\t{\n\t\tfor ($i = 1; $i <= 8; $i++) {\n\t\t\tlist(, $args) = $this->parse(\"test$i.xml\");\n\t\t\t$response = AFK_XmlRpc_Parser::serialise_response(\n\t\t\t\tcall_user_func_array(array($this, \"validate_$i\"), $args)\n\t\t\t);\n\t\t\t$expected = $this->load(\"test$i.response.xml\");\n\t\t\t$response = $this->format($response);\n\t\t\t$expected = $this->format($expected);\n\t\t\t$this->assertEquals($expected, $response);\n\t\t}\n\t}",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"static function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertAttributeLessThan', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function testSetValues()\n {\n $tests = array(\n array(\n 'label' => __LINE__ . \" string input\",\n 'value' => \"write user * * //...\",\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" bool input\",\n 'value' => true,\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, doubled-up space\",\n 'value' => array(\"writer user * * //...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, space in field\",\n 'value' => array(\"writ er user * * //...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, missing field\",\n 'value' => array(\"writer * * //...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, space in unquoted path\",\n 'value' => array(\"writ er user * * //test path/...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" array input, name has space\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"* \",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n ),\n 'error' => true,\n ),\n array(\n 'label' => __LINE__ . \" array input, missing type\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write \",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n ),\n 'error' => true,\n ),\n array(\n 'label' => __LINE__ . \" array input, missing path\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n )\n ),\n 'error' => true,\n ),\n array(\n 'label' => __LINE__ . \" one string input, path has spaces.\",\n 'value' => array('write user * * \"//test with spaces/...\"'),\n 'error' => false,\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n )\n ),\n array(\n 'label' => __LINE__ . \" one array input, path has spaces.\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n ),\n 'error' => false,\n ),\n array(\n 'label' => __LINE__ . \" one string input.\",\n 'value' => array(\"write user * * //...\"),\n 'error' => false,\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n )\n )\n ),\n array(\n 'label' => __LINE__ . \" four string input\",\n 'value' => array(\n \"write user * * //...\",\n \"read user bob * //test1/...\",\n \"review group testGroup * //test2/...\",\n \"open user * example.com //test3/...\"\n ),\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n ),\n 1 => array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 2 => array (\n 'mode' => \"review\",\n 'type' => \"group\",\n 'name' => \"testGroup\",\n 'host' => \"*\",\n 'path' => \"//test2/...\"\n ),\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'error' => false\n ),\n array(\n 'label' => __LINE__ . \" four array input\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n ),\n 1 => array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 2 => array (\n 'mode' => \"review\",\n 'type' => \"group\",\n 'name' => \"testGroup\",\n 'host' => \"*\",\n 'path' => \"//test2/...\"\n ),\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'error' => false\n ),\n array(\n 'label' => __LINE__ . \" mixed string/array input\",\n 'value' => array(\n \"write user * * //...\",\n array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 'review group testGroup * \"//test2 with spaces/...\"',\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n ),\n 1 => array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 2 => array (\n 'mode' => \"review\",\n 'type' => \"group\",\n 'name' => \"testGroup\",\n 'host' => \"*\",\n 'path' => \"//test2 with spaces/...\"\n ),\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'error' => false\n ),\n );\n\n foreach ($tests as $test) {\n $label = $test['label'];\n\n $protect = new P4_Protections;\n\n try {\n $protect->setProtections($test['value']);\n\n if ($test['error']) {\n $this->fail(\"$label: Unexpected success.\");\n }\n\n $expected = array_key_exists('out', $test) ? $test['out'] : $test['value'];\n\n $this->assertSame(\n $expected,\n $protect->getProtections(),\n \"$label: Unexpected Output\"\n );\n } catch (InvalidArgumentException $e) {\n if (!$test['error']) {\n $this->fail(\"$label: Unexpected failure.\");\n } else {\n $this->assertTrue(true, \"$label: Expected exception found\");\n }\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n $this->fail($e->getMessage());\n } catch (Exception $e) {\n $this->fail(\n \"$label: Unexpected Exception (\" . get_class($e) . '): ' . $e->getMessage()\n );\n }\n }\n }",
"public function testGetErrorsByFile()\n { \n $this->_mockXMLHandler\n ->expects($this->once())\n ->method('loadXML')\n ->with($this->equalTo(self::$_cbXMLFile))\n ->will($this->returnValue(simplexml_load_file(self::$_cbXMLFile)));\n \n $list = $this->_cbErrorHandler->getErrorsByFile(self::$_cbXMLFile, $this->_fileName);\n \n $this->assertType('SimpleXMLElement', $list);\n \n $count = 0;\n foreach ($list as $item) foreach($item->attributes() as $key => $value) {\n if (10 < $count) {\n break 2;\n }\n $this->assertTrue(in_array($key, $this->_neededKeys));\n $this->assertNotNull($value);\n $count++;\n }\n }",
"public function testDynamicAllowedValues() {\n // Verify that validation passes against every value we had.\n foreach ($this->test as $key => $value) {\n $this->entity->test_options->value = $value;\n $violations = $this->entity->test_options->validate();\n $this->assertCount(0, $violations, \"$key is a valid value\");\n }\n\n // Now verify that validation does not pass against anything else.\n foreach ($this->test as $key => $value) {\n $this->entity->test_options->value = is_numeric($value) ? (100 - $value) : ('X' . $value);\n $violations = $this->entity->test_options->validate();\n $this->assertCount(1, $violations, \"$key is not a valid value\");\n }\n }",
"function getSeleniumResultsForTestCase($testCaseID, $relationID, $studyID, $subjectID, $clientID) {\n\n global $definitions;\n $stepsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n\n $stepParentTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $stepOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsOrder'], $clientID);\n $stepCheckedStepUnitsPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsCheckedStepUnits'], $clientID);\n $stepRoundSubjectTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n\n //First, we need the steps for this testCase\n\n //Next, get the results fo the step\n // get checked values\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $stepOrderPropertyID, 'name' => 'order');\n $returnProperties[] = array('ID' => $stepCheckedStepUnitsPropertyID, 'name' => 'checkedValues');\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $stepParentTestCasePropertyID, 'value' => $testCaseID);\n $filters[] = array('ID' => $stepRoundSubjectTestCasePropertyID, 'value' => $relationID);\n\n // get steps\n $orderedSteps = getFilteredItemsIDs($stepsItemTypeID, $clientID, $filters, $returnProperties, 'order');\n\n $totalOK = 0;\n $totalNOK = 0;\n $hasSeleniumResults = False;\n\n for ($i = 0; $i < count($orderedSteps); $i++) {\n\n $markedStepsUnitsIDs = explode(',', $orderedSteps[$i]['checkedValues']);\n\n $params = getParamsAndResultsForAStep($orderedSteps[$i], $studyID, $subjectID, $markedStepsUnitsIDs, $clientID);\n\n //Add every parameter to the results\n foreach ($params as $p) {\n\n //Check if the systemConversion value is a Selenium type\n\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResult') {\n $hasSeleniumResults = True;\n $theResult = base64_decode($p['executionValue']);\n if ($theResult == 'OK') {\n $totalOK++;\n } elseif ($theResult == 'NOK') {\n $totalNOK++;\n }\n }\n\n }\n }\n if ($hasSeleniumResults == True) {\n if ($totalOK > 0 && $totalNOK == 0) {\n return 'OK';\n } elseif ($totalNOK > 0) {\n return 'NOK';\n } elseif ($totalOK == 0 && $totalNOK == 0) {\n return 'NOT_EXECUTED';\n }\n } else {\n return 'NOSELENIUM';\n }\n\n}",
"public function passes($attribute, $value)\n {\n if($this->type == 0){\n $expectedValue = Carbon::parse($this->Start_Date)->addMonth(3)->format('Y-m-d');\n if(strtotime($value) < strtotime($expectedValue)){\n return false;\n }\n else{\n $endDate = Carbon::parse($value);\n if($endDate->dayOfWeek != 4){ // Not Equal thursday الخميس\n $this->checkDay = 1;\n return false;\n }\n return true;\n }\n\n }\n elseif($this->type == 1){\n $expectedValue = Carbon::parse($this->Start_Date)->addMonth(2)->format('Y-m-d');\n if(strtotime($value) < strtotime($expectedValue)){\n return false;\n }\n else{\n $endDate = Carbon::parse($value);\n if($endDate->dayOfWeek != 4){ // Not Equal thursday الخميس\n $this->checkDay = 1;\n return false;\n }\n return true;\n }\n }\n return true;\n }",
"public function invalidTestsProvider()\n\t {\n\t\treturn array(\n\t\t\t\"testing with added mandatory attribute of one of the hierarchy nodes\" => array(\"invalid-1\"),\n\t\t\t\"one of the non-mandatory attributes is wrong\" => array(\"invalid-2\"),\n\t\t\t\"one new mandatory leaf element is added to the schema\" => array(\"invalid-3\"),\n\t\t\t\"non-mandatory attribute of the leaf node is wrong\" => array(\"invalid-4\"),\n\t\t\t\"mandatory attribute of the leaf node has wrong value\" => array(\"invalid-5\"),\n\t\t\t\"mandatory attribute of the leaf node has wrong name\" => array(\"invalid-6\"),\n\t\t );\n\t }",
"public function passes($attribute, $value)\n {\n $validTypes = ['texto', 'número', 'correo', 'fecha', 'mes', 'hora', 'múltiple', 'única', 'seleccionar', 'teléfono', 'semana', 'anio', 'cédula', 'ruc', 'tabla'];\n $validConsts = [\n 'Nombres Apellidos Estudiante',\n 'Cédula Estudiante',\n 'Fecha Resolución',\n 'Correo Personal Estudiante',\n 'Correo UTA Estudiante',\n 'Carrera Estudiante',\n 'Telefono Estudiante',\n 'Periodo Académico',\n 'Matricula Estudiante',\n 'Folio Estudiante',\n 'Anio Resolución',\n 'Presidente Consejo',\n 'Número Resolución',\n 'Tipo Sesión',\n 'Fecha Consejo',\n 'contenido',\n '/contenido'\n ];\n \n $phpWord = new \\PhpOffice\\PhpWord\\TemplateProcessor($value->getPathName());\n $vars = $phpWord->getVariables();\n\n if(count($vars) == 0){\n $this->invalid[] = 'La plantilla no tiene campos';\n }\n\n foreach($vars as $varia){\n if(count(explode(',', $varia)) > 1){\n $sections = explode(',', $varia,2);\n $validConsts[] = trim($sections[0]);\n }\n }\n\n foreach($vars as $varia){\n\n\n if(count(explode(',', $varia)) > 1){\n $sections = explode(',', $varia,2);\n $this->validConsts[] = trim($sections[0]);\n $type = trim($sections[1]);\n $type = trim(explode('|', explode(';', $type)[0])[0]);\n if(!in_array($type, $validTypes)){\n $this->invalid[] = 'Tipo <span style=\"color: #007bff\">'.$type.'</span> no valido en ${'.$varia.'}';\n }\n if($type == 'seleccionar' || $type == 'multiple' || $type == 'unica' || $type == 'tabla'){\n $opS = explode(';', $sections[1]);\n if(count($opS) > 1){\n if(count(explode(',', $opS[1]))==0){\n $this->invalid[] = 'Tipo '.$type.' requiere opciones ${'.$varia.'}';\n }\n } else {\n $this->invalid[] = 'Tipo '.$type.' requiere opciones en ${'.$varia.'}';\n }\n } else if(count(explode('|', $sections[1]) ) >1){\n $opS = explode('|', $sections[1]);\n if(!isset($opS[1])){\n $this->invalid[] = 'Tipo '.$type.' requiere valor por defecto en ${'.$varia.'}';\n }\n \n }\n\n } else {\n $constName = trim($varia);\n\n if(!in_array($constName, $validConsts)){\n $this->invalid[] = 'La constante '.$constName.' no existe en ${'.$varia.'}';\n }\n }\n \n }\n return count($this->invalid) == 0;\n }",
"public function getRequiredConstantAsserts(): iterable\n {\n return [\n 'CODE_DUPLICATE_SPACES' => [\n 'CODE_DUPLICATE_SPACES',\n 'DuplicateSpaces',\n ],\n ];\n }",
"function _assert_handler_($file, $line, $code, $desc = null)\n{\n// echo \"Assertion failed at $line: $code\";\n if ($desc) {\n echo \"$desc\\n\";\n }\n// echo PHP_EOL;\n}",
"public function validateCustomerAttributeActions()\n {\n $actionName = $this->getActionName();\n $attributeId = $this->_request->getParam('attribute_id');\n $websiteId = $this->_request->getParam('website');\n if (in_array($actionName, [self::ACTION_NEW, self::ACTION_DELETE])\n || in_array($actionName, [self::ACTION_EDIT, self::ACTION_SAVE])\n && !$attributeId\n || $websiteId\n && !$this->_role->hasWebsiteAccess($websiteId, true)\n ) {\n $this->_forward();\n return false;\n }\n return true;\n }",
"public function assertLessOrEquals($expected, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertLessOrEquals', func_get_args()));\n }",
"public function assertLessOrEquals($expected, $actual, $description = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertLessOrEquals', func_get_args()));\n }",
"public function testAbilities0()\n{\n\n $actual = $this->gate->abilities();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function passes($attribute, $value)\n {\n \n if(!is_array($value)){\n dd(\"no array\");\n return false;\n }\n\n if(!isset($value['type'])){\n dd(\"no type\");\n return false;\n }\n\n elseif(is_null($value['type']) || $value['type'] == ''){\n dd(\"no type null\");\n return false;\n }\n\n elseif($value['type'] === 2 ){\n dd(\"radio type no label\");\n return false;\n }\n\n\n elseif($value['type'] == 3){\n return false;\n }\n\n\n else{\n return true;\n }\n }",
"public function passes($attribute, $value): bool\n {\n try {\n $this->validateInput($value);\n } catch (\\Throwable $e) {\n // Apparently there are no simple ways to return different messages\n // based on user input in Laravel. Currently, the validator simply returns false\n // if data is not in valid format.\n return false;\n }\n $values = Arr::pluck($value, $this->key);\n\n return count($values) === count(array_unique($values));\n }",
"abstract protected function setValidationCustomAttributes(): array;",
"public function passes($attribute, $value)\n {\n return if_exist_asignacion($this->docente_id,$value,$this->grado_id) === true;\n }",
"public function passes($attribute, $value)\n {\n if (request()->get('fecha_finalizado') != null) {\n\n $razon = Razon::find(request()->get('razon_id'), ['nombre']);\n\n if (!preg_match(\"/no acepta/i\", $razon->nombre)) {\n\n if (request()->get('valor_aprobado') != request()->get('valor_cotizado')) {\n return false;\n }\n }\n return true;\n }\n return true;\n }",
"public function test_setup_assert() {\n $this->assertTrue($this->testassertexecuted);\n $this->testassertexecuted = false;\n }",
"abstract protected function define_my_steps();",
"public function passes($attribute, $value)\n {\n foreach ($value as $item) {\n $response = DB::table('items')\n ->select('id')\n ->where('id', '=', $item['item_id'])\n ->where('amount', '>=', $item['amount'])\n ->first();\n\n if($response == NULL || $response == \"\") {\n $this->item_stock = DB::table('items')\n ->select('name', 'amount')\n ->where('id', '=', $item['item_id'])\n ->first();\n return false;\n }\n }\n\n return true;\n }",
"public function testCasePassed() { PunitAssert::assertEquals(1, 1); }",
"public function validateDetails($attribute,$params)\n {\n if (count($this->orderDetails) == 0) {\n $this->addError('orderDetails', 'Order Details need to be entered');\n }\n }",
"protected function executeSpecificStep() {}",
"private static function assertAll() {\r\n\t\tforeach (self::$global as $type) {\r\n\t\t\t$type->assert();\r\n\t\t}\r\n\t}",
"public function passes($attribute, $value)\n {\n //When user enter multiple time value as character is not working. \n for($i=0;$i<count($value);$i++)\n {\n if(!ctype_alpha($value[$i]))\n {\n $parts = explode(':', $value[$i]); \n if(count($parts) > 3){\n return false;\n }\n $hours = $parts[0];\n $minutes = $parts[1];\n $seconds=$parts[2];\n if($hours >= 0 && $hours < 24 && $minutes >= 0 && $minutes < 60 && is_numeric($hours) && is_numeric($minutes) && $seconds>=0 && $seconds<60 && is_numeric($seconds)){ \n// echo \"if loop\";\n return true;\n }\n else\n {\n// echo \"else loop1\";\n return false;\n }\n }\n else\n {\n// echo \"else loop2\";\n return false;\n }\n }\n }",
"public abstract function getSteps();",
"public function processAssert(CatalogProductAttributeNew $attributeNew)\n {\n \\PHPUnit\\Framework\\Assert::assertFalse(\n $attributeNew->getPageActions()->checkDeleteButton(),\n \"Button 'Delete Attribute' is present on Attribute page\"\n );\n }"
] | [
"0.55683565",
"0.5322462",
"0.51976776",
"0.5180135",
"0.51663834",
"0.5120124",
"0.511801",
"0.50988144",
"0.50972587",
"0.50633883",
"0.5058652",
"0.50252783",
"0.5020123",
"0.5006403",
"0.4993948",
"0.49757075",
"0.49186218",
"0.49123555",
"0.48832652",
"0.48544002",
"0.48529017",
"0.48161438",
"0.4800813",
"0.47935006",
"0.47916782",
"0.476907",
"0.47640175",
"0.47435516",
"0.4723167",
"0.47219753",
"0.47211128",
"0.47208413",
"0.4711864",
"0.47113428",
"0.47107807",
"0.47026804",
"0.46978164",
"0.4693724",
"0.46858543",
"0.46794954",
"0.46466592",
"0.46466592",
"0.46426773",
"0.46386033",
"0.46243227",
"0.46240675",
"0.46157458",
"0.46097195",
"0.46068022",
"0.4601555",
"0.4600641",
"0.45888257",
"0.45882523",
"0.45882523",
"0.45731503",
"0.45571822",
"0.45527548",
"0.45476767",
"0.45470458",
"0.45338875",
"0.45310146",
"0.4530499",
"0.45284033",
"0.45217776",
"0.4515183",
"0.45139837",
"0.45128664",
"0.4511772",
"0.4511724",
"0.45093298",
"0.45077193",
"0.45077136",
"0.45041233",
"0.45034266",
"0.44943762",
"0.44916242",
"0.44881284",
"0.44844407",
"0.4484193",
"0.44840398",
"0.44801456",
"0.4480124",
"0.44774738",
"0.44774738",
"0.44740155",
"0.44723627",
"0.4469738",
"0.4469109",
"0.44691038",
"0.44620252",
"0.44571805",
"0.44566107",
"0.445417",
"0.44513524",
"0.444889",
"0.44466645",
"0.44449854",
"0.44427988",
"0.44403443",
"0.44372696"
] | 0.4723032 | 29 |
constructor para realizar la conexion | public function __construct(){
$this->conexion = new Conexion();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct() {\n $this->conecta();\n }",
"public function __construct()\n {\n $this->conn = new Conexion;\n }",
"function __construct()\r\n\t{\r\n\t\t$this->conexion=new Conect();\r\n\t}",
"public function __construct()\n {\n $this->conexion = Conexion::conectar();\n }",
"public function __construct() {\n $bd = new ConexionBD();\n $this->conexion = $bd->getConexion(); \n }",
"function __construct() {\n $this->conx = Connexion::getconnexion();\n }",
"public function __construct()\n {\n $this->host = \"localhost\";\n $this->user = \"buttaubc_chantal\";\n $this->pass = \"Bfly357T\";\n $this->db = \"buttaubc_SIMPLONG\";\n\n ConnectI::connexion($this->host, $this->db, $this->user, $this->pass);\n\n }",
"public function __construct(){\n $this->conectado = $this->conectar();\n }",
"function __construct(){\n $cls_conexion = new cls_conexion();\n $this->conexion = $cls_conexion->conectar();\n }",
"function __construct() {\r\n $instancia = Database::getInstance();\r\n\r\n $this->con = $instancia->getConexion();\r\n }",
"public function __construct() {\n require_once('./conexion.php');\n }",
"public function __construct() {\n require_once('./conexion.php');\n }",
"function __construct()\n\t\t{\n\t\t\t$this->conn = $this->connect();\n\t\t}",
"public function __construct(){\n\t\t\t$this->cmd = new Conexion();\n\t\t}",
"private function __construct()\n {\n $this->connect();\n }",
"function __construct($connexion){\n $this->setConnexion($connexion);\n }",
"public function __construct()\n {\n if (!empty($_SESSION['id_uzytkownika']) && !empty($_SESSION['id_roli'])) {\n $this->_idUzytkownik = (int) $_SESSION['id_uzytkownika'];\n $this->_idRoli = (int) $_SESSION['id_roli'];\n\t\t\t$this->_Imie= $_SESSION['imie'];\n\t\t\t$this->_Nazwisko= $_SESSION['nazwisko'];\n }\n\n $this->_conn = new Conn();\n }",
"public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->OpenConnect();\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t//Cuidado con estas líneas de terror\t\t\t\n\t\t\tif(!$this->connection = mysqli_connect(SERVIDOR,USUARIO_BD,CONTRASENIA_BD,BD))\n\t\t\t{\n\t\t\t\techo \"<br><b style='color:red;'>Error al tratar de conectar</b><br>\";\t\n\t\t\t}\n\t\t\t$this->connection->set_charset('utf8');// Previniendo errores con SetCharset\n\t\t\t//echo 'Conectado';\n\t\t}",
"private function __construct($conexion){\r\n $this->conexion=$conexion;\r\n }",
"public function __construct()\r\n\t\t{\r\n\t\t\t$this->Connec = DBConnexion::getInstance();\r\n\t\t}",
"public function __construct() {\n\t\t$this->db = MySQLConnectivity::get_instance();\n\t\t$this->conn = $this->db->get_connection(); \n\t}",
"public function __construct()\r\n\t{\r\n\t\tConexion::realizarConexion();\r\n\t}",
"function __construct() {\n $connection= new Connection;\n $this->link = $connection->conect();\n }",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n \n $this->conn = $db;\n }",
"public function __construct() {\n\t\t\t$this->conexion = new mysqli(\"localhost\", \"root\", \"\", \"aerolinea\");\n\t\t\tif($this->conexion->errno)\n\t\t\t\techo 'Error al conectar con la base de datos. Nro: ' . $this->conexion->errno .' / '. $this->conexion->error;\n\t\t}",
"function __construct(){\n // se definen los datos del servidor de base de datos\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"root\"; // usuario\n $conection['pass']=\"admin\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n // crea la conexion pasandole el servidor , usuario y clave\n $conect= mysql_connect($conection['server'],$conection['user'],$conection['pass']);\n mysql_set_charset('utf8',$conect);\n\n if ($conect) {// si la conexion fue exitosa , selecciona la base\n mysql_select_db($conection['base']);\n $this->con=$conect;\n }\n\n }",
"function __construct() // constructor, solo crea una conexion usando la clase \"Conexion\"\n {\n $this->coneccion= new ConexionMYSQL();\n }",
"function __construct()\n {\n $this->connect();\n }",
"function __construct()\n {\n $con_obj = new ConnectionClass();\n $this->con = $con_obj->getConnection();\n }",
"function __construct(){\n\n\t\t $this->connect() ;\n\t}",
"public function __construct()\n\t{\n\t\t$this->connectOpen();\n\t}",
"public function __construct( )\n {\n $this->openConnection();\n }",
"public function __construct() {\n $this->conexion = new ConexionBD(); //instanciamos la clase\n\n }",
"public function __construct() {\n $this->conexion = new ConexionBD(); //instanciamos la clase\n\n }",
"function __construct() {\n $this->_connect();\n }",
"public function __construct()\n {\n $this->Connect();\n $this->parameters = array();\n }",
"public function __construct()\r\n {\r\n include('../Controlador/conexion.php');\r\n }",
"public function __construct()\r\n {\r\n include('../Controlador/conexion.php');\r\n }",
"function __construct() {\n $this->open_connection();\n }",
"public function __construct(){\n\t\t$database = new Database();\n\t\t$db = $database->getConnection();\n $this->conn = $db;\n }",
"function __construct(){\n \t//Obtenemos los datos con la función datosConexion declarada mas abajo\n $listadatos = $this->datosConexion();\n //Recorremos el array recibido y guardamos los datos en los atributos de esta clase\n foreach ($listadatos as $key => $value) {\n $this->server = $value['server'];\n $this->user = $value['user'];\n $this->password = $value['password'];\n $this->database = $value['database'];\n $this->port = $value['port'];\n }\n //En el atributo conexión instanciaremos la clase mysqli que nos permitirá conectar con la base de datos. Si la base de datos es de tipo distinto a mysql, habría que cambiar la linea\n $this->conexion = new mysqli($this->server,$this->user,$this->password,$this->database,$this->port);\n //Si la conexión da error, sacaremos un mensaje y detendremos la ejecución\n if($this->conexion->connect_errno){\n echo \"algo va mal con la conexion\";\n die();\n }\n\n }",
"function __construct() {\n $this->createConnection();\n }",
"public function __construct() {\n parent::__construct();\n\t\t// Instancia Conectar y conexión \n $this->conectar=new Conectar();\n $this->adapter=$this->conectar->conexion();\n }",
"private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}",
"function __construct(){\n\t\t$this->conn = mysqli_connect($this->host, $this->uname, $this->pass, $this->db);//buatlah koneksi secara OOP\n\t\t\n\t}",
"function __construct(){\n\t\t\n\t\t\t$this-> host = 'localhost';\n\t\t\t$this -> user = 'root';\n\t\t\t$this -> pass = 'root';\n\t\t\t$this -> db = 'cc409_perros';\n\t\t\n\t\t}",
"public function __construct() \n \t\t{\n \t // Connection au serveur\n\t\t\t\ttry {\n\t\t\t\t\t// Options de connection encodage UFT8\n\t\t\t\t\t$options = array(\n\t\t\t\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\",\n\t\t\t\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n\t\t\t\t\t\tPDO::ATTR_PERSISTENT => true \n\t\t\t\t\t);\n\t\t\t\t$this->db = new PDO( self::DSN, self::USER, self::PSW, $options );\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\techo \"Connection à MySQL impossible : \", $e->getMessage();die();\n\t\t\t\t}\n\t\t\t}",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n $this->conn = $db;\n }",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n $this->conn = $db;\n }",
"function __construct()\n {\n $this->createConnection();\n\n }",
"public function __construct()\n\t{\n\t\t$this->conn = 'connected';\n\t}",
"public function __construct()\r\n {\r\n $this->conexao = new conexao;\r\n }",
"public function __construct() {\n $this->miConexion = Conexion::singleton();\n $this->retorno = new stdClass();\n }",
"public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }",
"public function __construct(){\n $servidor='localhost';\n $bd='dbtds';\n $usuario=\"root\";\n $pass=\"\";\n $this->enlace = mysqli_connect($servidor,$usuario,$pass,$bd) or die('Intente más tarde.');\n }",
"public function __construct()\n {\n // Connexion à la Base de Données\n $this->conn = new PDO(DATABASE, LOGIN, PASSWORD);\n \n }",
"public function __construct() {\n parent::__construct('127.0.0.1', '1151178', '1871', 'control_polizas', 3306);\n if (mysqli_connect_errno()) {\n printf(\"Falló la conexión: %s\\n\", mysqli_connect_error());\n exit();\n }\n }",
"function __construct(){\n\n\t\t\t$this->setConnection();\n\n\t\t}",
"public function __construct(){\n\n\t\t$this->conexion = new mysqli($this->host_db, $this->user_db, $this->pass_db, $this->db_master);\n\n\t\tif($this->conexion->connect_errno){\n\n\t\t\tdie (\"fallo en tratar de conectar con MYSQL: (\". $this->conexion->connect_errno.\")\");\n\t\t}\n\n\t}",
"public function __construct(){\n\n\t\t$this->conexion = new mysqli($this->host_db, $this->user_db, $this->pass_db, $this->db_master);\n\n\t\tif($this->conexion->connect_errno){\n\n\t\t\tdie (\"fallo en tratar de conectar con MYSQL: (\". $this->conexion->connect_errno.\")\");\n\t\t}\n\n\t}",
"public function __construct()\n\t{\n\t\t//llamar constructor del padre IMPORTANTE\n\t\tparent::__construct();\n\t\t\n\t\t//inicializamos la conexion con la base de datos\n\t\t$this->conexionDB = new mysqli(KimaldiServerNamespace\\Configuracion::$bdServer, KimaldiServerNamespace\\Configuracion::$bdUsuario, KimaldiServerNamespace\\Configuracion::$bdPass, KimaldiServerNamespace\\Configuracion::$baseDatos);\n\t\t\n\t}",
"public function __construct()\n\t{\n\t\t$this->_connexion = Db::getInstance();\n\t\t// var_dump($connexion);\n\t}",
"public function __construct()\n\t\t{\n\t\t\t\n\t\t\tif (!isset($this->con))\n\t\t\t{\n\t\t\t\t$this->con = new \\mysqli($this->datos['host'] ,$this->datos['user'] ,$this->datos['pass'] ,$this->datos['db']);\n\t\t\t\tif (mysqli_connect_errno())\n\t\t\t\t{\n\t\t\t\t\ttrigger_error(\"Problemas en la conexion: \" . mysqli_connect_errno(), E_USER_ERROR );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }",
"public function __construct() {\n try {\n $Connexion = new connexion();\n $this->obj = $Connexion->IDconnexion;\n } catch ( PDOException $e ) {\n echo \"<h1>probleme access BDD</h1>\";\n }\n }",
"public function __construct()\n {\n $PARAM_hote = 'localhost';\n\n // le port de connexion à la base de données\n $PARAM_port = '3306';\n // le nom de la base de données\n\n $PARAM_nom_bd = 'InstaDog';\n\n // Le nom d'utilisateur pour se connecter \n $PARAM_utilisateur = 'adminInstaDog';\n\n // le mot de passe de l'utilisateur pour se connecter\n $PARAM_mot_passe = 'Inst@D0g';\n \n // Attraper les exceptions \n try {\n $this->connexion = new PDO(\n 'mysql:host=' . $PARAM_hote . '; dbname=' . $PARAM_nom_bd,\n $PARAM_utilisateur,\n $PARAM_mot_passe\n );\n } catch (Exception $e) {\n echo 'Erreur: ' . $e->getMessage() . '<br/>';\n echo 'N° : ' . $e->getCode();\n }\n }",
"function __construct()\n\t{\n\t\t// Set connection and store it in self::$link\n\t\tself::$link = Connection::setConnect();\n\t}",
"public function __construct() {\n $this->connection = $this->create_connection();\n }",
"private function conectar(){\n try{\n\t\t\t$this->conexion = Conexion::abrirConexion(); /*inicializa la variable conexion, llamando el metodo abrirConexion(); de la clase Conexion por medio de una instancia*/\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage()); /*Si la conexion no se establece se cortara el flujo enviando un mensaje con el error*/\n\t\t}\n }",
"public function __construct(){\r\n $this->conn = $this->getConnection();\r\n }",
"function __construct() {\r\n global $conn;\r\n $this->conn = $conn;\r\n }",
"public function __construct(){\n\t\t\t$this->dsn = 'mysql:host=localhost;dbname=renova';\n\t\t\t$this->username = 'root';\n\t\t\t$this->password ='';\n\t\t\t$this->connection();\n\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t$this->connection();\n\t\t}",
"public function __construct() {\n try {\n $this->conn = new PDO(\"mysql:host=localhost;dbname=tryout\", self::$username, self::$password);\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n } catch (PDOException $e) {\n echo \"Connection failed: \" . $e->getMessage();\n }\n }",
"function __construct(){\n $this->open_connection();\n }",
"public function __construct() {\n // Making a connection with the database\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"private function __construct() {\n\t\tself::$_host = Config::get('host');\n\t\tself::$_username = Config::get('username');\n\t\tself::$_password = Config::get('password');\n\t\tself::$_database = Config::get('database');\n\n\t\t/* Establish connection */\n\t\tself::$_connection = new \\mysqli(self::$_host, self::$_username, \n\t\t\tself::$_password, self::$_database);\n\t\n\t\t/* Error handling */\n\t\tif(mysqli_connect_error()) {\n\t\t\ttrigger_error(\"Failed to connect to MySQL: \" . mysqli_connect_error(), E_USER_ERROR);\n\t\t}\n\t}",
"public function __construct(){\n $this->HOSTNAME = \"127.0.0.1\";\n $this->BASEDATOS = \"teatro_pruebas\";\n $this->USUARIO = \"root\";\n $this->CLAVE=\"\";\n $this->RESULT=0;\n $this->QUERY=\"\";\n $this->ERROR=\"\";\n }",
"private function __construct()\n {\n try {\n $this->con = new PDO(DB_HOST, DB_USER, DB_PASS);\n $this->con->exec('set names utf8');\n //si tenemos un error a la base de datos\n $this->con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n //Exception a la la base de datos\n die('<p>No se ha conectado a la DB </p>' . $e->getMessage());\n }\n }",
"function __construct() {\n\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"dario\"; // usuario\n $conection['pass']=\"dario\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n $conect = oci_connect($conection['user'], $conection['pass'], $conection['server'],'AL32UTF8');\n //el parametro 'AL32UTF8' soluciona todo el tema de los acentos\n if (!$conect) {\n $m = oci_error();\n echo $m['message'], \"\\n\";\n exit;\n } else {\n //echo \"Conexión con éxito a Oracle!\";\n $this->con=$conect;\n }\n\n }",
"public function constructor(){\n\t\tparent::constructor();\n\t\t$this->conectarDB();\n\t}",
"public function __construct() {\n $this->connect();\n// var_dump($this->cont);\n }",
"function abrir_conexion()\n {\n $this->db = Conectar::conexion();\n }",
"private function __construct() {\n\t\tself::$conexao = new PDO(\"mysql:dbname=\" . BD . \";host=\" . HOST, USUARIO, SENHA, array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n\t\tself::$conexao->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\tself::$conexao->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t}",
"public function abrirConexion(){\n if($this->conexion == null){\n $cls_conexion = new cls_conexion();\n $this->conexion = $cls_conexion->conectar();\n }\n }",
"public function __construct() {\r\n $this->conn = PersistentManager::getInstance()->get_connection();\r\n }",
"private function connect()\r\n {\r\n\r\n /**\r\n * A TENTATIVA DE CRIAR UM OBJETO COM A CONEXAO DO BANCO É FEITA\r\n */\r\n try {\r\n /**\r\n * SALVA NA VARIAVEL ESTATICA O OBJETO REFERENTE A CONEXÃO COM O BANCO.\r\n * AS VARIAVEIS QUE SAO USADAS PARA CONEXAO SÃO DA CLASSE PAI\r\n */\r\n self::$con = new PDO('mysql:host=' . $this->getHost() . ';dbname=' . $this->getDatabase() . '', $this->getUser(), $this->getPassword(), array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"));\r\n /**\r\n * DEFINE O TIPO DE MANIPULAÇÃO DE ERRO SERÁ USADO PELO PDO\r\n */\r\n self::$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n /**\r\n * CAPTURA O ERRO, SE GERADO\r\n */\r\n } catch (\\PDOException $error) {\r\n /**\r\n * O ERRO É IMPRESSO NA TELA\r\n */\r\n echo $error->getMessage();\r\n }\r\n }",
"public function __construct() {\n // Making a connection with the database\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}",
"private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}",
"public function __construct(){\r\n\r\n\t\t\t$this->conexiondb = new mysqli(DB_HOST, DB_USER, DB_PWD, DB_NAME);\r\n\r\n\t\t\tif ($this->conexiondb->connect_errno){\r\n\t\t\t\techo \"fallo en la conexión a la base de datos: \" . $this->conexiondb->connect_errno;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t$this->conexiondb->set_charset(DB_CHARSET);\r\n\t\t}",
"private function __construct()\n \n {\n $config = Config::getConfig(); // set singleton config object\n $host = $this->host = Config::getKeys('host');\n $user = $this->username = Config::getKeys('username');\n $password = $this->password = Config::getKeys('password');\n $database = $this->db = Config::getKeys('db');\n $this->newConnection($host, $user, $password, $database);\n // return $dbid; //dbid to the registrey\n \n }",
"public function __construct()\n {\n global $db_conn;\n\n $this->connect = $db_conn;\n\n }",
"function __construct()\r\n\t{\r\n\t\t//dataCon tendra un arreglo con la informacion de la conexion\r\n\t\t$dataCon = require_once 'config/database.php';\r\n\r\n\t\t$this->driver= $dataCon['driver'];\r\n\t\t$this->host= $dataCon['host'];\r\n\t\t$this->user= $dataCon['user'];\r\n\t\t$this->pass= $dataCon['pass'];\r\n\t\t$this->database= $dataCon['database'];\r\n\t\t$this->charset= $dataCon['charset'];\r\n\t}",
"function __construct(){\n\t\t$this->connect = mysqli_connect($this->host, $this->uname, $this->pass, $this->db);\n\t}",
"public function __constructor() {\n // $conn = new mysqli($HOST, $DBUSER, $DBPWD, $DBNAME);\n }",
"function __construct() {\r\n\t\t$this->connBanco = new Db();\r\n\t}",
"function __construct()\n\t{\n\t\t//the constructor requires, that a DB_HOST, DB_NAME, DB_USER and DB_PASS was previously defined.\n\t\t$host\t\t\t= DB_HOST;\n\t\t$dbname\t\t\t= DB_NAME;\n\t\t$user\t\t\t= DB_USER;\n\t\t$pass\t\t\t= DB_PASS;\n\n\t\t//establish the connection to the databse\n\t\t$conn = mysqli_connect($host, $user, $pass);\n\n\t\tif(!$conn) //if we failed to establish the connection - output error and stop executing php\n\t\t{\n\t\t\tdie(\"Connection to the database failed!\");\n\t\t}\n\n\t\t$this->conn = $conn; //save the connection resource in our object - maybe we need it later\n\n\t\t//select the database\n\t\t$db_sel = mysqli_select_db($this->conn, $dbname);\n\n\t\tif(!$db_sel) //throw error if database couldn't be selected and stop executing php\n\t\t{\n\t\t\tdie(\"Can't select database with name \" . $dbname . \" !\");\n\t\t}\n\n\t\t//this is to ensure, that mysql operates with characterset utf-8\n\t\t$this->query(\"SET NAMES 'utf8'\");\n\t}",
"public function __construct()\n {\n $this->cxn = mysqli_connect(HOST, USER, PASSWORD, DATABASE);\n (!$this->cxn) ? $this->cxn_failure(DATABASE) : $this->cxn_success(DATABASE);\n }"
] | [
"0.841624",
"0.8311075",
"0.8252114",
"0.82176703",
"0.81662136",
"0.8165178",
"0.81444615",
"0.81216776",
"0.8061923",
"0.8038903",
"0.801864",
"0.801864",
"0.80055714",
"0.799905",
"0.78927773",
"0.78900176",
"0.78553885",
"0.7852826",
"0.78296715",
"0.7825244",
"0.7819913",
"0.78179264",
"0.7797099",
"0.77880955",
"0.7768809",
"0.77648443",
"0.77578825",
"0.77571356",
"0.7743756",
"0.77428424",
"0.7723566",
"0.7720881",
"0.7713283",
"0.77106804",
"0.77106804",
"0.77022994",
"0.7691871",
"0.7667561",
"0.7667561",
"0.7661582",
"0.7652605",
"0.7641705",
"0.763889",
"0.76196074",
"0.76111233",
"0.76046264",
"0.7601931",
"0.75922793",
"0.75881153",
"0.75881153",
"0.7584998",
"0.7579878",
"0.7571603",
"0.7567794",
"0.75596464",
"0.75551796",
"0.75512475",
"0.7537276",
"0.7532415",
"0.753137",
"0.753137",
"0.75257605",
"0.7521986",
"0.7513701",
"0.7501254",
"0.7497554",
"0.74879587",
"0.7475739",
"0.7472245",
"0.746987",
"0.74689424",
"0.74529576",
"0.7443308",
"0.7406656",
"0.74038255",
"0.740326",
"0.7403144",
"0.73928785",
"0.7384139",
"0.7377498",
"0.73706293",
"0.736429",
"0.73636127",
"0.73629624",
"0.73605335",
"0.7358867",
"0.7353627",
"0.7350448",
"0.734501",
"0.7344101",
"0.7344101",
"0.7343684",
"0.73381585",
"0.7338145",
"0.7335508",
"0.7331209",
"0.7315114",
"0.7303622",
"0.7299287",
"0.7296073"
] | 0.7590818 | 48 |
Metodo set y get | public function __SET($att, $valor){
$this->$att = $valor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setY($y) {}",
"public function setY($y);",
"public function getY() {}",
"public function getY() {}",
"private function setY( $y )\n\t{\n\t\t$this->y = Args::int($y)->required()->min(0)->value();\n\t}",
"public function getY();",
"function SetY($y)\n\t\t{\n\t\t\t$this->x=$this->lMargin;\n\t\t\tif($y>=0)\n\t\t\t\t$this->y=$y;\n\t\t\telse\n\t\t\t\t$this->y=$this->h+$y;\n\t\t}",
"public function y($value) {\n return $this->setProperty('y', $value);\n }",
"public function setY($y)\n {\n $this->y = $y;\n return $this;\n }",
"public function y($y)\n {\n $this->y = $y;\n\n return $this;\n }",
"function get()\n {\n }",
"abstract public function set();",
"public function getY()\n\t{\n\t\treturn $this->y;\n\t}",
"public function getY()\n\t{\n\t\treturn $this->y;\n\t}",
"public function getY() {\n\t\t\treturn $this->_y;\n\t\t}",
"public function getY(): int;",
"public function get( /* void */ );",
"public function getY(){\r\r\n\t\treturn $this->y_Atual;\r\r\n\t}",
"public function setUry($ury) {}",
"function setYear($y)\r\n {\r\n if($y < 0 || $y > 9999) {\r\n $this->ano = 0;\r\n } else {\r\n $this->ano = $y;\r\n }\r\n }",
"public function getValY() {\n return $this->valY;\n }",
"public function getY()\n {\n return $this->y;\n }",
"public function setGet($getData)\n {\n $this->_get = $getData;\n }",
"public function __set($name, $value){\n\t\t\t//echo $name.'<br>'.$value.'<br>';\n\t\t\t//IMP po tozi na4in zadavam klu4 imeto na promenlivata ! i stoinost \n\t\t\t//ravna na stoinostta na promenlivata !!!\n\t\t\t//oba4e ne mi dava da go 4eta i polzvam __GET !\n\t\t\t$this->data[$name] = $value;\n\t\t}",
"abstract public function get() ;",
"public function toY($y)\n\t{\n\t\t$this->setMethod('to_Y');\n\t\t$this->setY($y);\n\t\treturn $this;\n\t}",
"public function setYAxis($y);",
"protected function _fixY($y) {}",
"public function getYAxis();",
"public function setX($x) {}",
"abstract public function get();",
"abstract public function get();",
"abstract public function get();",
"abstract public function get();",
"abstract public function get();",
"abstract public function get();",
"function doGetterSetter() {\n\tglobal $description_obj;\n\tglobal $table_name, $class_name;\n\tglobal $tabs, $tab2, $tab3;\n\n\tfComment($tabs,\"Getters and Setters\");\n\tforeach($description_obj as $obj) {\n\t\t//print_r($obj);\n\n\t\techo $tabs,\"/// getter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function get_{$obj->Field}()\\t\\t{return \\$this->$obj->Field;}\\n\",\n\t\t\t $tabs,\"/// setter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function set_{$obj->Field}(\\$val)\\t{\\$this->$obj->Field = \",assignEscape($obj),\";}\\n\",\n\t\t\t \"\\n\";\n\t}\n\techo $tabs,\"public function get_last_error()\\t\\t{return \\$this->_last_error;}\\n\";\n\techo \"\\n\\n\";\n}",
"public function setY(float $y): self\n\t{\n\t\t$this->y = $y;\n\t\treturn $this;\n\t}",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"private function getYLabel() {\n\t\treturn $this->yLabel;\n\t}",
"function SetXY($x,$y)\n\t\t{\n\t\t\t$this->SetY($y);\n\t\t\t$this->SetX($x);\n\t\t}",
"abstract function get();",
"abstract protected function alter_get($name);",
"public function getY()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->y);\n }",
"public function getGet ();",
"function set_property(){\n }",
"public function __set($key, $val) {\n\tif (in_array(strtoupper($key), array_keys($this->paths))) trigger_error('You are not allowed to re-define '.$key, E_USER_NOTICE);\n\telse return $this->data[$key] = $val;\n}",
"public function __get($key) {\n\t}",
"public function set($data);",
"public function getSetVariables() {}",
"public static function setters();",
"public function testSetYaDroitsCollab() {\n\n $obj = new Collaborateurs();\n\n $obj->setYaDroitsCollab(true);\n $this->assertEquals(true, $obj->getYaDroitsCollab());\n }",
"public function setY($y)\n {\n $this->_x = $this->_lMargin;\n\n if ($y >= 0) {\n $this->_y = $y;\n } else {\n $this->_y = $this->_h + $y;\n }\n\n return $this->_pdfDocument;\n }",
"function set($key,$val) {\n\t\treturn $this->args[$key]=$val;\n\t}",
"public function get() {}",
"public function get() {}",
"public function get() {}",
"public function get() {}",
"public function get() {}",
"public function y() {\n return $this->coords[1];\n }",
"public function set()\n {\n // to reflect the current bar.\n\n // Why?\n\n // Otherwise the bar count gets repeated. And that people notice.\n\n $this->variables->setVariable(\"count\", $this->bar_count);\n $this->variables->setVariable(\"max_bar_count\", $this->max_bar_count);\n\n $this->variables->setVariable(\"refreshed_at\", $this->current_time);\n }",
"public function setGoal()\n {\n }",
"public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }",
"public function set(int $x, int $y, $value): void\n {\n $this->initCache();\n $this->table->get($y)->set($x, $value);\n }",
"public function __set($name, $value){\r\n echo \"You are trying to direct set property \".$name.\" to value \".$value.\" and thats not possible use set\".$name.\"(\\$value) method.\";\r\n echo \"<br/> At line \".__LINE__.\" in file \".__FILE__;\r\n }",
"public function setCursorY($y)\n {\n $this->pdf->setCursorY($this->moveToGlobal_v($y));\n\n return $this;\n }",
"public function setX($x);",
"abstract public function set($in): void;",
"public function __set($_name, $_value);",
"function setAukstis($x) {\n $this->aukstis = $x; // privaciai reiksmei priskiriam kintamaji, kuris bus kazkuom pakeistas\n }",
"#[@test]\n public function repeat_canSetGet() {\n $this->sut->setRepeat(5);\n $this->assertEquals(5, $this->sut->getRepeat());\n }",
"public function get()\n {\n }",
"public function __get($key)\n {\n }",
"public function __get($key)\n {\n }",
"function __get($name)\n { return $this->$name = $this->$name();\n }",
"function set($key, $value);",
"function set($key, $value);",
"function set($key, $value);",
"function yy_r123(){\n $this->_retvalue = ['key', $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor];\n }",
"public function __set($key, $value) {\n\t}",
"private function setOptsFromGET(){\n\n $this->_opt['save'] = 0;\n\n $this->_opt['show_reps'] = 1;\n\n /* Replace default Options with GET params */\n\n foreach($_GET as $key=>$value){\n\n $this->_opt[$key] = $value;\n }\n\n \n\n }",
"public function testGetSet()\n {\n $term = new LP21Term('type', 'uuid');\n $term\n ->setUrl('url')\n ->setCode('code')\n ->setCantons(['BE'])\n ->setVersion('version')\n ->setCycles([1]);\n\n $this->assertEquals('url', $term->getUrl(), \"The getter/setter works for URLs.\");\n $this->assertEquals('code', $term->getCode(), \"The getter/setter works for codes.\");\n $this->assertEquals(['BE'], $term->getCantons(), \"The getter/setter works for cantons.\");\n $this->assertEquals('version', $term->getVersion(), \"The getter/setter works for versions.\");\n $this->assertEquals([1], $term->getCycles(), \"The getter/setter works for cycles.\");\n }",
"public function yField($value) {\n return $this->setProperty('yField', $value);\n }",
"public function setToUpdate()\n\t{\n\t\t$this->todo = 2 ;\n\t}"
] | [
"0.6363728",
"0.6136115",
"0.6089541",
"0.6089541",
"0.6062137",
"0.59562266",
"0.58613324",
"0.5780673",
"0.5758664",
"0.57502437",
"0.56107354",
"0.5470146",
"0.5464834",
"0.5464834",
"0.5432925",
"0.54275966",
"0.5425754",
"0.5396755",
"0.53566086",
"0.53531986",
"0.53033745",
"0.5297357",
"0.52838314",
"0.52680993",
"0.5241097",
"0.5238912",
"0.52293783",
"0.52076465",
"0.5200474",
"0.51587456",
"0.5098608",
"0.5098608",
"0.5098608",
"0.5098608",
"0.5098608",
"0.5098608",
"0.5087776",
"0.50608546",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5043446",
"0.5040409",
"0.5016425",
"0.50072277",
"0.49964792",
"0.4984786",
"0.49838597",
"0.49548924",
"0.49461395",
"0.4919392",
"0.49175572",
"0.4911145",
"0.48968107",
"0.48965728",
"0.4889036",
"0.48818803",
"0.48651087",
"0.48641813",
"0.48641813",
"0.48641813",
"0.48641813",
"0.4860106",
"0.484678",
"0.4845982",
"0.4819176",
"0.48167711",
"0.48121294",
"0.48077092",
"0.48062968",
"0.4802846",
"0.4790749",
"0.47879985",
"0.4767761",
"0.47676522",
"0.476152",
"0.476152",
"0.47611246",
"0.475782",
"0.475782",
"0.475782",
"0.47569838",
"0.47544584",
"0.47449994",
"0.47433728",
"0.47407335",
"0.47382134"
] | 0.0 | -1 |
metodo para listar los usuarios | public function listarUsuarios(){
$sql = "SELECT U.IdUsuario, U.NombreCompleto, U.Usuario, U.Correo, U.Estado, U.IdRol, R.Rol
FROM usuarios AS U
INNER JOIN roles AS R ON U.IdRol = R.IdRol;";
$tabla = $this->conexion->getTable($sql);
return $tabla;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ListarUsuarios()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"function listar_usuarios() {\n\t\t$query = \"SELECT colaboradores.*, colaboradores_permisos.*\n\t\tFROM colaboradores, colaboradores_permisos\n\t\tWHERE colaboradores.id_colaborador=colaboradores_permisos.id_colaborador\n\t\tAND colaboradores.estado=1\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function get_usuarios()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = \"SELECT * FROM usuarios\";\n\n\t\t\t$resultado = $this->db->prepare($sql);\n\n\t\t\tif(!$resultado->execute())\n\t\t\t{\n\t\t\t\techo \"<h1 class='text-danger bg-danger'>Falla en la consulta</h1>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile($reg = $resultado->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->usuarios[] = $reg;\n\t\t\t\t}\n\n\t\t\t\treturn $this->usuarios;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie(\"Error: {$e->getMessage()}\");\n\t\t}\n\t}",
"public function getUsersList()\n {\n }",
"function getUsuarios(){\n\t\n\t\treturn conectar()->query( \"SELECT * FROM usuarios\");\n\t}",
"public static function getList(){\n\t\t$sql = new sql();\n\n\t\treturn $sql->select(\"SELECT * FROM usuarios ORDER BY email;\");\n\n\t}",
"public function Listar()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = array();\n\n\t\t\t$stm = $this->pdo->prepare(\"SELECT usuario.`correo`, `usuario`.`clave`, `rol`.`nomRol`, `datospersonales`.`Documento`\nFROM `usuario`\nLEFT JOIN `rol` ON `rol`.`nomRol` = `usuario`.`nomRol` \nLEFT JOIN `datospersonales` ON `datospersonales`.`Documento` = `usuario`.`Documento`\n WHERE correo is not null \");\n\t\t\t$stm->execute();\n\n\t\t\tforeach($stm->fetchAll(PDO::FETCH_OBJ) as $r)\n\t\t\t{\n\t\t\t\t$usu = new Usuario();\n\n\t\t\t\t$usu->__SET('correo', $r->correo);\n\t\t\t\t$usu->__SET('clave', $r->clave);\n\t\t\t\t$usu->__SET('nomRol', $r->nomRol);\n\t\t\t\t$usu->__SET('Documento', $r->Documento);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t$result[] = $usu;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}",
"function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}",
"public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }",
"public function buscarUsuarios(){\n\t\t}",
"public function listarUsuarios()\n {\n $usuarios = Usuarios::all();\n\n return $usuarios;\n }",
"public function listarUsua(){\n\t\t$sql=\"SELECT USUARI_ID, USUARI_NOMBRES, USUARI_USUARIO\n\t\t FROM usuario ORDER BY USUARI_NOMBRES\";\n\t\treturn ejecutarConsulta($sql);\n\t}",
"public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }",
"static public function ctrListarUsuario( ){\n\n\t\treturn ModeloUsuarios::mdlListarUsuario( );\n\n\t}",
"public static function getlist(){\n $sql = new Sql();\n \n return $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }",
"public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}",
"public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }",
"public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}",
"public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }",
"function ListaUsuarios() {\n\t//obtiene el id del usuario\n $sql = \"SELECT usuario.id, usuario.nombre_usuario, persona.primer_nombre, persona.primer_apellido, usuario.estado, rol.descripcion FROM usuario INNER JOIN persona ON usuario.persona_id = persona.id INNER JOIN rol ON usuario.rol_id = rol.id WHERE usuario.estado = 'ACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\t\t$respuesta->mensaje = \"Usuarios listados\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de usuarios !\";\n\t\t$respuesta->codigo = 0;\n\t}\n\treturn json_encode($respuesta);\n}",
"function listarUsuarios(){\n \n $conex=Conexion::getInstance();\n $stmt = $conex->dbh->prepare(\"SELECT * FROM usuarios\"); \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->execute();\n $listaUsuarios=[];\n while ($row = $stmt->fetch()){\n $listaUsuarios[]=array('id'=>$row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],'admin'=>$row['admin'],'password'=>$row['password']) ; \n }\n return $listaUsuarios;\n}",
"private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}",
"public function listarUsuarios()\r\n\t{\r\n\t\t$administradores=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_apellido']=$row['ADMIN_APELLIDO'];\r\n\t\t\t$fila['admin_status']=$row['ADMIN_STATUS'];\r\n\t\t\t$administradores[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $administradores;\t\t\r\n\t}",
"public function listarUsuariosAction(){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usuario = $em->getRepository('TheClickCmsAdminBundle:Usuarios')->findAll();\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:listarUsuarios.html.twig', array('usuario' => $usuario));\n\t}",
"public function getUsers()\n {\n return Security::getUserList();\n }",
"public static function get_usuarios(){\n\t\t\n\t\t$query = \"SELECT * FROM usuarios\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->execute();\n\n\t\t$filas=$resultado->fetchAll();\n\n\t\t\n\t\treturn $filas;\n\n\t}",
"public function getUsuarios(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraUsuarios\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM usuarios \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM usuarios LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}",
"public static function getUsuarios()\n {\n $query = \"SELECT id,nombre,email,usuario,privilegio,fecha_registro FROM users\";\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->execute();\n\n $filas = $resultado->fetchAll();\n\n return $filas;\n }",
"public function readUsuarios()\n\t{\n\t\t$sql = 'SELECT IdRol, Nombre, Apellido, Telefono, Email, u.IdEstado, IdUsuario \n FROM usuarios u ORDER BY Apellido';\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}",
"protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }",
"public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}",
"private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }",
"public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}",
"function listUsers() {\n return $this->users;\n }",
"public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }",
"function list_users() {\n $status = session_status();\n if($status == PHP_SESSION_NONE){\n session_start(); /// initialize session\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n return $d[\"users\"];\n }",
"function showUsuarios()\r\n\t{\r\n\t\t$valuesUsuarios = $this->User->find('all', array('conditions' => array('User.active' => 1),'order' => 'User.first_lastname ASC'));\r\n\t\t\r\n\t\tforeach ($valuesUsuarios as $value)\r\n\t\t{\r\n\t\t\t$resultadosUsuarios[$value['User']['id']]= $value['User']['first_lastname'].' '.$value['User']['second_lastname'].', '.$value['User']['name'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $resultadosUsuarios;\r\n\t}",
"function listUsers()\n{\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/config/config.php\");\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/class/autoload.php\");\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/vendor/autoload.php\");\n $db = new cMariaDb($Cfg);\n\n // Generateur de templates\n $tpl = new Smarty();\n $tpl->template_dir = $_SERVER[\"DOCUMENT_ROOT\"].\"/tools/templates\";\n $tpl->compile_dir = $_SERVER[\"DOCUMENT_ROOT\"].\"/templates_c\";\n\n $sSQL = \"SELECT id, sNom, sPrenom, sEmail, sTelMobile, sLogin FROM sys_user WHERE bActive=1 ORDER BY sNom, sPrenom;\";\n\n // Récupérer les éléments \n $tpl->assign(\"Users\",$db->getAllFetch($sSQL));\n $sHtml = $tpl->fetch(\"editUsers.smarty\");\n return [\"Errno\" => 0, \"html\" => $sHtml ];\n}",
"public static function ListarUsuarios(){\n return (new Usuario)->FindBy([],[\"nombre asc\"]);\n }",
"public function getUsuaris()\n {\n $usuarios = $this->_db->query(\"select * from usuarios\");\n return $usuarios->fetchall();\n }",
"public function listausuarios(){\n $user = Usuario::with('rol')->paginate(15);\n $lista_usuarios = compact('user'); \n\n return $this->sendResponse($lista_usuarios, 'Listado de usuarios devueltos con éxito');\n\n }",
"public function infoUsuariosPorProyectoList(){\n\n $usuarios = UsersModel::infoUsuariosPorProyecto(\"usuario\", $_SESSION[\"id_project\"]);\n \n foreach ($usuarios as $row => $item) {\n echo '<option value=\"'.$item[\"Email\"].'\">'.$item[\"Email\"].'</option>'; \n }\n\n }",
"public static function getUsers($request){\r\n //CONTEUDO DA PAGINA DE USUARIOS\r\n $content= View::render('admin/modules/users/index',[\r\n 'itens' => self::getUserItems($request,$obPagination),\r\n 'pagination' => parent::getPagination($request,$obPagination),\r\n\t\t\t'status' => self::getStatus($request)\r\n ]);\r\n\r\n //RETORNA A PAGINA COMPLETA \r\n return parent::getPanel('Usuarios - AliDEV',$content,'users');\r\n\r\n\r\n }",
"public function getUsers();",
"public function getUsers();",
"public function getUsers();",
"function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }",
"function all_usuarios(){\n\t\t$Query = 'SELECT * FROM tb_usuarios';\n\t\t$respuesta = ObtenerRegistros($Query);\t\n\t\treturn ConvertirUTF8($respuesta);\n\t}",
"public function getUsuarios()\n {\n\n $sql = \"SELECT * FROM usuario\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->usuarios[] = $res;\n }\n return $this->usuarios;\n\n }",
"function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}",
"public function lista() { // Aqui define o ação: /users/lista\n $usuarios = new Users(); // Aqui carrega o model: Users\n $dados['usuarios'] = $usuarios->getUsuarios();\t\n if(isset($_GET['id']) && !empty($_GET['id'])) {\t\n $this->loadTemplate('user_contact', $dados);\n }else { $this->loadTemplate('users_list', $dados);\n }\n }",
"function getList() {\n $this->db->getCursorParameters(self::TABLA);\n $respuesta = array();\n while ($fila = $this->db->getRow()) {\n $objeto = new Usuario();\n $objeto->set($fila);\n $respuesta[] = $objeto;\n }\n return $respuesta;\n }",
"function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}",
"public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }",
"function getUsuarios()\n{\n\t$con = getDBConnection();\n\t$sql = \"SELECT * FROM usuarios\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->execute();\n\t$usuarios = null;\n\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$usuario = new Usuario();\n\t\t$usuario->setID($row['id']);\n\t\t$usuario->set($row['nombre'],$row['apellidos'],$row['user_name'],$row['password'],$row['email']);\n\t\t$usuarios[] = $usuario;\n\t}\n\treturn $usuarios;\n}",
"function get_user_list(){\n\t\treturn array();\n\t}",
"function getUsersAdmin() {\n $usuarios = [];\n\n $con = crearConexion();\n\n $query = \"SELECT `username` FROM `usuario` WHERE `tipo`='0'\";\n\n $result = mysqli_query($con, $query);\n\n while ($row = mysqli_fetch_array($result)) {\n $usuarios[] = $row['username'];\n }\n\n cerrarConexion($con);\n return $usuarios;\n}",
"public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }",
"public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}",
"public static function getList(){\n\t\t\t$sql = new sql();\n\n\t\t\treturn $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogim\");\n\t\t}",
"function wfSpecialListusers( $par = null ) {\n\tglobal $wgRequest;\n\n\tlist( $limit, $offset ) = wfCheckLimits();\n\n\n\t$slu = new ListUsersPage();\n\t\n\t/**\n\t * Get some parameters\n\t */\n\t$groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );\n\t$slu->requestedGroup = $groupTarget;\n\t$slu->requestedUser = $wgRequest->getVal('username');\n\n\treturn $slu->doQuery( $offset, $limit );\n}",
"public function listUsers($fields = null);",
"public function getAllUsers() {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->getAllUsers();\n }",
"function usersList($da){\r\n\t\t\treturn $this->trouverTout();\r\n\t\t}",
"public function listUsersAdmin(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=1\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }",
"public function getUserList(): array {\n\t\t$sql = 'SELECT u.id, u.login, u.mail, r.name role FROM users u\n\t\t\t\tINNER JOIN roles r ON u.role = r.id\n\t\t\t\tWHERE u.login != :mylogin';\n\n\t\treturn $this->queryRows($sql, ['mylogin' => $_SESSION['user']['login']]);\n\t}",
"public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}",
"public function get_all() {\n\t\t\n\t\treturn $this->db->get('usuarios');\n\t}",
"public function listAction(){\n $r=$this->getRequest();\n $query=Doctrine_Query::create()\n ->select(\"uo.orgid, u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,r.role\")\n ->from(\"Users u\")\n ->leftJoin(\"u.Role r\")\n ->leftJoin(\"u.UsersOrganizations uo\")\n ->where(\"uo.orgid=\".$r->getParam('orgid'))\n ->addWhere(\"uo.active=\".Constants::UTENTE_ATTIVO);\n list($users,$total)=DBUtils::pageQuery($query,array(),$this->getLimit(),$this->getOffset());\n $this->emitTableResult($users,$total);\n }",
"public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }",
"public function listUsers() {\n\t\t$users = Common::loadJSON(\"users\");\n\t\t$temp = array();\n\n\t\t//Remove the user in session.\n\t\tforeach ($users as $username => $data) {\n\t\t\tif ($username == $this->activeUser) continue;\n\t\t\t$temp[] = $username;\n\t\t}\n\n\t\treturn $temp;\n\t}",
"public function index()\n {\n $usuarios = dev_Usuario::get();\n return $usuarios;\n }",
"function getUsers(){\n }",
"function getUsers(){\n }",
"public function getList(){\n\t\t$resultsUsers = [];\n\t\t$q = $this->pdo->query('SELECT * FROM utilisateur');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsUsers[] = new Utilisateur($donnee);\n\t\t}\n\t\treturn $resultsUsers;\n\t}",
"private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }",
"public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}",
"public function getUsuarios()\n {\n return $this->usuarios;\n }",
"public function ls_user_get()\n {\n $this->db->select('id, idrol,rol, nombre, correo, activo');\n $this->db->from('vusuarios');\n $query = $this->db->get();\n if ($query && $query->num_rows() >= 1) {\n $usuarios = $query->result();\n\n foreach ($usuarios as $row) {\n $row->id = (int) $row->id;\n $row->idrol = (int) $row->idrol;\n $row->rol = (int) $row->rol;\n $row->nombre = $row->nombre;\n $row->correo = (int) $row->correo;\n $row->activo = $row->activo;\n }\n $respuesta = array(\n 'usuarios' => $usuarios,\n );\n $status = 200;\n } else {\n $respuesta = array(\n 'message' => 'Valide sus datos de acceso',\n );\n $status = 401;\n }\n $this->response($respuesta, $status);\n }",
"function list_users(){\r\n\t\t$query = $this->db->query(\"SELECT userid, concat(fname, ' ', lname, ' (', username, ')') as name FROM nf_users\");\r\n\t\t$return = array();\r\n\t\tforeach($query->result() as $row){\r\n\t\t\t$return[$row->userid] = $row->name;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}",
"public static function listUsers()\n {\n //Init curl\n $curl = new curl\\Curl();\n\n // GET request to api\n $response = $curl->get(Yii::$app->params['listUsers']);\n\n $records = json_decode($response, true);\n\n foreach($records as $users){\n foreach($users as $user){\n $list[$user['id']] = $user['name'] . ' ' . $user['last_name'];\n }\n }\n\n return $list;\n }",
"function listerUtilisateur()\n\t{\n\t\t$req=\"select idUti, nomUti, prenomUti, photoUti, telPorUti, mailUti, statutUti from utilisateur\";\n\t\t$exereq = mysql_query($req) or die(mysql_error());\n\t\n\t\twhile($ligne=mysql_fetch_array($exereq))\n\t\t{\n\t\t\t$tab[]=$ligne;\n\t\t}\n\n\t\treturn $tab;\n\t}",
"function get_user_list()\n {\n $query = $this->db->get('user_login');\n return $query->result();\n }",
"public static function obtenerUsuarios()\n {\n $consulta = \"SELECT * FROM usuarios, usuarios_roles WHERE (usuarios.rol=usuarios_roles.id_rol) ORDER BY usuarios.nombres ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function getUsers()\n {\n $usuarios = $this->Etapas->getUsers()->usuarios->usuario; //usuarios seg.users\n echo json_encode($usuarios);\n }",
"function listar()\n {\n $query = $this->db->get(\"usuarios\");\n return $query->result_array();\n }",
"function admin_get_users()\n{\n global $app;\n\n $users = $app->bbs->users();\n $app->render('admin_users.html', [\n 'page' => mkPage(getMessageString('admin_users'), 0, 2),\n 'users' => $users,\n 'isadmin' => is_admin()]);\n}",
"function mysql_auth_user_list()\n{\n return dbFetchRows(\"SELECT * FROM `users`\");\n}",
"function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }",
"public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}",
"public function showAllUsers()\n {\n // añadir condicion de if para admins y clients\n $tipo = request()->get('tipo');\n if (isset($tipo))\n {\n if ($tipo == 'administradores') {\n $users = User::all()->where('is_admin', 1);\n } else {\n $users = User::all()->where('is_admin', 0);\n }\n } else {\n $users = User::all();\n }\n return view('users.list', compact('users'));\n }",
"public function index()\n {\n $this->user_list();\n }",
"public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}",
"function get_users()\n {\n //Unimplemented\n }",
"function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}",
"function modele_get_liste_user() {\n\n\t\t$req = 'SELECT * FROM p_user ';\n\n\t\t$reqPrep = self::$connexion->prepare($req);\n\n\t\t$reqPrep->execute();\n\n\t\t$enregistrement = $reqPrep->fetchall(PDO::FETCH_ASSOC);\n\n\t\treturn $enregistrement;\n\t}",
"public function mostrar_usuaris(){\n $sql = \"SELECT usuaris.id AS id, usuaris.nom AS nom, usuaris.cognoms AS cognoms, usuaris.email AS email,\n usuaris.idrol AS idrol, rols.descrip AS descrip FROM usuaris INNER JOIN rols ON usuaris.idrol = rols.id\";\n \n $query=$this->db->prepare($sql);\n $query->execute();\n $res=$query->fetchAll();\n return $res;\n }",
"function getAllUsuarios(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllUsuarios');\n\t\t\treturn $data;\n\t\t}",
"public static function getAllUsuario(){\n $v = array();\n\t\t$conexion = new Database();\n $sql = sprintf('SELECT * FROM agenda_usuarios' );\n $rows = $conexion->query( $sql );\n\n foreach( $rows as $row ){\n\t\t\t$u = new Usuario();\n\t\t\t$u->usuario = $row['USUARIO'];\n $u->password = $row['PASSWORD'];\n $u->codigo = $row['USUARIO_ID'];\n\t\t\t$v[] = $u;\n\t\t}\n return $v;\n }",
"public function getUserList()\n {\n return $this->userDao->getUserList();\n }"
] | [
"0.78207797",
"0.76048064",
"0.76033914",
"0.75726014",
"0.7557005",
"0.7498634",
"0.749763",
"0.7495554",
"0.7481407",
"0.74708736",
"0.74682623",
"0.746785",
"0.7467094",
"0.7442689",
"0.743069",
"0.7408872",
"0.73743933",
"0.7362525",
"0.7352632",
"0.73506176",
"0.73305756",
"0.7324534",
"0.7306947",
"0.72518486",
"0.72462106",
"0.7244832",
"0.722899",
"0.7225824",
"0.7215846",
"0.7204169",
"0.7174996",
"0.71702343",
"0.7167469",
"0.71579087",
"0.7156863",
"0.7153991",
"0.7150966",
"0.71387",
"0.7137327",
"0.71364915",
"0.7135565",
"0.7134025",
"0.7123861",
"0.71161735",
"0.71161735",
"0.71161735",
"0.71093994",
"0.7097143",
"0.7090988",
"0.70814264",
"0.706609",
"0.70558417",
"0.70365536",
"0.7033388",
"0.7032918",
"0.70324826",
"0.7014015",
"0.70096093",
"0.70093924",
"0.70009834",
"0.69964266",
"0.6994185",
"0.69912827",
"0.6970456",
"0.6969102",
"0.69536626",
"0.69515437",
"0.69440323",
"0.6942446",
"0.69392705",
"0.6933128",
"0.69307584",
"0.69305295",
"0.69305295",
"0.6924883",
"0.6912722",
"0.6895463",
"0.689324",
"0.6885858",
"0.68826526",
"0.68786764",
"0.6874482",
"0.6870854",
"0.6866697",
"0.6862974",
"0.686273",
"0.68606246",
"0.68592584",
"0.68565106",
"0.68549234",
"0.68510586",
"0.6845588",
"0.6833662",
"0.6801814",
"0.6797351",
"0.6791591",
"0.67911774",
"0.6789973",
"0.6785419",
"0.678147"
] | 0.68467873 | 91 |
metodo para listar los roles | public function listarRoles(){
$sql = "SELECT * FROM roles;";
$roles = $this->conexion->getTable($sql);
return $roles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles()\n {\n $this->roles = $this->Role->list($_SESSION['guild_id']);\n }",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function rolesForUser();",
"public static function listarRoles(): array {\n $consulta = \"SELECT * FROM rol ORDER BY nombre\";\n return Conexion::getInstancia()->seleccionar($consulta);\n }",
"abstract protected function getRoles();",
"function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function findRoles() {\n\t\t\n\t}",
"public function & GetRoles ();",
"public function getAllRoles(): array;",
"private function get_all_roles(){\n return Role::all();\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles(): array;",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function list_roles(){\n $roles=$this->roles->pluck('name')->toArray();\n //el primer parametro es el separador, y el segundo para es el arreglo a seprar\n // es lo opuesto al explode que retorna una arreglo\n $string=implode(', ',$roles);\n return $string;\n\n }",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }",
"public function roleList()\n {\n $roleList = '<ul>';\n foreach ($this->roles as $role) {\n $roleList .= '<li>'.$role->name.'</li>';\n }\n $roleList .= '</ul>';\n\n return $roleList;\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }",
"public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }",
"public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"public function getAvailableRoles() ;",
"public function getRoles(){\n\n $roles = $this->visiteur_roles->map(function($role){\n return $role->getTitle();\n })->ToArray();\n\n $roles[]= 'ROLE_USER';\n \n return $roles;\n }",
"public function getRoles(): iterable\n {\n return [];\n }",
"public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }",
"public function getRolesNames ();",
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public function getRoles()\n {\n return array('1');\n }",
"private function load_roles() {\n $query = $this->PDO->prepare(\"SELECT * FROM rol\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function index()\n {\n return Roles::all();\n }",
"public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = ' <a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"public function listarRoles()\n {\n //return AutorizadorRol::all();\n\n $roles = AutorizadorRolAccion::join('autorizador_roles', 'autorizador_rol_acciones.rol_id', '=', 'autorizador_roles.id')\n ->selectRaw('autorizador_rol_acciones.id as accion_id,\n autorizador_rol_acciones.accion as controlador,\n autorizador_roles.id as rol_id,\n autorizador_roles.rol as rol,\n autorizador_roles.descripcion as descripcion'\n )->orderBy('rol')->get(); \n return response()->json($roles);\n }",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"function getAllRoles() {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT DISTINCT role FROM users');\n // exécution\n $query -> execute();\n // renvoie un tableau associatif\n return $query -> fetchAll();\n}",
"function getRoles () {\n return array(\"user.image.edit\",\"user.image.view\");\n }",
"public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}",
"public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }",
"public function getRoleList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_role');\n\t\t$this->db->where('role_status', '1');\n\t\t$this->db->where('role_id !=', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}",
"public function getRoles()\r\n {\r\n return $this->roles;\r\n }",
"public function getRoleList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_role');\r\n\t\t$this->db->where('role_status', '1');\r\n\t\t$this->db->where('role_id !=', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}",
"public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }",
"public function getRoles() \n {\n return $this->roles;\n }",
"public function roles()\n {\n\n $roles = get_editable_roles();\n $output = array();\n foreach ($roles as $key => $val) {\n $output[$key] = $val['name'];\n }\n return $output;\n }",
"public function getList() {\n $data['data'] = $this->role->get();\n return view('roles.list_role',$data);\n }",
"public static function getRoleList()\n {\n return Rights::getAuthItemSelectOptions(CAuthItem::TYPE_ROLE, array(\n 'authenticated', 'guest'\n ));\n }",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"public function index()\n {\n return Role::all();\n }",
"public function index()\n {\n return Role::all();\n }",
"public function getRoles()\n\t{\n\t\t$roles = array_map(function($value)\n\t\t{\n\t\t\treturn Html::a($value, $value->links['self']);\n\t\t}, $this->entity->roles);\n\n\t\treturn join('<br>', $roles);\n\t}",
"public function getRoles()\n {\n return [$this->role];\n }",
"public function getRoles()\n {\n return [$this->role];\n }",
"public function listRoles($user) {\n return $user->roles;\n }",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"public static function manageRole(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM hp_role'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }",
"public function roles()\n {\n\n return Role::all();\n }",
"function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }",
"public function getRoles()\n {\n return $this->userRoles->toArray();\n /*$roles = array();\n foreach ($this->userRoles as $role) {\n $roles[] = $role->getRole();\n }\n\n return $roles;*/\n }",
"public function findAll() {\n\n // Récupération des différents type d'utilisateur\n $result = $this->getDb()->fetchAll(\"select * from roles order by nom asc\");\n \n $roles = array();\n foreach ($result as $row) {\n $roles[$row['id']] = $this->buildDomainObject($row);\n }\n return $roles;\n }",
"function populate_roles()\n {\n }",
"public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles(): array\n {\n return ['admin'];\n }",
"public function getRoles()\n\t{\n\t\t$roles = $this->role_gestion->all();\n\n\t\treturn view('back.users.roles', compact('roles'));\n\t}",
"function roleListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $type = $this->login_id;\n $data['userRecords'] = $this->user_model->roleListing($type);\n\n $this->global['pageTitle'] = '角色管理';\n\n $this->loadViews(\"systemrolemanage\", $this->global, $data, NULL);\n }\n }",
"public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }",
"public function getRoles()\n\t{\n\t\treturn $this->roles->toArray();\n\t}",
"function get_roles () {\r\n //if (!check_admin()) return false;\r\n $conn = db_connect();\r\n $query = \"select * from roles\";\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n }\r\n if ($result->num_rows == 0) {\r\n // throw new Exception(\"No records in roles table!\");\r\n }\r\n\r\n $result = db_result_to_array($result);\r\n return $result;\r\n }",
"function get_all_roles()\n {\n $this->db->order_by('role', 'asc');\n return $this->db->get('tbl_roles')->result_array();\n }",
"public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }",
"public function getRoles(){\n\n return $this->_arrRoles;\n \n }",
"public static function roles(){\n self::init();\n\n return array_keys(AUTH_USER_ROLES);\n }",
"function getList() {\n return $this->listRole;\n }",
"protected abstract function getAllowedRoles();",
"public function getRoles()\n {\n return array(\"ROLE_\".$this->getUserGroup());\n }",
"function getRolesList(){\r\n\t\t$sql=\"select * from m_employee_roles\";\r\n\t\t$res=$this->db->query($sql);\r\n\t\tif($res->num_rows()){\r\n\t\t\treturn $res->result_array($sql);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function getRoles(): array\n {\n return [$this->role];\n }",
"public function show_roles(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/all_role';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\t\n\t\t\n\t}",
"public function getRoles()\n {\n return array($this->role);\n }",
"public function getRoles(): array\n {\n return $this->roles;\n }",
"public function getRoles(): array\n {\n return $this->roles;\n }"
] | [
"0.83633816",
"0.83633816",
"0.83633816",
"0.83633816",
"0.81755066",
"0.8131361",
"0.8114498",
"0.81133765",
"0.8090614",
"0.807609",
"0.804459",
"0.8039804",
"0.8006764",
"0.798572",
"0.7983123",
"0.7980903",
"0.7970759",
"0.7948706",
"0.7948706",
"0.7948706",
"0.7865419",
"0.7730587",
"0.77293205",
"0.77255845",
"0.7725555",
"0.7719864",
"0.7702422",
"0.7702019",
"0.7661078",
"0.76510674",
"0.7622937",
"0.7616032",
"0.7615224",
"0.75809246",
"0.7572537",
"0.7563464",
"0.7552368",
"0.7534607",
"0.75192046",
"0.7511655",
"0.7500964",
"0.749797",
"0.74869555",
"0.7482523",
"0.74804807",
"0.747967",
"0.7459541",
"0.7448782",
"0.7447931",
"0.741673",
"0.7405781",
"0.7399483",
"0.73990667",
"0.739395",
"0.7383341",
"0.73833275",
"0.7369698",
"0.7360323",
"0.73593575",
"0.73529774",
"0.7331775",
"0.73309845",
"0.73309845",
"0.7330126",
"0.7327052",
"0.7327052",
"0.7324488",
"0.7323059",
"0.73165727",
"0.731382",
"0.7313673",
"0.73034483",
"0.730106",
"0.7296485",
"0.7283588",
"0.7276897",
"0.7276897",
"0.7276897",
"0.7276897",
"0.7276897",
"0.7276897",
"0.7264115",
"0.7256585",
"0.72561544",
"0.72543466",
"0.72479427",
"0.7247855",
"0.72452897",
"0.7238502",
"0.72355825",
"0.7229262",
"0.72253984",
"0.7222903",
"0.72214013",
"0.72197914",
"0.7218944",
"0.72157556",
"0.72108847",
"0.7208113",
"0.7208113"
] | 0.77110887 | 26 |
metodo para insertar usuarios | public function insertarUsuario(){
$sql = "INSERT INTO usuarios(Usuario, Clave, NombreCompleto, Correo, IdRol, Estado)
VALUES('{$this->usuario}','{$this->clave}','{$this->nombreCompleto}',
'{$this->correo}','{$this->idRol}', '{$this->estado}');";
$res = $this->conexion->setQuery($sql);
return $res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"function crearUsuario(){\n\t\t$params = array(\n\t\t\t':nombres' => $_POST['nombres'],\n\t\t\t':apellidos' => $_POST['apellidos'],\n\t\t\t':direccion' => $_POST['direccion'],\n\t\t\t':foto' => $_POST['foto'],\n\t\t\t':email' => $_POST['email'],\n\t\t\t':usuario' => $_POST['usuario'],\n\t\t\t':contrasena' => $_POST['contrasena'],\n\t\t\t\n\t\t);\n\t\n\t\t/* Preparamos el query apartir del array $params*/\n\t\t$query = 'INSERT INTO usuarios \n\t\t\t\t\t(nombres, apellidos, direccion, foto, email, usuario, contrasena, permisos) \n\t\t\t\tVALUES \n\t\t\t\t\t(:nombres,:apellidos,:direccion,:foto,:email,:usuario,:contrasena, 2)';\n\n\t\t/* Ejecutamos el query con los parametros */\n\t\t$result = excuteQuery(\"blogs\",\"\", $query, $params);\n\t\tif ($result > 0){\n\t\t\theader('Location: formlogin.php?result=true');\n\t\t}else{\n\t\t\theader('Location: addUser.php?result=false');\n\t\t}\n\t}",
"public function insert($usuario_has_hojaruta);",
"function registrarUsuario($nombre,$apellidos,$email,$edad,$puntos,$passW)\n {\n $consulta =\"INSERT INTO usuario (nombre,apellidos,email,edad,puntos,password) VALUES ('$nombre','$apellidos','$email',$edad,$puntos,'$passW')\";\n if($this->conexion->query($consulta))\n {\n \n }else{ \n echo \"Falló la creación de la tabla: (\" . $this->conexion->errno . \")// \" . $this->conexion->error.\"<br>\";\n }\n }",
"function agregar($nombre,$correo,$usuario,$rol,$zonah,$estado,$psw)\n {\n $Valores = \"'\".$usuario.\"','\".$psw.\"','\".$nombre.\"','\".$correo.\"',\".$estado.\",\".$zonah.\",\".$rol;\n $this->Insertar(\"usuarios\",\"usuario,password,nombre,correo,activo,zonashorarias_id,roles_id\",$Valores);\n }",
"function newUsuario($usuario)\n{\n\t$con = getDBConnection();\n\t$stmt = $con->prepare(\"INSERT INTO usuarios (nombre, apellidos, user_name, password, email) VALUES (:nombre, :apellidos, :user_name, :password, :email)\");\n\t$stmt->bindParam(':nombre', $usuario->nombre);\n\t$stmt->bindParam(':apellidos', $usuario->apellidos);\n\t$stmt->bindParam(':user_name', $usuario->user_name);\n\t$stmt->bindParam(':password', $usuario->password);\n\t$stmt->bindParam(':email', $usuario->email);\n\t$stmt->execute();\n}",
"function insertarUsuarios($usuario,$password,$refroles,$email,$nombrecompleto) {\r\n$sql = \"insert into dbusuarios(idusuario,usuario,password,refroles,email,nombrecompleto)\r\nvalues ('','\".($usuario).\"','\".($password).\"',\".$refroles.\",'\".($email).\"','\".($nombrecompleto).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}",
"function insertarUsuarios($usuario,$password,$refroles,$email,$nombrecompleto) {\r\n$sql = \"insert into dbusuarios(idusuario,usuario,password,refroles,email,nombrecompleto)\r\nvalues ('','\".($usuario).\"','\".($password).\"',\".$refroles.\",'\".($email).\"','\".($nombrecompleto).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}",
"public function insertUser($data) {\n\t\t\n\t\t\n\t}",
"public function registrar_usuario($nombre, $apellido, $cedula, $telefono, $email, $direccion, $cargo, $usuario, $password1, $password2, $estado, $permisos)\n {\n $conectar = parent::conexion();\n parent::set_names();\n $sql = \"insert into usuarios \n values(null,?,?,?,?,?,?,?,?,?,?,now(),?);\";\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"nombre\"]);\n $sql->bindValue(2, $_POST[\"apellido\"]);\n $sql->bindValue(3, $_POST[\"cedula\"]);\n $sql->bindValue(4, $_POST[\"telefono\"]);\n $sql->bindValue(5, $_POST[\"email\"]);\n $sql->bindValue(6, $_POST[\"direccion\"]);\n $sql->bindValue(7, $_POST[\"cargo\"]);\n $sql->bindValue(8, $_POST[\"usuario\"]);\n $sql->bindValue(9, $_POST[\"password1\"]);\n $sql->bindValue(10, $_POST[\"password2\"]);\n $sql->bindValue(11, $_POST[\"estado\"]);\n $sql->execute();\n //obtenemos el valor del id del usuario\n $id_usuario = $conectar->lastInsertId();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n $permisos = $_POST[\"permiso\"];\n // print_r($_POST);\n $num_elementos = 0;\n while ($num_elementos < count($permisos)) {\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $id_usuario);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n }\n }",
"public function RegistrarUsuarios()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"nombres\"]) or empty($_POST[\"usuario\"]) or empty($_POST[\"password\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select cedula from usuarios where cedula = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"cedula\"]) );\n\t$num = $stmt->rowCount();\n\tif($num > 0)\n\t{\n\n\t\techo \"2\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\t$sql = \" select email from usuarios where email = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"email\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 0)\n\t\t{\n\n\t\t\techo \"3\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql = \" select usuario from usuarios where usuario = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array($_POST[\"usuario\"]) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\t\t\t\t$query = \" insert into usuarios values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t$stmt->bindParam(1, $cedula);\n\t\t\t\t$stmt->bindParam(2, $nombres);\n\t\t\t\t$stmt->bindParam(3, $nrotelefono);\n\t\t\t\t$stmt->bindParam(4, $cargo);\n\t\t\t\t$stmt->bindParam(5, $email);\n\t\t\t\t$stmt->bindParam(6, $usuario);\n\t\t\t\t$stmt->bindParam(7, $password);\n\t\t\t\t$stmt->bindParam(8, $nivel);\n\t\t\t\t$stmt->bindParam(9, $status);\n\n\t\t\t\t$cedula = strip_tags($_POST[\"cedula\"]);\n\t\t\t\t$nombres = strip_tags($_POST[\"nombres\"]);\n\t\t\t\t$nrotelefono = strip_tags($_POST[\"nrotelefono\"]);\n\t\t\t\t$cargo = strip_tags($_POST[\"cargo\"]);\n\t\t\t\t$email = strip_tags($_POST[\"email\"]);\n\t\t\t\t$usuario = strip_tags($_POST[\"usuario\"]);\n\t\t\t\t$password = sha1(md5($_POST[\"password\"]));\n\t\t\t\t$nivel = strip_tags($_POST[\"nivel\"]);\n\t\t\t\t$status = strip_tags(strtoupper($_POST[\"status\"]));\n\t\t\t\t$stmt->execute();\n\n################## SUBIR FOTO DE USUARIOS ######################################\n//datos del arhivo \n\t\t\t\tif (isset($_FILES['imagen']['name'])) { $nombre_archivo = $_FILES['imagen']['name']; } else { $nombre_archivo =''; }\n\t\t\t\tif (isset($_FILES['imagen']['type'])) { $tipo_archivo = $_FILES['imagen']['type']; } else { $tipo_archivo =''; }\n\t\t\t\tif (isset($_FILES['imagen']['size'])) { $tamano_archivo = $_FILES['imagen']['size']; } else { $tamano_archivo =''; } \n//compruebo si las características del archivo son las que deseo \n\t\t\t\tif ((strpos($tipo_archivo,'image/jpeg')!==false)&&$tamano_archivo<50000) \n\t\t\t\t{ \n\t\t\t\t\tif (move_uploaded_file($_FILES['imagen']['tmp_name'], \"fotos/\".$nombre_archivo) && rename(\"fotos/\".$nombre_archivo,\"fotos/\".$_POST[\"cedula\"].\".jpg\"))\n\t\t\t\t\t{ \n## se puede dar un aviso\n\t\t\t\t\t} \n## se puede dar otro aviso \n\t\t\t\t}\n################## FINALIZA SUBIR FOTO DE USUARIOS ######################################\n\n\t\t\t\techo \"<div class='alert alert-success'>\";\n\t\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\t\t\techo \"<span class='fa fa-check-square-o'></span> EL USUARIO FUE REGISTRADO EXITOSAMENTE\";\n\t\t\t\techo \"</div>\";\t\t\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"4\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}\n}",
"public function creer(){ /*** Cree un utilisateur par insertion d'un tuple dans la table UserTab ***/\r\n \r\n \r\n // $this -> setInscrit(1);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n\t\t\t\r\n }",
"function insertar(Usuario $u) {\n $conn = $this->conn;\n \n $nombre = $u->getNombre();\n $email = $u->getEmail();\n $password = password_hash($u->getPassword(), PASSWORD_BCRYPT);\n $telefono = $u->getTelefono();\n $poblacion = $u->getPoblacion();\n $uid = $u->getUid();\n if (!$stmt = $conn->prepare(\"INSERT INTO usuarios (nombre, email, password, telefono, poblacion, uid) VALUES (?,?,?,?,?,?)\")) {\n die(\"Error al preparar la consulta: \" . $conn->error);\n }\n if (!$stmt->bind_param('ssssss', $nombre, $email, $password, $telefono, $poblacion, $uid)) {\n die(\"Error en el bind_param: \" . $stmt->error);\n }\n if (!$stmt->execute()) {\n die(\"Error en el execute: \" . $stmt->error);\n }\n return true;\n }",
"function insert($usuario) \n { \n $sql=\"INSERT INTO Usuarios values (\".$usuario->getId().\",\"\n .\"'\".$usuario->getNombre().\"',\" \n .\"'\".$usuario->getPaterno().\"',\" \n .\"'\".$usuario->getMaterno().\"',\" \n .\"'\".$usuario->getUsername().\"',\" \n .\"md5('\".$usuario->getPassword().\"'),\"\n .\"'\".$usuario->getFechaAlta().\"',\"\n .\"'\".$usuario->getEstatus().\"',\"\n .\"'\".$usuario->getTipoUsuario()->getId().\"')\"; \n \n $response = mysqli_query($this->_connDb, $sql); \n return $response; \n }",
"private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}",
"public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }",
"function addUser ($username, $prenom, $nom, $hashMdp, $role, $statut)\n{\n $db = connect();\n\n $query = $db->prepare('INSERT INTO users (username, prenom, nom, password, role, statut) VALUES (?, ?, ?, ?, ?, ?)');\n $query->execute(array($username, $prenom, $nom, $hashMdp, $role, $statut));\n $query->closeCursor();\n}",
"function ingresar_usuario($data){\n\t\t$this->db->insert('noticias_usuarios',$data);\n\t}",
"public function cadastrar()\n\t{\n\t\t//conexao com o banco\n\t\t$connect = new Connect('user_login');\n\n\t\t$this->id = $connect->insert([\n\t\t\t\t'login'=> $this->login,\n\t\t\t\t'password'=> $this->password\n\t\t]);\n\n\t}",
"function SQL_insert_usuario()\n {\n $query_insert = sprintf(\"INSERT INTO usuario (nombre, apellidos, direccion, telefono1, telefono2, email, cargo, comentario, username, password, activo, id_tipo_usuario)\n VALUES (%s, %s, %s %s, %s %s, %s %s, %s %s, %s, %s)\",\n $this->GetSQLValueString($this->nombre, \"text\"),\n $this->GetSQLValueString($this->apellidos, \"text\"),\n $this->GetSQLValueString($this->direccion, \"text\"),\n $this->GetSQLValueString($this->telefono1, \"text\"),\n $this->GetSQLValueString($this->telefono2, \"text\"),\n $this->GetSQLValueString($this->email, \"text\"),\n $this->GetSQLValueString($this->cargo, \"text\"),\n $this->GetSQLValueString($this->comentario, \"text\"),\n $this->GetSQLValueString($this->username, \"text\"),\n $this->GetSQLValueString($this->password, \"text\"),\n $this->GetSQLValueString($this->activo, \"int\"),\n $this->GetSQLValueString($this->tipo_usuario, \"int\"));\n return $query_insert;\n }",
"public function insertarUsuari($nombre, $apellidos,$usuario,$email,$password)\n {\n \n\t\t$user = Session::get('id_user');\t\n\t\t$this->_db->prepare(\"INSERT INTO usuarios VALUES\n\t\t\t\t\t\t\t(null,:Nombre, :Apellidos,:Email,:Usuario,:Password,'1','1')\")\n ->execute(\n array(\n ':Nombre' => $nombre,\n ':Apellidos' => $apellidos,\n\t\t\t\t\t\t ':Email'=>$email,\n\t\t\t\t\t\t ':Usuario'=>$usuario,\n\t\t\t\t\t\t ':Password'=>$password\n\t\t\t\t\t\t \n ));\n\t\t\t\t\t\t\t\t\t\n }",
"public function addNewUser($args=array()){\n \n //conferimos se o email informado não esta em uso\n $sql = new Sql();\n $res = $sql->select('SELECT * FROM usuarios WHERE email_usuario = :email_usuario',array(':email_usuario'=>$args['email_usuario']));\n if(count($res)==0){\n \n //geramos uma chave de validacao com base no email do usuario\n //esta chave será utilizada para a ativação do cadastro dele\n $userKEY= encode($args['email_usuario']);\n \n $query = 'INSERT INTO usuarios (\n id_empresa, nome_usuario, sobrenome_usuario, email_usuario, \n pwd_usuario, permissao_usuario, dt_usuario, cod_ativacao_usuario, status_usuario) \n VALUES (\n :id_empresa, :nome_usuario, :sobrenome_usuario, :email_usuario,\n :pwd_usuario, :permissao_usuario, :dt_usuario, :cod_ativacao_usuario, :status_usuario)'; \n \n $params = array(\n ':id_empresa'=>UIDEMPRESA,\n ':nome_usuario'=>$args['nome_usuario'],\n ':sobrenome_usuario'=>$args['sobrenome_usuario'],\n ':email_usuario'=>$args['email_usuario'],\n ':pwd_usuario'=>mkpwd($args['password']),\n ':permissao_usuario'=>'cliente',\n ':dt_usuario'=>time(),\n ':cod_ativacao_usuario'=>$args['cod_ativacao'],\n ':status_usuario'=>0);\n \n \n $res = $sql->query($query,$params); \n \n return $res; \n }else{//SE EMAIL JA CADASTRADO RETORNA FALSE\n return 'erro1001';\n }\n \n }",
"public function create(Users $usuario){\r\n\r\n // QUERY SQL PARA INSERIR REGISTRO NO BANCO\r\n\t\t$sql = 'INSERT INTO usuarios (nome,email,senha) VALUES (?,?,?)';\r\n\r\n\t\t// PREPARANDO CONEXÃO COM O BANCO\r\n\t\t$stmt = Conexao::getConn()->prepare($sql);\r\n\r\n\t\t// PEGANDO ATRIBUTOS DO USUARIO \r\n\t\t$stmt->bindValue(1, $usuario->getNome());\r\n\t\t$stmt->bindValue(2, $usuario->getEmail());\r\n $stmt->bindValue(3, $usuario->getSenha());\r\n\r\n\t\t// EXECUTANDO QUERY\r\n\t\t$stmt->execute();\r\n\r\n }",
"function newUser($data){\n\t\t$this->db->insert('usuarios', array(\n\t\t\t\t\t\t\t\t\t\t\t'rol' \t\t=> $data['rol'],\n\t\t\t\t\t\t\t\t\t\t\t'nombre' \t=> $data['nombre'],\n\t\t\t\t\t\t\t\t\t\t\t'empresa' \t=> $data['empresa'],\n\t\t\t\t\t\t\t\t\t\t\t'direccion' => $data['direccion'],\n\t\t\t\t\t\t\t\t\t\t\t'tel' \t\t=> $data['tel'],\n\t\t\t\t\t\t\t\t\t\t\t'cif' \t\t=> $data['cif'],\n\t\t\t\t\t\t\t\t\t\t\t'mail' \t\t=> $data['mail'],\n\t\t\t\t\t\t\t\t\t\t\t'password' \t=> $data['password']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t}",
"function insertAdminUser() {\n // Insert Admin info;\n $userController = new UserController;\n $this->db->exec(\n \"INSERT INTO users (username, password) VALUES (?, ?)\",\n [\n 1 => $this->formValues['adminUsername'],\n 2 => $userController->cryptPassword($this->formValues['adminPassword_1']),\n ]\n );\n }",
"public function registrar_usuario($nombre,$apellido,$genero,$fecha_nacimiento,$correo,$imagen,$contraseña, $type){\n \n \n $nodo_usuario = new Usuario();\n $mysql = new Conexion();\n\n $nodo_usuario->nombre = $nombre;\n $nodo_usuario->apellido = $apellido; \n $nodo_usuario->genero = $genero;\n $nodo_usuario->fecha_nacimiento = $fecha_nacimiento;\n $nodo_usuario->correo = $correo; \n $nodo_usuario->imagen = $imagen; \n $nodo_usuario->contraseña = $contraseña;\n $nodo_usuario->type = $type;\n \n /* aun no esta funcionando esto\n\t $nodo_usuario->nick = $nik;\n\t $nodo_usuario->ciudad_origen = $orig;\n\t $nodo_usuario->lugar_recidencia = $reci; \n\t $nodo_usuario->sitio_web = $web; \n\t $nodo_usuario->facebook = $face;\n\t $nodo_usuario->twitter = $twit;\n\t $nodo_usuario->youtube = $you;\n */ \n \n ModelUsuarios::crearNodoUsuario($nodo_usuario); //crea el nodo del Usuario \n\n $idneo4j = $nodo_usuario->id; //obtengo el id del nodo creado\n \n\n /*\n * Registro de usuario en Mysql\n * \"la url de facebook es importante y no se esta capturando\"\n */\n \n $sql = \"INSERT INTO usuario (\n email,\n idfacebook,\n idneo4j,\n password\n )VALUES(\n '\".$correo.\"',\n '12345678',\n '\".$idneo4j.\"',\n '\".$contraseña.\"'\n );\";\n \n return $mysql->ejecutar_query($sql); \n \n \n \n \n }",
"function addUsuarios($USUAID, $USUANOMB, $USUAAPEL, $USUATELE, $USUAIDENT, $USUADIRE, $USUAEMAI, $USUAPASS, $USUAESTA, $ROLID, $CIUDID, $TIPOSID,$FECHACREA,$FECHAACTUALIZA,$USUAEMPR)\n\t{\n\t\t$sql = \"INSERT INTO usuarios VALUES(0,'$USUANOMB','$USUAAPEL','$USUATELE','$USUAIDENT','$USUAEMPR','$USUADIRE','$USUAEMAI','$USUAPASS','$CIUDID',$USUAESTA,$ROLID,$TIPOSID,'$FECHACREA','$FECHAACTUALIZA')\";\n\t\t///print_r($sql);\n\t\t$this->consult = $this->connection->Execute($sql);\n\n\t\treturn $this->consult;\n\t}",
"public function insertarUser($email,$pass,$nombre,$apellidos){\n\n if ($this->hayError()==true){\n return null;\n\n }else{\n\n $sqlInserction=\"INSERT INTO usuarios(id,usuario,nombre,apellidos,email,rol,pass) VALUES (NULL,'\".$email.\"','\".$nombre.\"','\".$apellidos.\"','\".$email.\"',NULL,'\".sha1($pass).\"')\";\n\n $this->conexion()->query($sqlInserction);\n }\n\n }",
"private function _create() {\n\n $this->db->insert(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->set(\"id\", $this->db->insert_id());\n\n }",
"function ajouter_user($nom, $prenom, $email, $password, $cle_d_activation, $actif, $newsletter){\n\n\t\t$bdd=connexion_BD('projetLion');\n\n\t\t //Ajout de l'utilisateur dans la table login_users\n\t\t$req = $bdd->prepare('INSERT INTO login_users(nom, prenom, email, password, cle_d_activation, actif, newsletter) VALUES(:nom, :prenom, :email, :password, :cle_d_activation, :actif, :newsletter)');\n\t\t$req->execute(array(\n\t\t\t'nom' => $nom,\n\t\t\t'prenom' => $prenom,\n\t\t\t'email' => $email,\n\t\t\t'password' => $password,\n\t\t\t'cle_d_activation' => $cle_d_activation,\n\t\t\t'actif' => $actif,\n\t\t\t'newsletter' => $newsletter\n\t\t\t));\n\n\t\t\n\t}",
"public function m_insert_supervisor_user(){\n $this->FirstName = $_POST['FirstName'];\n $this->LastName = $_POST['LastName'];\n $this->EmailPN = $_POST['EmailPN'];\n $this->Password = password_hash($_POST['Password'], PASSWORD_DEFAULT);\n //insert value to users table\n $this->db->insert('users', $this);\n }",
"public function insertUser($params) {\n\n\t}",
"function registrarUsuario(){\n\n\t require(\"Conexion.php\");\t\n\t \n if(isset($_POST['insertar'])){\n\t\n\t $nombre=$_POST[\"nombre\"];\n $apellido=$_POST[\"apellido\"];\n\t $correo=$_POST[\"correo\"];\n\t $direccion=$_POST[\"direccion\"];\n\t $username=$_POST[\"nombre\"];\n\t $password=$_POST[\"password\"];\n\n\t $db=new Conexion();\n\t\n\t\t /* evitar duplicaciones*/\t\t\n $sql = \"select count(*) from datos_usuario where nombre ='$nombre'\";\n\t\t\n if ($resultado = $db->connect()-> query($sql)) {\n\n /* Comprobar el número de filas que coinciden con la sentencia SELECT */\n if ($resultado->fetchColumn() > 0) {\n\n /* Ejecutar la sentencia SELECT para mostrar el nombre duplicado*/\n $sql = \"select nombre from datos_usuario where nombre = '$nombre'\";\n foreach ($db->connect()->query($sql) as $fila) {\n \n\t\t $duplicado=$nombre;\n }\t\n\n\t echo '<script language=\"javascript\">alert(\"Usuario duplicado: '.$duplicado.' ya esta en uso.\");</script>';\n\n echo \"<script>\n setTimeout(function() {\n location.href = '../vista/registro_user.php';\n }, 0001);\n </script>\";\t\t\t \n }\n \n /* No coincide ningua fila inserta */\n else {\t\t\n\t\t\t/*no hay duplicaciones insertamos*/\n\t\n $query=$db->connect()->prepare(\"insert into datos_usuario (nombre, apellido, correo, direccion)\n\t values (:nombre, :apellido, :correo,:direccion)\");\t\t\t \n $query->execute(array(\":nombre\"=>$nombre, \":apellido\"=>$apellido,\":correo\"=>$correo,\"direccion\"=>$direccion));\n\t\n\t/*----------------segunda tabla-----------------------------*/\n\t $db=new Conexion();\n\t \n\t $sql2=\"insert into usuarios(username, password, rol_id) values (:username, :password, :rol_id)\";\n\t $query=$db->connect()->prepare($sql2);\n\t\t\t \n $query->execute(array(\":username\"=>$nombre, \":password\"=>$password, \":rol_id\"=>2));\n\t\n\t\t echo'<script type=\"text/javascript\">\n alert(\"Usuario registrado\");\n </script>';\n\t\n\t \n\t echo \"<script>\n setTimeout(function() {\n location.href = '../vista/login.php';\n }, 0001);\n </script>\";\t\n\t\t } \t\n }\n }\n }",
"function insertarUsuario($conexion,$usuario, $password, $nombre, $apellido1, $apellido2, $email,$rol){\n $resultado=$conexion->query(\"INSERT INTO usuario (usuario, password,nombre,apellido1,apellido2,email,rol)\n values ('$usuario', '$password','$nombre',' $apellido1','$apellido2',' $email','$rol')\");\n return $resultado;\n}",
"function registrar(){\n\n\t\t\t\n\t\t$sql = \"INSERT INTO USUARIOS (\n\t\t\tlogin,\n\t\t\tpassword,\n\t\t\tnombre,\n\t\t\tapellidos,\n\t\t\temail,\n\t\t\tDNI,\n\t\t\ttelefono,\n\t\t\tFechaNacimiento,\n\t\t\tfotopersonal,\n\t\t\tsexo\n\t\t\t) \n\t\t\t\tVALUES (\n\t\t\t\t\t'\".$this->login.\"',\n\t\t\t\t\t'\".$this->password.\"',\n\t\t\t\t\t'\".$this->nombre.\"',\n\t\t\t\t\t'\".$this->apellidos.\"',\n\t\t\t\t\t'\".$this->email.\"',\n\t\t\t\t\t'\".$this->DNI.\"',\n\t\t\t\t\t'\".$this->telefono.\"',\n\t\t\t\t\t'\".$this->FechaNacimiento.\"',\n\t\t\t\t\t'\".$this->fotopersonal.\"',\n\t\t\t\t\t'\".$this->sexo.\"'\n\n\t\t\t\t\t)\";\n\t\t\t\t\t\t\t\t\n\t\tif (!$this->mysqli->query($sql)) { //Si la sentencia sql no devuelve información\n\t\t\treturn 'Error de gestor de base de datos';\n\t\t}\n\t\telse{\n\t\t\treturn 'Inserción realizada con éxito'; //si es correcta\n\t\t}\t\t\n\t}",
"public function addUtilisateur()\n\t{\n\t\t\t$sql = \"INSERT INTO utilisateur SET\n\t\t\tut_nom=?,\n\t\t\tut_prenom=?,\n\t\t\tut_pseudo=?,\n\t\t\tut_mail=?,\n\t\t\tut_mdp=?,\n\t\t\tut_date_inscription=NOW(),\n\t\t\tut_hash_validation =?\";\n\n\t\t\t$res = $this->addTuple($sql,array($this->nom,\n\t\t\t\t$this->prenom,\n\t\t\t\t$this->pseudo,\n\t\t\t\t$this->email,\n\t\t\t\t$this->pass,\n\t\t\t\t$this->hashValidation()\n\t\t\t\t));\n\t\t\treturn $res;\n\t}",
"function insertar(){\n global $conexion, $data;\n $usuario = $data[\"usuario\"];\n $email = $data[\"email\"];\n $clave = $data[\"clave\"];\n $tipo = $data[\"tipo\"];\n $eliminado = $data[\"eliminado\"];\n $estado = $data[\"estado\"];\n $resultado = mysqli_query($conexion,\"INSERT INTO usuario(usu_usuario, usu_email, usu_clave, usu_estado, usu_eliminado, usu_id_tipo_usuario)VALUES ('$usuario', '$email', '$clave', '$estado', '$eliminado', '$tipo' ) \");\n echo validarError($conexion, true, $resultado);\n }",
"public function insertUsers($data)\n {\n $sql = \"INSERT INTO `users` (user_username, user_password, user_email, user_role)\n VALUES (:username, :password, :email, :role)\";\n $this->set($sql, [\n \":username\" => $data[\"Username\"],\n \":password\" => md5($data[\"Password\"]),\n \":email\" => $data[\"Email\"],\n \":role\" => $data[\"Role\"],\n ]);\n }",
"public function registerUser()\n {\n $sql = \"INSERT INTO user (username, password, email, firstname, lastname, address, date_of_birth, id_role)\n VALUES (\\\"\" . $this->getUsername().\"\\\", \\\"\" . $this->getPassword().\"\\\", \\\"\" . $this->getEmail().\"\\\",\\\"\" . $this->getFirstname().\"\\\", \\\"\" . $this->getLastname().\"\\\", \\\"\" . $this->getAddress().\"\\\", \\\"\" . $this->getDateOfBirth().\"\\\", \\\"\" . $this->getIdRole().\"\\\")\";\n $result = mysqli_query($this->_connection, $sql);\n if (!$result) {\n print \"Error: \" . $result . \"<br>\" . mysqli_error($this->_connection);\n } else {\n print \"erfolg\";\n\n }\n }",
"public function agregarUsuario(){\n \n }",
"public function insertUser($data){\t\t\n\t\t$query = \"INSERT INTO final_usuario VALUES ('','\".$data[\"user\"].\"'\n\t\t\t,'\".$data[\"name\"].\"','\".$data[\"pwd\"].\"','\".$data[\"email\"].\"')\";\n\t\treturn $this->con->action($query);\n\t}",
"function agregarUsuarioBD($objeto) {\n\n $user = strtoupper(htmlentities($objeto->getUsuario(), ENT_QUOTES));\n \n $pass = $objeto->getContrasena();\n\n $conexion = $this->conectar(\"ADMIN\",\"1234\");\n\n $agrego = oci_parse($conexion,'CREATE USER '.$user.' IDENTIFIED BY '.$pass);\n oci_execute($agrego);\n\n $agrego = oci_parse($conexion,'GRANT ALL PRIVILEGES TO '.$user);\n oci_execute($agrego);\n\n $string = \"INSERT INTO UsuarioCtx_TAB VALUES ('\".$user.\"')\";\n $result = oci_parse($conexion, $string);\n oci_execute($result);\n\n $result = oci_parse($conexion, \"INSERT INTO MEDICO VALUES (\".$objeto->getCI().\", '\".$objeto->getNombres().\"', '\".$objeto->getApellidos().\"', '\".$user.\"', '\".$pass.\"', \".$objeto->isFisio().\")\");\n oci_execute($result);\n\n $this->desconectar($conexion);\n return $result;\n }",
"function add_user($ci, $grado, $espe, $nombres, $paterno, $materno, $fec_nac, $lugar, $direccion, $fono, $celular, $gsanguineo, $gestion, $curso) {\n // \t\t$qUserExists = \"SELECT * FROM docente WHERE id_docente='$id_docente'\";\n\t\t$qInsertUser = \"INSERT INTO alumno (ci, grado, espe, nombres, paterno, materno, fec_nac, lugar, direccion, fono, celular, gsanguineo, gestion, curso)\n\t\t\t\t \t\t\t VALUES ('$ci', '$grado', '$espe', '$nombres', '$paterno', '$materno', '$fec_nac', '$lugar', '$direccion', '$fono', '$celular', '$gsanguineo', '$gestion', '$curso')\";\n\t\t\n\t\tif ($espe == \"1ER. A.M.\")\n\t\t{\n\t\t\t\t$qInsertUser1 = \"INSERT INTO primero (ci, gestion)\n\t\t\t\t \t\t\t VALUES ('$ci', '$gestion')\";\n\t\t}\n\t\telseif ($espe == \"2DO. A.M.\")\n\t\t{\n\t\t\t\t$qInsertUser2 = \"INSERT INTO segundo (ci, gestion)\n\t\t\t\t \t\t\t VALUES ('$ci', '$gestion')\";\n\t\t}\n\t\telseif ($espe == \"3ER. A.M.\")\n\t\t{\n\t\t\t\t$qInsertUser3 = \"INSERT INTO tercero (ci, gestion)\n\t\t\t\t \t\t\t VALUES ('$ci', '$gestion')\";\n\t\t}\n\t\telseif ($curso == \"basico\")\n\t\t{\n\t\t\t\t$qInsertUser3 = \"INSERT INTO basico (ci, gestion)\n\t\t\t\t \t\t\t VALUES ('$ci', '$gestion')\";\n\t\t}\n\t\telseif ($corso == \"avanzado\")\n\t\t{\n\t\t\t\t$qInsertUser3 = \"INSERT INTO avanzado (ci, gestion)\n\t\t\t\t \t\t\t VALUES ('$ci', '$gestion')\";\n\t\t}\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($qInsertUser); \n\t\t$result = mysql_query($qInsertUser1);\n\t\t$result = mysql_query($qInsertUser2);\n\t\t$result = mysql_query($qInsertUser3);\n\t}",
"function insUser($username,$password,$perfil,$activo){\n\t\t\t\n\t\t\t$conn = conectar(); //funcion que conecta con bd\n\t\t\ttry{\t\t\n\t\t\t\t\t$stmt = $conn->prepare(\"INSERT INTO usuario (id, username,password, id_perfil, activo ) VALUES ('',?,?,?,?)\");\n\t\t\t\t\t$stmt->bindParam(1,$username);\n\t\t\t\t\t$stmt->bindParam(2,$password);\n\t\t\t\t\t$stmt->bindParam(3,$perfil);\n\t\t\t\t\t$stmt->bindParam(4,$activo);\n\t\t\t}\n\t\t\tcatch(PDOException $e){\n\t\t\t\techo \"ERROR: \" . $e->getMessage();\n\t\t\t}\t\t\n\t\t\t$stmt->execute();\n\t\t\t$result = true;\n\t\t\tdesconectar($conn);\n\t\t\treturn $result; \n\t\t}",
"function addUser($nome, $morada, $email, $telefone, $username, $password){\n\t\t$result = checkUsername($username); \n\t\t\n\t\tif(count($result) < 2){ //Não existe ninguém com este username\n\t\t\tglobal $conn;\n\t\t\t$stmt = $conn->prepare(\"INSERT INTO utilizador \n\t\t\t\t\t\t\t\t\tVALUES (DEFAULT, ? , ? , ? , ? , ? , ? ,false);\");\n\t\t\tif (!$stmt->execute(array($nome, $morada, $telefone, $username, $password, $email))) {\n\t\t\t return 1; // Erro a executar a query\n\t\t\t exit;\n\t\t\t}\n\t\t\treturn 0; //Correu tudo bem\t\n\t\t\treturn $query;\n\t\t}\n\t\telse\n\t\t\treturn 2; //Username já utilizado*/\n\t}",
"public function insertarUsuario($correo, $contrasena)\n {\n /*$contrasena = sha1($contrasena);\n $modelo = new Conexion();\n $conexion = $modelo->get_conexion();\n $verifcarcorreo = $modelo->get_campo(\"login\", \"correo\", \"correo\", $correo);\n if (strtolower($verifcarcorreo) == null) {\n //echo \"puede registrar\";\n $maxid = $modelo->get_ultimovalor(\"login\", \"idlogin\");\n $sql = \"INSERT INTO login(idlogin,correo,contrasena) VALUES(:idlogin,:correo,:contrasena)\";\n $statement = $conexion->prepare($sql);\n $statement->bindParam(':idlogin', $maxid);\n $statement->bindParam(':correo', $correo);\n $statement->bindParam(':contrasena', $contrasena);\n if (!$statement) {\n return \"6\";\n } else {\n $statement->execute();\n return \"3\";\n }\n } else {\n return \"5\";\n }*/\n }",
"function insertar(){\n $nombre=$_POST[\"nombre\"];\n $apellido=$_POST[\"apellido\"];\n $edad=$_POST[\"edad\"];\n $curso=$_POST[\"curso\"];\n $correo=$_POST[\"correo\"];\n $consulta=\"INSERT INTO usuarios (Nombre, Apellido, Edad, Curso, Correo) VALUES('\".$nombre.\"', '\".$apellido.\"', '\".$edad.\"', '\".$curso.\"', '\".$correo.\"')\";\n echo $consulta. \"<br>\";\n \n $conexion->consulta($consulta);\n //$resultado = $conector->query($consulta);\n mostrarListado();\n\n }",
"static function addUser(){\n\n $controller = new UserController();\n $validation = $controller->signupValid();\n\n if($validation === \"OK\"){\n $base = new ConnexionDb;\n\n $base->query(\"INSERT INTO user(username, firstname, email, pass, valid)\n VALUES (:username, :firstname, :email, :pass, 1)\",\n array(\n array('username',$_POST['username'],\\PDO::PARAM_STR),\n array('firstname',$_POST['firstname'],\\PDO::PARAM_STR),\n array('email',$_POST['email'],\\PDO::PARAM_STR),\n array('pass',$_POST['pass'],\\PDO::PARAM_STR)\n )\n );\n // $userM = new User($_POST);\n\n }else{\n echo 'erreur d\\'inscription';\n }\n }",
"public function inserir() {\n $this->load->model('Usuario_model', 'usuario');\n\n //Recebe os dados da view de usuario\n $data['login'] = $this->input->post('login');\n $data['senha'] = md5($this->input->post('senha'));\n $data['codAluno'] = $this->input->post('codAluno');\n $data['nivel'] = 1;\n\n if ($this->usuario->inserirUsuario($data)) {\n redirect('Painel_controller/login');\n }\n }",
"function add_user($sexe, $nom, $prenom, $pseudo, $mail, $mdp, $date_naissance) {\n\t$db = coBDD();\n\t$query = $db->prepare('INSERT INTO utilisateurs VALUES (NULL, :nom, :prenom, :sexe, :pseudo, :mail, :mdp, :date_naissance, 3)');\n\t$query->bindValue(':sexe', $sexe);\n\t$query->bindValue(':nom', $nom);\n\t$query->bindValue(':prenom', $prenom);\n\t$query->bindValue(':pseudo', $pseudo);\n\t$query->bindValue(':mdp', $mdp);\n\t$query->bindValue(':mail', $mail);\n\t$query->bindValue(':date_naissance', $date_naissance);\n\n\tif ($query->execute())\n\t\treturn (1);\n\treturn (0);\n}",
"public function insertuser($username, $idprojeto) {\n $idcargo = 2;\n if ($username == \"\") {\n return \"digite o nome do usuario a ser inserido.\";\n }\n $dbTableUse = new Application_Model_DbTable_Usuario();\n $query = $dbTableUse->select()->from($dbTableUse)->where('login = ?', $username);\n $array = $dbTableUse->fetchAll($query)->toArray();\n if ($array == null) {\n return \"usuario \" . $username . \" ainda nao foi cadastrado em ALVO.\";\n }\n $dbprojus = new Application_Model_DbTable_ProjetoUsuario();\n $query2 = $dbprojus->select()->from($dbprojus)->where('fk_id_projeto = ?', $idprojeto)->where('fk_id_usuario = ?', $array[0]['id_usuario']);\n\n $array2 = $dbprojus->fetchAll($query2)->toArray();\n\n if ($array2 != null) {\n return $username . \" ja foi cadastrado no projeto.\";\n }\n\n //seleciona todos os participantes do projeto\n $dbtableUP = new Application_Model_DbTable_ProjetoUsuario();\n $dbtableUP->insert(array('fk_id_usuario' => $array[0]['id_usuario'],\n 'fk_id_projeto' => $idprojeto,\n 'fk_id_cargo' => $idcargo));\n return $username . \" foi adicionado ao projeto.\";\n }",
"function add($nombre,$correo){\n\t\tglobal $conn;\n\t\t//$sql = \"INSERT INTO usuario (nombre,correo) VALUES ('$nombre','$correo')\";\n\t\t$stmt = $conn->prepare('INSERT INTO user (email,nombre) VALUES ( :email,:password)');\n\t\t//$stmt->bindParam(':nombre', $nombre);\n\t\t$stmt->bindParam(':email', $nombre);\n\t\t$stmt->bindParam(':password', $correo);\n\t\t$stmt->execute();\n\t\t//$conn->query($sql);\n\t}",
"function insertUser($nom, $prenom, $villeId) {\n $bdd = coBdd();\n $req = $bdd->prepare('INSERT INTO utilisateur (nom, prenom, villeId) VALUES (:nom, :prenom, :ville)');\n $req->bindParam(\":nom\", $nom);\n $req->bindParam(\":prenom\", $prenom);\n $req->bindParam(\":ville\", $villeId);\n $req->execute();\n}",
"public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }",
"public function insertarUsuario($usuario, $contrasenia, $nombre, $apellido, \n $correo, $imagen, $rol){\n if(empty($usuario) or \n empty($contrasenia) or \n empty($nombre) or \n empty($apellido) or \n empty($correo) or\n empty($imagen) or \n empty($rol)){\n header(\"Location:usuarios.php?accion=add_usuario&i=1\");\n exit();\n }\n \n $sql = \"INSERT INTO usuarios VALUES(null, ?, ?, ?, ?, ?, ?, ?)\";\n\n $resultado = $this->db->prepare($sql);\n\n $resultado->bindValue(1, $usuario);\n $resultado->bindValue(2, $contrasenia);\n $resultado->bindValue(3, $nombre);\n $resultado->bindValue(4, $apellido);\n $resultado->bindValue(5, $correo);\n $resultado->bindValue(6, $imagen);\n $resultado->bindValue(7, $rol);\n \n\n if(!$resultado->execute()){\n header(\"Location:usuarios.php?accion=add_usuario&i=2\");\n }else{\n //Insertamos el registro\n if($resultado->rowCount()>0){\n header(\"Location:usuarios.php?accion=add_usuario&i=3\");\n }else{\n header(\"Location:usuarios.php?accion=add_usuario&i=4\");\n }\n }\n }",
"function insert(UserFB $usuario){\r\n $parametrosSet=array();\r\n $parametrosSet['UID']=$usuario->getUID();\r\n $parametrosSet['Fuid']=$usuario->getFuid();\r\n $parametrosSet['Ffname']=$usuario->getFfname();\r\n $parametrosSet['Femail']=$usuario->getFemai();\r\n return $this->bd->insert($this->tabla, $parametrosSet);\r\n }",
"function setProduto(){\n $insertProdutos = mysql_query(\"INSERT INTO User (Nickname, UserKey)\n VALUES ('$this->$Nickname','this->$UserKey)'\");\n\n if($insertProdutos){\n $resposta=\"Inserido com sucesso\";\n echo \"<script>alert('Usuário cadastrado!')</script>\";\n }else{\n $resposta =\"Erro ao inserir\";\n echo \"<script>alert('Erro ao cadastrar usuario')</script>\";\n }\n \n return $resposta;\n }",
"function registrar_usuario($datos = array()){\n if(empty($datos)||!($datos['perfil']!=''&&$datos['email']!=''&&$datos['contrasena']!='')){return false;}\n $sql = sprintf(\"INSERT INTO `login` (`cloud`,`perfil`,`nombres`,`apellidos`,`email`,`telefono`,`contrasena`) SELECT * FROM (SELECT %s,%s,%s,%s,%s,%s,%s) AS `tmp` WHERE NOT EXISTS (SELECT `email` FROM `login` WHERE `email` = %s AND `cloud` = %s)\",varSQL(__sistema),varSQL($datos['perfil']),varSQL((!isset($datos['nombres']))?'':$datos['nombres']),varSQL((!isset($datos['apellidos']))?'':$datos['apellidos']),varSQL($datos['email']),varSQL((!array_key_exists('telefono',$datos))?'':$datos['telefono']),varSQL(md5($datos['contrasena'])),varSQL($datos['email']),varSQL(__sistema));\n return consulta($sql);\n}",
"public function salvar(){\n \n\t\t/*\n\t\t\tReceber dados vindos do formulario.\n\t\t*/\n\n\t\t$login = $this->post(\"login\");\n\t\t$senha = $this->post(\"senha\");\n\t\t$senha = md5($senha);\n\t\t$tipo = 2;\n\n\t\t/*\n\t\t\tInserindo dados na tabela usuário.\n\t\t*/\n\t\t$campos = \"(login,senha,tipo)\";\t\t\n\t\t$valores = \"('\".$login.\"','\".$senha.\"','\".$tipo.\"')\";\t\t\n\t\t$tabela = \"usuarios\";\n\t\t\n\t\t$this->insert( $tabela, $campos, $valores );\t\n\t\t\n\t}",
"function register_user($new) {\n \n $this->db->insert('users', $new);\n }",
"function agregar($nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"INSERT INTO\n\t\t\t\t\t\t\t\tusuario(nombre_usuario, nick_usuario, clave, apellido_usuario, direccion_usuario, telefono_usuario, email_usuario, genero_usuario, id_rol)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$nombre_usuario',\n\t\t\t\t\t\t\t\t'$nick_usuario',\n\t\t\t\t\t\t\t\t'$clave',\n\t\t\t\t\t\t\t\t'$apellido_usuario',\n\t\t\t\t\t\t\t\t'$direccion_usuario',\n\t\t\t\t\t\t\t\t'$telefono_usuario',\n\t\t\t\t\t\t\t\t'$email_usuario',\n\t\t\t\t\t\t\t\t'$genero_usuario',\n\t\t\t\t\t\t\t\t$id_rol\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$id = $resultado;\n\t\t$conexion -> cerrar();\n\t\trequire('usuarioClass.php');\n\t\t$usuario = new Usuario($id, $nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol);\n\t\t//Regreso los productos\n\t\treturn $usuario;\n\t}",
"public function add($cadastro){\n if($cadastro[\"senha\"] != $cadastro[\"conf_senha\"]){\n return [\"error\" => TRUE, \"msg\" => \"senhas_nao_conferem\"];\n }\n unset($cadastro[\"conf_senha\"]);\n // --- checa se o nome do usuario ja esta cadastrado !!!! mudar essa parte para checar contra o skambitdb!!!\n $user_list = $this->getLogins();\n foreach($user_list as $id => $item) {\n if($item == $cadastro[\"login\"]){\n return [\"error\" => TRUE, \"msg\" => \"usuario_ja_cadastrado\"];\n }\n }\n // --- essa parte da funcao cuida do upload e manuseio das imagens de avatar\n $cadastro[\"avatar\"] = $this->setAvatar();\n // --- criptografa a senha\n $cadastro[\"senha\"] = password_hash($cadastro[\"senha\"], PASSWORD_DEFAULT);\n $cadastro[\"status_id\"] = 1;\n $cadastro[\"rating\"] = 5;\n $query = $this->pdo->prepare('INSERT INTO usuarios( `primeiro_nome`, `ultimo_nome`, `cep`, `login`, `senha`, `avatar`, `email`, `status_id`, `rating`)\n VALUES( :primeiro_nome, :ultimo_nome, :cep, :login, :senha, :avatar, :email, :status_id, :rating)');\n var_dump($cadastro);\n $query->execute($cadastro);\n return [\"error\" => FALSE, \"msg\" => \"cadastro_ok\"];\n }",
"public function registrar_usuario($usuario, $clave, $email, $pintor) {\n /*Creamos la instancia del objeto. ya estamos conectados*/\n $bd = Db::getInstance();\n $sql = \"INSERT INTO login (usuario, clave, email, pintor) VALUES (:usuario, :clave, :email, :pintor)\";\n $stmt = $bd->prepare($sql);\n $stmt->execute([\":usuario\" => $usuario, \":clave\" => $clave, \":email\" => $email, \":pintor\" => $pintor]);\n }",
"function addUser($data)\n { \n $this->query(\"INSERT INTO `{$this->userTable}` (`{$this->tbFields1['first_name']}`, `{$this->tbFields1['last_name']}`, `{$this->tbFields1['gender']}`, `{$this->tbFields1['dob']}`, `{$this->tbFields1['telephone']}`, `{$this->tbFields1['fax']}`, `{$this->tbFields1['email']}`, `{$this->tbFields1['newsletter_flag']}`, `{$this->tbFields1['password']}`, `{$this->tbFields1['date_created']}`) VALUES ('\".$data[$this->dataFields['first_name']].\"', '\".$data[$this->dataFields['last_name']].\"', '\".$data[$this->dataFields['gender']].\"', '\".$data[$this->dataFields['dob']].\"', '\".$data[$this->dataFields['telephone']].\"', '\".$data[$this->dataFields['fax']].\"', '\".$data[$this->dataFields['email']].\"', '\".$data[$this->dataFields['newsletter_flag']].\"', '\".$data[$this->dataFields['password']].\"', CURRENT_TIMESTAMP)\"); \n \n $data[$this->dataFields['customer_id']] = mysql_insert_id($this->dbConn);\n \n if($data[$this->dataFields['address']] != \"\"){\n $this->addAddress($data);\n }\n \n }",
"public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}",
"function registerUser($data){\n\t\t\tprint($this->db->insert('users', $data));\n\t\t}",
"public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }",
"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 add(Usuarios $usuarios) {\n\n \n try {\n $sql = sprintf(\"insert into mydb.usuarios (idusuarios, contraseña, fecha_registro, fecha_actualizacion, personas_idpersonas) \n values (%s,%s,%s,%s,%s)\",\n $this->labAdodb->Param(\"idusuarios\"),\n $this->labAdodb->Param(\"contraseña\"),\n $this->labAdodb->Param(\"fecha_registro\"),\n $this->labAdodb->Param(\"fecha_actualizacion\"),\n $this->labAdodb->Param(\"personas_idpersonas\")); \n \n $sqlParam = $this->labAdodb->Prepare($sql);\n\n $valores = array();\n\n $valores[\"idusuarios\"] = $usuarios->getidusuarios();\n $valores[\"contraseña\"] = $usuarios->getcontraseña();\n $valores[\"fecha_registro\"] = $usuarios->getfecha_registro();\n $valores[\"fecha_actualizacion\"] = $usuarios->getfecha_actualizacion();\n $valores[\"personas_idpersonas\"] = $usuarios->getpersonas_idpersonas();\n \n\n $this->labAdodb->Execute($sqlParam, $valores) or die($this->labAdodb->ErrorMsg());\n } catch (Exception $e) {\n throw new Exception('No se pudo insertar el registro (Error generado en el metodo add de la clase usuariosDao), error:'.$e->getMessage());\n }\n }",
"function AjouterUtilisateur($login, $password, $prof)\n{\n\tglobal $bdd;\n\t$req = $bdd->prepare('INSERT INTO UTILISATEUR(login, password, prof,) \n\t\tVALUES(:login, :password, :prof)');\n\t$req->execute(array(\n\t\t'login' => $login,\n\t\t'password' => $password,\n\t\t'prof' => $prof,\n\t));\n\t$req->closeCursor();\n}",
"function insertUser($data){\n if (!is_array($data)) $this->error('Data is not an array', __LINE__);\n switch(strtolower($this->passMethod)){\n\t case 'sha1':\n\t \t$password = \"SHA1('\".$data[$this->user_pass].\"')\"; break;\n\t case 'md5' :\n\t \t$password = \"MD5('\".$data[$this->user_pass].\"')\";break;\n\t case 'nothing':\n\t \t$password = $data[$this->user_pass];\n\t}\n foreach ($data as $k => $v ) $data[$k] = \"'\".$this->escape($v).\"'\";\n $data[$this->user_pass] = $password;\n $this->db->query(\"INSERT INTO \".$this->usertable.\" (`\".implode('`, `', array_keys($data)).\"`) VALUES (\".implode(\", \", $data).\")\");\n return (int)mysql_insert_id($this->dbConn);\n }",
"public static function agregarUsuarios($vmySql,$vflturistas) {\r\n// $vmySql->AbrirConexion();\r\n// $vmySql->start_transaction();\r\n try {\r\n//It sets sql statement in order to add new user\r\n $vsql = \"INSERT INTO c_usuario(cmpcorreo,cmpcontrasena, cmpnombre,cmpapellidoPaterno,cmpapellidoMaterno,id_tipoUsuario) \";\r\n $vsql.=\"VALUES('\" . $vflturistas->correo . \"'\";\r\n $vsql.=\", '\" . $vflturistas->contrasena . \"'\";\r\n $vsql.=\", '\" . $vflturistas->nombre . \"'\";\r\n $vsql.=\", '\" . $vflturistas->apellidoPaterno . \"'\";\r\n $vsql.=\", '\" . $vflturistas->apellidoMaterno . \"'\";\r\n $vsql.=\", '\" . $vflturistas->tipoUsuario . \"')\";\r\n\r\n\r\n\r\n\r\n\r\n if ($vmySql->consulta($vsql)) {\r\n\r\n $id_ultimo_insert = mysql_insert_id();\r\n $vflturistas->idusuario = $id_ultimo_insert;\r\n\r\n if ($vmySql->ObtenerNumeroFilasAfectadas() != 1) {\r\n // throw new Exception(\"Ocurrió un error al registrar los datos del usuario, intente de nuevo\", 0);\r\n return 0;\r\n }\r\n } \r\n\r\n \r\n unset($vsql, $vmySql);\r\n\r\n return 1;\r\n } catch (Exception $vexcepcion) { //It catches exception /It returns exception code catched\r\n throw new Exception($vexcepcion->getMessage(),$vexcepcion->getCode());\r\n }\r\n }",
"function crearEntrenador(){\n\t\tglobal $con;\n\t\t$Nombre = $_POST['Nombre'];\n\t\t$Apellido = $_POST['Apellido'];\n\t\t$Telefono = $_POST['Telefono'];\n\t\t$Club = $_POST['Club'];\n\t\t$Email = $_POST['Email'];\n\t\t$Password = $_POST['Password'];\n\t\t$user = strstr($Email, '@', true);\n\n\t\t$crear_entrenador = \"INSERT INTO User(Name, LastName, UserName, Password, Phone, Email, Role)\n\t\t\t\t\t\t\tVALUES('$Nombre', '$Apellido', '$user', '$Password', '$Telefono','$Email', 'Entrenador')\";\n\t\t$send_query = mysqli_query($con, $crear_entrenador);\n\n\t\t$login = \"INSERT INTO Coachs(UserID, Role, Asociacion)\n\t\t\t\t\tVALUES( LAST_INSERT_ID(),'Entrenador','$Club')\";\n\t\t$send_query2 = mysqli_query($con, $login);\n\n\t\tif(!$send_query or !$send_query2){\n\t\t\t\tdie('Could not update data: ');\n\t\t}\n\t\telse{\n\t\t\t\techo \"Updated data successfully\\n\";\n\t\t\t\tunset($_POST);\n\t\t\t\tunset($_REQUEST);\n\t\t\t\techo \"<script>location.href='tablaEntrenadoresAdmin.php';</script>\";\n\t\t}\n}",
"public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }",
"function aggiungiCliente($username, $password, $nome){\n$query = mysql_query(\"SELECT * FROM utente WHERE username = '\".$username.\"' \");\n\n\n//se non esiste lo aggiungo\nif(mysql_num_rows($query)==0){\n$ins = mysql_query(\"INSERT INTO utente (username,password,nome) values('\".$username.\"', '\".$password.\"', '\".$nome.\"' )\") ;\n\nif($ins){\nreturn true;\n}\n\nelse {\nreturn false;//username non esiste ma l'inserimento non è andato a buon fine\n}\n}\nelse{\nreturn false; //username esiste\n}\n\n\n}",
"static function mdlAddUser($table, $data) {\r\n\r\n\t\t$stmt = Conection::conect()->prepare(\"INSERT INTO $table(nombre, usuario, password, perfil, foto) VALUES (:nombre, :usuario, :password, :perfil, :foto)\");\r\n\t\t\r\n\t\t$stmt->bindParam(\":nombre\", $data[\"nombre\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":usuario\", $data[\"usuario\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":password\", $data[\"password\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":perfil\", $data[\"perfil\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":foto\", $data[\"foto\"], PDO::PARAM_STR); \r\n\r\n\r\n\t\tif ($stmt->execute()) {\r\n\t\t\t\r\n\t\t\treturn \"ok\";\r\n\r\n\t\t}else {\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\t\t\r\n\r\n\t\t$stmt = null; \r\n\r\n\t}",
"public function insert()\n {\n $db = Base::getConnection();\n\n if (self::isAValidUser() || self::isVisitor()) {\n throw new \\InvalidArgumentException();\n }\n\n $stmt = $db->prepare(\"INSERT INTO users(username, password, email) VALUES(:name, :pass, :email);\");\n $stmt->bindParam(\":name\", $this->username, PDO::PARAM_STR);\n $stmt->bindParam(\":pass\", $this->password, PDO::PARAM_STR);\n $stmt->bindParam(\":email\", $this->email, PDO::PARAM_STR);\n\n $stmt->execute();\n\n $this->id = $db->LastInsertID('users');\n $stmt->closeCursor();\n }",
"function createUsers(){\n\n\t\t\n\t\t\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute\n\t}",
"public function addNewUser(string $login, string $heslo, string $jmeno, string $email, int $idPravo = 4){\r\n // hlavicka pro vlozeni do tabulky uzivatelu\r\n //$insertStatement = \"login, heslo, jmeno, email, id_pravo\";\r\n // hodnoty pro vlozeni do tabulky uzivatelu\r\n\r\n $login = htmlspecialchars($login);\r\n $heslo = htmlspecialchars($heslo);\r\n $jmeno = htmlspecialchars($jmeno);\r\n $email = htmlspecialchars($email);\r\n\r\n //$insertValues = \"'$login', '$heslo', '$jmeno', '$email', $idPravo\";\r\n // provedu dotaz a vratim jeho vysledek\r\n //return $this->insertIntoTable(TABLE_USER, $insertStatement, $insertValues);\r\n\r\n $q = \"INSERT INTO \".TABLE_USER.\"(login, heslo, jmeno, email, id_pravo) \r\n VALUES (:login, :heslo, :jmeno, :email, :id_pravo)\";\r\n $vystup = $this->pdo->prepare($q);\r\n $vystup->bindValue(\":login\", $login);\r\n $vystup->bindValue(\":heslo\", $heslo);\r\n $vystup->bindValue(\":jmeno\", $jmeno);\r\n $vystup->bindValue(\":email\", $email);\r\n $vystup->bindValue(\":id_pravo\", $idPravo);\r\n return $vystup->execute();\r\n }",
"protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }",
"public function saveUser($nome,$email,$senha){\n \t$id = time();\n $nome = parent::escapeString($nome);\n $senha = md5(parent::escapeString($senha));\n $email = parent::escapeString($email);\n \t//fazer uma validação para ver se o usuario já não está cad\n \t$sql = \"insert into `usuarios` ( `id`,`nome`, `email`, `senha` ) values ('$id','$nome', '$email', '$senha')\"; \n return parent::executaQuery($sql);\n }",
"public static function crearUsuario($usuario)\n {\n \n $query = \"INSERT INTO users (nombre,email,usuario,password,privilegio) VALUES (:nombre,:email,:usuario,:password,:privilegio)\";\n \n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $nombre = $usuario->getNombre();\n $email = $usuario->getEmail();\n $usu = $usuario->getUsuario();\n $password = $usuario->getPassword();\n $privilegio = $usuario->getPrivilegio();\n\n \n $resultado->bindParam(\":privilegio\", $privilegio);\n $resultado->bindParam(\":nombre\", $nombre);\n $resultado->bindParam(\":email\", $email);\n $resultado->bindParam(\":usuario\", $usu);\n $resultado->bindParam(\":password\", $password);\n\n if ($resultado->execute()) {\n return true;\n }\n \n return false;\n \n \n \n }",
"public function registerUser(){\r\n\t\t$name = $_POST['register_name'];\r\n\t\t$email = $_POST['register_email'];\r\n\t\t$password = $_POST['register_password'];\r\n\r\n\t\t$sql = \"INSERT INTO users values (null,?,?,?)\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$name,$email,$password]);\r\n\t\t//ako je registracija uspela pojavice se div u formu sa ispisom notifikacije!!!\r\n\t\tif ($query) {\r\n\t\t\t$this->register_result=true;\r\n\t\t}\r\n\t}",
"function insertarUsuario($nombre,$apellidos,$edad){\n $sqlInsercion=\"INSERT INTO usuario(id,nombre,apellidos,edad)\n VALUES (NULL, '\".$nombre.\"', '\".$apellidos.\"', \".$edad.\")\";\n $this->conexion->query($sqlInsercion);\n }",
"public function crearusuario($codigo,$nombre,$precio,$cantidad){\r\n//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n//Preparamos la sentencia con parametros:\r\n\t$sql=\"insert into usuario (codigo,nombre,precio,cantidad) values(?,?,?,?)\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos y pasamos los parametros:\r\n\ttry{\r\n\t\t$consulta->execute(array($codigo,$nombre,$precio,$cantidad));\r\n\t} catch (PDOException $e){\r\n\t\tDatabase::disconnect();\r\n\t\tthrow new Exception($e->getMessage());\r\n\t}\r\n\tDatabase::disconnect();\r\n}",
"function p_crear_usuario(\n\t\t\t\t$cod_usuario\t\t\t\t\t,\n\t\t\t\t$txt_login\t\t\t\t\t\t,\n\t\t\t\t$txt_password\n\t\t){\n\t\t\tglobal $db;\n\t\t\t$query =\"\n\t\t\tinsert into\tseg_usuario(\n\t\t\ttxt_login\t\t,\n\t\t\tcod_usuario\t\t,\n\t\t\tind_bloqueado\t,\n\t\t\ttxt_password\n\t\t\t)values(\n\t\t\t'$txt_login'\t,\n\t\t\t'$cod_usuario'\t,\n\t\t\t0\t\t\t\t,\n\t\t\t'$txt_password'\n\t\t\t)\";\n\t\t\t$db->consultar($query);\t\n\t\t\t$cod_pk\t= $GLOBALS['fn_ultimo_registro'];\n\t\t\treturn $cod_pk;\n\t\t}",
"public function createUsuario()\n {\n $hash = password_hash($this->contra, PASSWORD_DEFAULT);\n $sql = 'INSERT INTO administradores(nombre, apellido, correo, usuario, contra)\n VALUES(?, ?, ?, ?, ?)';\n $params = array($this->nombre, $this->apellido, $this->correo, $this->usuario, $hash);\n return Database::executeRow($sql, $params);\n }",
"private function tbl_usuarios() {\r\n\t\t\t$this->usuarios = $this->esquema->createTable('USUARIOS');\r\n\t\t\t$this->usuarios->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('USUARIO', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Usuario de Ingreso'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('PASSWORD', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Contraseña de Ingreso'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombres del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('APELLIDO', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Apellidos del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('CEDULA', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Cedula del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('USUARIO_RR', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Usuario de RR'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('CORREO', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Correo electronico del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del Usuario [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('EMPRESA', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la Empresa del Usuario [ID de la tabla USUARIOS_EMPRESA]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('CARGO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Cargo del Usuario [ID de la tabla USUARIOS_CARGO]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('PERMISO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Usuario [ID de la tabla PERMISOS]'\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$this->usuarios->setPrimaryKey(array('ID'));\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->usuarios_empresa, array('EMPRESA'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->usuarios_cargo, array('CARGO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->permisos, array('PERMISO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }",
"public function register($pseudo,$prenom,$nom,$email,$password,$classe,$datedenaissance,$sexe)\n {\n try\n {\n $passwordhash = passwordhash($password);\n\n $dateinscription = date('Y-m-d', time());\n $prenomplusnom = $prenom.\" \".$nom;\n $lastco = strftime('%d %B %Y à %H:%M');\n \n $stmt = $this->db->prepare(\"INSERT INTO users(pseudo,prenom,nom,prenomplusnom,email,password,classe,datedenaissance,sexe,dateinscription,notifMailPrive,allowFindSearch,comptePrive,lastco) VALUES(:pseudo, :prenom, :nom, :prenomplusnom, :email, :password, :classe, :datedenaissance, :sexe, :dateinscription, :notifMailPrive, :allowFindSearch, :comptePrive, :lastco)\"); \n $stmt->execute(array(\n 'pseudo' => $pseudo,\n 'prenom' => $prenom,\n 'nom' => $nom,\n 'prenomplusnom' => $prenomplusnom,\n 'email' => $email,\n 'password' => $passwordhash,\n 'classe' => $classe,\n 'datedenaissance' => $datedenaissance,\n 'sexe' => $sexe,\n 'dateinscription' => $dateinscription,\n 'notifMailPrive' => 'true',\n 'allowFindSearch' => 'true',\n 'comptePrive' => 'false',\n 'lastco' => $lastco\n ));\n \n return true; \n }\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }",
"public function registrarUsuario()\n {\n $datos = array();\n\n //guardamos los datos del formulario en un array \n foreach ($_POST as $clave => $valor) {\n $datos[$clave] = $valor;\n }\n\n //añadimos una clave por defecto y generamos el ciu\n $datos['clave'] = hash('sha512', \"12345678\");\n $datos['ciu'] = self::generarCiu($datos['nombre'], $datos['apellidos'], $datos['fecha_nacimiento']);\n\n //insertamos los datos y mostramos un error en funcion de si ha habido error o no\n echo $this->Usuarios_model->registrarUsuario($datos) ? 1 : 0;\n }",
"function registrar(){\r\n\r\n include('config.php');\r\n\r\n date_default_timezone_set('America/Cuiaba');\r\n $pdo = new PDO('mysql:host='.HOST.';dbname='.DATABASE, USUARIO, SENHA);\r\n\r\n $cursos = array('Engenharia da Computação', 'Engenharia de Controle e Automação', 'Engenharia de Minas', 'Engenharia de Trasportes', 'Engenharia Quimica');\r\n \r\n $nome = $_POST['nome'];\r\n $email = $_POST['email'];\r\n $rga = $_POST['rga'];\r\n $semestre = $_POST['semestre']; \r\n $data = date('Y-m-d H:i:s');\r\n $senha = $_POST['senha'];\r\n $confirmaSenha = $_POST['confirmaSenha'];\r\n $curso = '';\r\n \r\n for($i = 1; $i <= 5; $i++){ //verificando qual o curso pelo rga\r\n\r\n if($rga['9'] == $i)\r\n $curso = $cursos[$i];\r\n \r\n \r\n }\r\n \r\n\r\n $sql = $pdo->prepare(\"INSERT INTO `tabela_estudantes` VALUES (null,?,?,?,?,?,?,?)\"); //inserirndo na tabela vendas\r\n\r\n $sql->execute(array($nome, $senha, $data, $email, $curso, $semestre, $rga));\r\n\r\n echo '<h6 style=\"color: rgb(255, 255, 255);\">Usuario registrado com sucesso!</h6>';\r\n\r\n }",
"public static function insertarUsuario($usuario, $passwordCodi, $nombre, $apellidos, $direccion, $telefono, $rol_nuevo) {\n $query = \"INSERT INTO usuario (usuario, password, nombre, apellidos, direccion, telefono) \"\n . \" VALUES (?,?,?,?,?,?)\";\n $stmt = conexion::$conexion->prepare($query);\n\n $stmt->bind_param(\"ssssss\", $usuario, $passwordCodi, $nombre, $apellidos, $direccion, $telefono);\n\n /* Ejecución de la sentencia. */\n $stmt->execute();\n\n //insertamos el rol del usuario en este caso registrado\n $query = \"INSERT INTO rol_usuario(rol_idroles, usuario_usuario) \"\n . \" VALUES (?,?)\";\n $stmt = conexion::$conexion->prepare($query);\n $stmt->bind_param(\"is\", $rol_nuevo, $usuario);\n\n /* Ejecución de la sentencia. */\n $stmt->execute();\n }",
"public function inserir(){\r\n\t\tif(!$this->_validarCampos())\r\n\t\t\t// levantando a excessao CamposObrigatorios //\r\n\t\t\tthrow new CamposObrigatorios();\r\n\t\t\r\n\t\tif($this->_testarServicoExiste($this->getNome()))\r\n\t\t\t// levanto a excessao//\r\n\t\t\tthrow new Exception(\"Serviço já cadastrado en nossa base de dados\");\r\n\t\t\r\n\t\t// recuperando a instancia da classe de acesso a dados //\r\n\t\t$instancia = ServicoDAO::getInstancia();\r\n\t\t// retornando o Usuario //\r\n\t\treturn $servico = $instancia->inserir($this);\r\n\t}",
"function add_user($bdd, $user)\n{\n $req = $bdd->prepare('INSERT INTO users(name,email,adress,postal_code,city)\n VALUES(:name,:email,:adress,:postal_code,:city)');\n $req->execute(array(\n ':name' => $user[0],\n ':email' => $user[1],\n ':adress' => $user[2],\n ':postal_code' => $user[3],\n ':city' => $user[4]\n ));\n}",
"public function insertar($datos)\n {\n\n $result = $this->db->where('username =', $datos['username']);\n $result = $this->db->get('auth_user');\n\n if ($result->num_rows() > 0) {\n #echo \"CORRECTO\";\n echo 'existe';\n } else {\n\n $result = $this->db->insert(\"auth_user\", $datos);\n return $result;\n }\n }",
"public static function addUser($userData) {\n $db = DB::getInstance();\n $columns = \"admin, date_created, first_name, last_name, lump, password, username\";\n $placeholders = \":admin, :date_created, :first_name, :last_name, :lump, :password, :username\";\n $sorted = $userData;\n uksort($sorted, function ($val1, $val2) {\n return strncmp($val1, $val2, 2);\n });\n $mssg = \"\";\n\n // Insert form data into database\n try {\n $statement = $db->prepare(\"INSERT INTO `users` ($columns) VALUES ($placeholders)\");\n $statement->execute($sorted);\n // Grab the id of the newly inserted record and pass it back to client\n $mssg = $db->lastInsertId();\n }\n catch (Exception $e) {\n $db->rollBack();\n $mssg = $e->getMessage();\n }\n return $mssg;\n }",
"public function insertDb(){\r\n\t\t\t$User_nom = addslashes($this -> getNom()) ;\r\n\t\t\t$User_prenom = addslashes($this -> getPrenom()) ;\r\n\t\t\t$User_pseudo = addslashes($this -> getPseudo());\r\n\t\t\t$User_pw = $this -> getPw();\r\n\t\t\t$User_email = addslashes($this -> getEmail());\r\n\t\t\t$VilleId = addslashes($this -> getVilleId()) ;\r\n\t\t\t$User_tel = addslashes($this -> getTel()) ;\r\n\t\t\t$Date_ins = $this -> getDateIns();\r\n\t\t\t$Date_modif = $this -> getDateModif();\r\n\t\t\t$VilleId = $this -> getVilleId();\r\n $User_nletter = $this -> getNLetter() ;\r\n $User_etat = $this -> getEtat();\r\n $nb = $this -> getNbNegativeUsers();\r\n $User_inscrit = $this -> getInscrit();//Ce user refuse de s'inscrire\r\n\t\t\tif(!empty($User_pseudo) && !empty($User_email) && !empty($User_tel)){//Si les champs obligatoires sont renseignes\r\n\t\t\t\t$query = \"insert into UserTab values(\".\r\n\t\t\t\t \"UserId,\".\r\n\t\t\t\t \"$VilleId,\".\r\n\t\t\t\t\t \"'\".$User_pseudo.\"',\".\r\n\t\t\t\t \"'\".$User_nom.\"',\". \r\n\t\t\t\t \"'\".$User_prenom.\"',\". \r\n\t\t\t\t \"'\".$Date_ins.\"',\".\t\t \r\n\t\t\t\t \"'\".$Date_modif.\"',\".\t\r\n\t\t\t\t \"'\".$User_email.\"',\". \r\n\t\t\t\t \"'\".$User_tel.\"',\".\r\n\t\t\t\t\t \"password(\\\"\".$User_pw.\"\\\"),\". //fonction password de MySQL crypte une chaine de caractere.\r\n\t\t\t\t\t\t\t\t // J'utilise \\\" pour tenir compte des caracteres speciaux de MySQL tel que \"'\" , \"*\" , etc \r\n\t\t\t\t $User_nletter .\",\".\r\n $User_etat.\",\".\r\n $User_inscrit.\r\n\t\t\t\t \")\";\r\n\r\n\t\t\t\t/*** Execution de la requete preparer ***/\r\n\t\t $r = execute($query);\r\n if($User_nletter == 1 ){//On insere son mail dans NewsLetterTab si ce user a accepter de recevoir les anonces\r\n $res = execute(\"insert into NewsLetterTab values(NewsLetterId , '$User_email')\");\r\n }\r\n\r\n\r\n\t\t\t\t/*** Recupere l'autoincrement pour l'UserId de cet UserTab ***/\r\n\t\t\t\t$User_nomtable = 'UserTab';\r\n\t\t $id = getAutoIncrementValue($User_nomtable);\r\n\t\t $this -> setUserId($id);\r\n\t\t\t}\r\n\r\n\r\n }",
"function add_usuario($params)\n {\n $this->db->insert('usuarios',$params);\n return $this->db->insert_id();\n }",
"private function processInsertUser(){\n\t\t//Comprueba que la variable tipo exista, sino pondra 1 por defecto\n\t\tif(isset($_REQUEST[\"tipo\"]))\n\t\t\t$tipo = $_REQUEST[\"tipo\"];\n\t\telse \n\t\t\t$tipo = 1;\n\n\t\tif($_FILES[\"foto_usuario\"][\"error\"] == 0){\n\t\t\t$randNumber = rand(0, 999999);\n\t\t\t$imgName = $randNumber . $_FILES['foto_usuario']['name'];\n\t\t\t$image_upload = Config::$userDirImage . $imgName;\n\t\t\tif (move_uploaded_file($_FILES['foto_usuario']['tmp_name'], $image_upload)) {\n\t\t\t\t$result = $this->users->insertUser($tipo, $imgName); //Devuelve 1 si inserta user\n\t\t\t\tif($result){\n\t\t\t\t\tif (Seguridad::getTipo() == \"0\"){\n\t\t\t\t\t\tView::redireccion(\"user\", \"userController\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader('Location: index.php');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tunlink($image_upload);\n\t\t\t\t\techo \"Ocurrio un error al insertar el usuario.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"Ocurrio un error al guardar el archivo.\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"Ocurrio un error al cargar el archivo.\";\n\t\t}\n\t}"
] | [
"0.74669296",
"0.74242127",
"0.73713857",
"0.7251889",
"0.7240292",
"0.7210654",
"0.7209995",
"0.7209995",
"0.71314096",
"0.7110059",
"0.71012497",
"0.7093611",
"0.7059105",
"0.70265627",
"0.7024429",
"0.70104",
"0.7003548",
"0.7002281",
"0.70022476",
"0.70001376",
"0.69995487",
"0.69806737",
"0.69790435",
"0.6962921",
"0.69440293",
"0.6910153",
"0.69026244",
"0.68858844",
"0.68817455",
"0.6874364",
"0.68725586",
"0.6866867",
"0.686558",
"0.6862052",
"0.68426764",
"0.6841137",
"0.6838437",
"0.6834207",
"0.68157053",
"0.6815126",
"0.6812814",
"0.6807805",
"0.680718",
"0.68050736",
"0.6795636",
"0.6793728",
"0.67829406",
"0.6775346",
"0.6765351",
"0.6762867",
"0.6759217",
"0.6753888",
"0.67537993",
"0.67537737",
"0.674229",
"0.67319536",
"0.67291754",
"0.6716577",
"0.6695731",
"0.6675725",
"0.6672244",
"0.66711915",
"0.6666485",
"0.6664527",
"0.6656488",
"0.6653018",
"0.6652671",
"0.6650544",
"0.6640266",
"0.663941",
"0.6636734",
"0.66357297",
"0.6635166",
"0.6628224",
"0.6628157",
"0.6625941",
"0.6623774",
"0.6623681",
"0.6615454",
"0.66137004",
"0.66086555",
"0.6604945",
"0.6600095",
"0.65961057",
"0.6581439",
"0.6580839",
"0.65802217",
"0.65772986",
"0.65736604",
"0.65686226",
"0.65648603",
"0.6554892",
"0.6548164",
"0.65402615",
"0.65394014",
"0.65372014",
"0.6536016",
"0.65334994",
"0.65262973",
"0.65247077"
] | 0.6817806 | 38 |
metodo para editar usuario. | public function editarUsuario(){
$sql = "UPDATE usuarios SET Usuario = '{$this->usuario}',
NombreCompleto = '{$this->nombreCompleto}',
Correo = '{$this->correo}',
IdRol = '{$this->idRol}'
WHERE IdUsuario = '{$this->idUsuario}'";
$res = $this->conexion->setQuery($sql);
return $res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function editar_usuario($id_usuario, $nombre, $apellido, $cedula, $telefono, $email, $direccion, $cargo, $usuario, $password1, $password2, $estado, $permisos)\n {\n\n $conectar = parent::conexion();\n parent::set_names();\n require_once(\"Usuarios.php\");\n $usuarios = new Usuarios();\n //verifica si el id_usuario tiene registro asociado a compras\n $usuario_compras = $usuarios->get_usuario_por_id_compras($_POST[\"id_usuario\"]);\n //verifica si el id_usuario tiene registro asociado a ventas\n $usuario_ventas = $usuarios->get_usuario_por_id_ventas($_POST[\"id_usuario\"]);\n //si el id_usuario NO tiene registros asociados en las tablas compras y ventas entonces se puede editar todos los campos de la tabla usuarios\n if (is_array($usuario_compras) == true and count($usuario_compras) == 0 and is_array($usuario_ventas) == true and count($usuario_ventas) == 0) {\n $sql = \"update usuarios set \n nombres=?,\n apellidos=?,\n cedula=?,\n telefono=?,\n correo=?,\n direccion=?,\n cargo=?,\n usuario=?,\n password=?,\n password2=?,\n estado=?\n where \n id_usuario=?\n \";\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"nombre\"]);\n $sql->bindValue(2, $_POST[\"apellido\"]);\n $sql->bindValue(3, $_POST[\"cedula\"]);\n $sql->bindValue(4, $_POST[\"telefono\"]);\n $sql->bindValue(5, $_POST[\"email\"]);\n $sql->bindValue(6, $_POST[\"direccion\"]);\n $sql->bindValue(7, $_POST[\"cargo\"]);\n $sql->bindValue(8, $_POST[\"usuario\"]);\n $sql->bindValue(9, $_POST[\"password1\"]);\n $sql->bindValue(10, $_POST[\"password2\"]);\n $sql->bindValue(11, $_POST[\"estado\"]);\n $sql->bindValue(12, $_POST[\"id_usuario\"]);\n $sql->execute();\n //SE ELIMINAN LOS PERMISOS SOLO CUANDO SE ENVIE EL FORMULARIO CON SUBMIT\n //Eliminamos todos los permisos asignados para volverlos a registrar\n $sql_delete = \"delete from usuario_permiso where id_usuario=?\";\n $sql_delete = $conectar->prepare($sql_delete);\n $sql_delete->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_delete->execute();\n //$resultado=$sql_delete->fetchAll();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n $permisos = $_POST[\"permiso\"];\n // print_r($_POST);\n $num_elementos = 0;\n while ($num_elementos < count($permisos)) {\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n }\n } else {\n //si el usuario tiene registros asociados en compras y ventas entonces no se edita el nombre, apellido y cedula\n $sql = \"update usuarios set \n telefono=?,\n correo=?,\n direccion=?,\n cargo=?,\n usuario=?,\n password=?,\n password2=?,\n estado=?\n where \n id_usuario=?\n \";\n //echo $sql; exit();\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"telefono\"]);\n $sql->bindValue(2, $_POST[\"email\"]);\n $sql->bindValue(3, $_POST[\"direccion\"]);\n $sql->bindValue(4, $_POST[\"cargo\"]);\n $sql->bindValue(5, $_POST[\"usuario\"]);\n $sql->bindValue(6, $_POST[\"password1\"]);\n $sql->bindValue(7, $_POST[\"password2\"]);\n $sql->bindValue(8, $_POST[\"estado\"]);\n $sql->bindValue(9, $_POST[\"id_usuario\"]);\n $sql->execute();\n //SE ELIMINAN LOS PERMISOS SOLO CUANDO SE ENVIE EL FORMULARIO CON SUBMIT\n //Eliminamos todos los permisos asignados para volverlos a registrar\n $sql_delete = \"delete from usuario_permiso where id_usuario=?\";\n $sql_delete = $conectar->prepare($sql_delete);\n $sql_delete->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_delete->execute();\n //$resultado=$sql_delete->fetchAll();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n if (isset($_POST[\"permiso\"])) {\n $permisos = $_POST[\"permiso\"];\n }\n //print_r($_POST);\n $num_elementos = 0;\n\n while ($num_elementos < count($permisos)) {\n\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n\n\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n } //fin while\n\n\n } // fin else\n\n\n }",
"function editUsuario($usuario)\n{\n\t\t$con = getDBConnection();\n\t\t$sql = \"UPDATE usuarios SET nombre = :nombre, apellidos = :apellidos, user_name = :user_name, password = :password, email = :email WHERE id = :id\";\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->bindParam(':id', $usuario->id);\n\t\t$stmt->bindParam(':nombre', $usuario->nombre);\n\t\t$stmt->bindParam(':apellidos', $usuario->apellidos);\n\t\t$stmt->bindParam(':user_name', $usuario->user_name);\n\t\t$stmt->bindParam(':password', $usuario->password);\n\t\t$stmt->bindParam(':email', $usuario->email);\n\t\t$stmt->execute();\n}",
"public function editar() {\n\t\t$POST = array();\n\n\t\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\n\n\t\t$POST = array('UsuarioCliente'=>$this->request->data);\t\n\t\tif ($this->UsuarioCliente->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Usuario editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu Usuario.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}",
"public function editarUsuario()\r\n {\r\n if(isset($_REQUEST['id'])){\r\n\r\n $rolController = new App\\Controllers\\RolController;\r\n $roles = $rolController->getAllRoles();\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n $user = $userController->getUser($_REQUEST['id']);\r\n \r\n require_once 'view/users/edit.php';\r\n } else {\r\n\r\n header('Location: ?c=Registro&a=usuarios');\r\n }\r\n\r\n }",
"public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }",
"public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }",
"public function editar($id){\r\n $usuario = User::find($id);\r\n if(count($usuario)){\r\n if($_SESSION[\"inicio\"] == true){\r\n return Vista::crear('admin.usuario.crear',array(\r\n \"usuario\"=>$usuario,\r\n ));\r\n }\r\n }\r\n return redirecciona()->to(\"usuario\");\r\n }",
"public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\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}",
"public function editUsuario(UsuarioTransfer $usuario) {\r\n if(!$this->dao){\r\n $this->dao = new UsuarioDAO();\r\n }\r\n $aux= $this->dao;\r\n return $aux->editUsuario($usuario);\r\n }",
"public function editUser(UserEditForm $form, User $user);",
"public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }",
"public function editarUsuario($dadosNovos){\n\t\t\t\n\t\t\t$this->load->database();\n\t\t\t\n\t\t\t//print_r($dadosNovos);\n\t\t\t\n\t\t\t$this->db->where('id_user', $dadosNovos['id_user']);\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\tif( ! $this->db->update('user', $dadosNovos))\n\t\t\t\t{\n\t\t\t\t\treturn \"erro\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"sucesso\";\n\t\t\t\t}\n\t\t\t\n\t\t}",
"protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}",
"public function edit($username)\n {\n //\n }",
"public function edit()\n {\n $user = User::findOne(Yii::$app->user->id);\n $user->username = $this->username;\n $user->email = $this->email;\n try {\n $user->save();\n return true;\n } catch(IntegrityException $e) {\n return false;\n }\n }",
"function editarPerfil(){\n \t//Llamo a la vista editar perfil\n \trequire \"app/Views/EditarPerfil.php\";\n \t\t$usuario = new Usuario();\n\t\t//Paso datos\n \t\t$usuario->nombre=$_POST['nombre'];\n \t\t$usuario->apellidoPaterno=$_POST['apellido_p'];\n \t\t$usuario->apellidoMaterno=$_POST['apellido_m'];\n \t\t$usuario->nombreUsuario=$_POST['nom_usuario'];\n \t\t$usuario->correo=$_POST['correo'];\n \t\t$usuario->contrasenia=$_POST['contrasenia'];\n \t\t$usuario->sexo=$_POST['sexo'];\n \t\t$usuario->descripcion=$_POST['descripcion'];\n \t\t$usuario->id=$_POST['id'];\n \t\t$usuario->contrasenia['password'];\n \t\t$usuario->editarUsuario();\n header(\"Location:/Proyecto/index.php?controller=Publicaciones&action=home\");\t\n }",
"private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}",
"public function update(){\n \n //comprueba que llegue el formulario con los datos\n if(empty($_POST['actualizar']))\n throw new Exception(\"No llegaron los datos\");\n \n //podemos crear un nuevo usuario o recuperar de la bdd,\n //crearé un nuevo usuario porque me ahorro una consulta\n $usuario= new Usuario();\n \n $usuario->id= intval($_POST['id']);\n $usuario->user= $_POST['user'];\n $usuario->pass= $_POST['pass'];\n $usuario->nombre= $_POST['nombre'];\n $usuario->apellidos= $_POST['apellidos'];\n $usuario->email= $_POST['email'];\n $usuario->direccion= $_POST['direccion'];\n $usuario->poblacion= $_POST['poblacion'];\n $usuario->provincia= $_POST['provincia'];\n $usuario->cp= $_POST['cp'];\n \n //intenta realizar la actualización de datos\n if($usuario->actualizar()===false)\n throw new Exception(\"No se pudo actualizar $usuario->user\");\n \n //prepara un mensaje. Es guarda en una variable global perque les variables no es recorden\n // despres d'executar les funcions! I ara no anem a la vista, sino que portem a un altre\n //métode!!\n $GLOBALS['mensaje']= \"Actualización del usuario $usuario->user correcta.\";\n \n //repite la operación de edit, así mantendrá al usuario en la vista de edición\n $this->edit($usuario->id);\n }",
"public function edit(ProfilUser $profilUser)\n {\n //\n }",
"public function edit(CompteUtilisateur $compteUtilisateur)\n {\n //\n }",
"public function editar(){\r\n\t\tif(!$this->_validarCampos())\r\n\t\t\t// levantando a excessao CamposObrigatorios //\r\n\t\t\tthrow new CamposObrigatorios();\r\n\t\t\r\n\t\tif($this->_testarServicoExisteEdicao($this->getId(), $this->getNome()))\r\n\t\t\t// levanto a excessao//\r\n\t\t\tthrow new Exception(\"Servico já cadastrado en nossa base de dados\");\r\n\t\t\r\n\t\t// recuperando a instancia da classe de acesso a dados //\r\n\t\t$instancia = ServicoDAO::getInstancia(); \r\n\t\t// retornando o Usuario //\r\n\t\treturn $servico = $instancia->editar($this);\r\n\t}",
"public function editarUsuario($usuario, $contrasenia, $nombre, $apellido, \n $correo, $imagen, $rol, $id){\n if(empty($usuario) or \n empty($contrasenia) or \n empty($nombre) or \n empty($apellido) or \n empty($correo) or\n empty($imagen) or \n empty($rol)){\n header(\"Location:usuarios.php?accion=add_usuario&i=1\");\n exit();\n }\n \n $sql = \"UPDATE usuarios SET usuario = ?, contrasenia = ?, nombre = ?, apellido = ?,\n correo = ?, imagen = ?, rol = ? WHERE id_usuario = ?\";\n\n $resultado = $this->db->prepare($sql);\n\n $resultado->bindValue(1, $usuario);\n $resultado->bindValue(2, $contrasenia);\n $resultado->bindValue(3, $nombre);\n $resultado->bindValue(4, $apellido);\n $resultado->bindValue(5, $correo);\n $resultado->bindValue(6, $imagen);\n $resultado->bindValue(7, $rol);\n $resultado->bindValue(8, $id);\n \n\n if(!$resultado->execute()){\n header(\"Location:usuarios.php?accion=edit_usuario&i=2&id=$id\");\n }else{\n //Insertamos el registro\n if($resultado->rowCount()>0){\n header(\"Location:usuarios.php?accion=edit_usuario&i=3&id=$id\");\n }else{\n header(\"Location:usuarios.php?accion=edit_usuario&i=4&id=$id\");\n }\n }\n }",
"public function edit(PagoUser $pagoUser)\n {\n //\n }",
"public function editAction()\n\t {\n\t \t$id \t\t\t= (int) $this->getRequest()->getParam('id');\n\t \t$userService \t= new User_Service_User();\n\t \t$user\t\t\t= $userService->read( $id );\n\t \tif( !$user instanceof User_Model_User){\n\t \t\t$this->addSystemError('L\\'utilisateur n\\'existe pas');\n\t \t\t$this->_redirect( '/User/index/list');\n\t \t}\n\t \t$form \t\t\t= new User_Form_Edituser();\n\t \t$form->setAction( '/User/index/edit/id/' . $id);\n\t \tif( $this->getRequest()->isPost() ){\n\t \t\tif( $form->isValid( $this->getRequest()->getPost() ) ){\n\t\t\t\tif( $userService->update( $id, $form->getValues() )){\n\t\t\t\t\t$this->addSystemSuccess('Utilisateur mis à jour');\n\t\t\t\t} else {\n\t\t\t\t\t$this->addSystemError('Echec de la mise à jour');\n\t\t\t\t}\n\t \t\t} else {\n\t \t\t\t$this->addSystemError('Le formulaire contient des erreurs');\n\t \t\t}\n\t \t} else {\n\t\t\t$userData \t\t= array( 'login' => $user->getLogin(),\n\t\t\t\t\t\t\t\t\t 'nom' => $user->getNom(),\n\t\t\t\t\t\t\t\t\t 'prenom' => $user->getPrenom(),\n\t\t\t\t\t\t\t\t\t 'email' => $user->getEmail(),\n\t\t\t\t\t\t\t\t\t 'telephone' => $user->geTtelephone(),\n\t\t\t\t\t\t\t\t\t 'civilite' => $user->getcivilite() \n\t\t\t\t\t\t\t\t\t);\n\t\t\t$form->populate( $userData );\n\t \t}\n\t\t$this->view->form = $form;\n\t }",
"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 }",
"function user_edit($user_info)\n {\n }",
"public function edit(Usuari $usuari)\n {\n //\n }",
"public function edit($user_id) {\n if ($_POST){\n #izmena vrednosti\n #redirekcija na listu\n \n $username = filter_input(INPUT_POST, 'username');\n $lastname = filter_input(INPUT_POST, 'lastname');\n $email = filter_input(INPUT_POST, 'email');\n \n if (!preg_match('/^[a-z0-9]{4,}$/', $username) or !preg_match('[A-z 0-9\\-]+', $fullname) or $email == '') {\n $this->setData('message', 'Izmene nisu tačno unete.');\n } else {\n $res = HomeModel::editById($user_id, $username, $lastname, $email);\n if ($res){\n Misc::redirect('homepage');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom izmene.');\n }\n }\n \n }\n \n $user = HomeModel::getById($user_id);\n $this->setData('korisnik', $user);\n }",
"public function edit($id)\n {\n $user = User::find($id); //BUAT QUERY UTK PENGAMBILAN DATA\n //LALU ASSIGN KE DALAM MASING-MASING PROPERTI DATANYA\n $this->idz = $user->id;\n $this->name = $user->name;\n $this->username = $user->username;\n $this->email = $user->email;\n $this->password = $user->password;\n\n $this->openUser(); //LALU BUKA User\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 editar_usuario($codigo_usuario){\n $data['usuario_editar'] = $this->model_admin->form_usuario($codigo_usuario);\n $this->load->view('view_librerias');\n $this->load->view('view_form_nuevo',$data);\n }",
"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 edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}",
"public function editar(){\n\n\t\tif( ! $this->session->has_userdata('logado'))\n\t\t\tredirect(base_url('webpedidos/'));\n\t\t\t\n\t\t$this->load->model('usuario/Usuario_model', 'usuario');\n\t\t\n\t\t$id = trim($this->input->post('id'));\n\t\t$novoNivel = trim($this->input->post('novoNivel'));\t\n\t\t$novoLogin = trim($this->input->post('novoLogin'));\t\n\n\t\t\n\t\t$editado = $this->usuario->editar($id, $novoNivel, $novoLogin );\n\t\n\t\t$this->output->set_content_type('application/json')->set_output(json_encode($editado));\n\t}",
"function EDIT()\n{\n\t$comprobar = $this->comprobar_atributos(); //Busca si la tupla es correcta o tiene algun error\n\n\tif($comprobar == true)\n\t{\n\t\t$sql = \"UPDATE USUARIOS\n\t\t\t\tSET \n\t\t\t\t\tpassword = '$this->password',\n\t\t\t\t\tDNI = '$this->DNI',\n\t\t\t\t\tnombre = '$this->nombre',\n\t\t\t\t\tapellidos = '$this->apellidos',\n\t\t\t\t\ttelefono = '$this->telefono',\n\t\t\t\t\temail = '$this->email',\n\t\t\t\t\tFechaNacimiento = '$this->FechaNacimiento',\n\t\t\t\t\tfotopersonal = '$this->fotopersonal',\n\t\t\t\t\tsexo = '$this->sexo'\n\t\t\t\tWHERE (\n\t\t\t\t\tlogin = '$this->login'\n\t\t\t\t)\n\t\t\t\t\";\n\n\t\tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Actualización realizada con éxito';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\treturn $resultado;\n\t}\n\telse{\n\t\treturn $comprobar;\n\t}\n}",
"public static function edit(Usuario $usuario) {\n\n $req = Db::getInstance()->prepare(\"UPDATE usuario SET login=:login,senha=:senha WHERE id=:id\");\n $req->bindValue(\":id\", $usuario->getId());\n $req->bindValue(\":login\", $usuario->getLogin());\n $req->bindValue(\":senha\", $usuario->getSenha());\n return $req->execute();\n }",
"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 }",
"function editUserAction()\n {\n $userRp = new UserRepository();\n $validateF = new ValidateFunctions();\n $user = $userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n if ($user != 0) {\n $obj_array = json_decode($user[3], true);\n $pass = $obj_array['user_password'];\n $addedBy = $obj_array['user_added'];\n\n if (!empty($_POST)) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email']];\n\n if ($_SESSION['id'] == $_GET['id']) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email'], $_POST['user_password'], $_POST['user_confirm']];\n }\n if ($this->checkUserInfo($_POST, $_FILES, $requiredFields)) {\n $file = $this->uploadUserImage($_FILES);\n $userInfo = $this->buildUserObject($_POST, $file, $pass, $addedBy);\n $email = $validateF->sanitize($_POST['user_email']);\n $this->updateUserToDatabase($userInfo, $validateF->sanitize($_GET['id']), $email);\n $_SESSION['success'] = ['User edited successfully.'];\n header('Location:index.php?action=index');\n } else{\n header('Location:index.php?action=index');\n }\n } else{\n $modelF = new ModelFunctions();\n $modelF->getAddUserForm();\n }\n } else {\n $_SESSION['error'] = ['User not found.'];\n header('Location:index.php?action=adminUsers');\n }\n\n }",
"public function editUser(){\n\n\t\t$username = filter_input(INPUT_POST, 'newusername', FILTER_SANITIZE_STRING);\n\t\t$id = $_POST[\"id\"];\n\t\ttry {\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\t\t\t$result = $db->query('SELECT * FROM users WHERE id=\"'.$id.'\"');\n\n\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif(!$row == 0){\n\t\t\t\t\t$statement = $db->prepare(\"UPDATE users SET username=:username WHERE id=:id\");\n\t\t\t\t\t$statement->bindParam(':username', $username, PDO::PARAM_STR);\n\t\t\t\t\t$statement->bindParam(':id', $id, PDO::PARAM_INT);\n\t\t\t\t\t$statement->execute();\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"No data present.\");\n\t\t\t\t}\t\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}",
"function editarCliente(\n\t\t\t$firstname,$lastname,$email,$phone,$commentary,$idCliente,$usuario,$password){\n\t\t\t\n\t\t\t$password = sha1($password);\n\t\t\t//SQL\n\t\t\t$query = \"UPDATE users SET \n\t\t\t\tfirstname = '\".$firstname.\"',\n\t\t\t\tlastname = '\".$lastname.\"',\n\t\t\t\temail = '\".$email.\"',\n\t\t\t\tphone = '\".$phone.\"',\n\t\t\t\tcommentary = '\".$commentary.\"' ,\n\t\t\t\tupdated_at = NOW(),\n\t\t\t\tuser = '\".$usuario.\"'\";\n\t\t\t\tif($password != ''){\n\t\t\t\t\t$query.= \", password = '\".$password.\"'\";\n\t\t\t\t}\n\t\t\t\t$query .=\"\n\t\t\t\t\n\t\t\t\tWHERE id = '\".$idCliente.\"';\";\n\n\t\t\t$rst = $this->db->enviarQuery($query,'CUD');\n\t\t\treturn $rst;\n\t\t}",
"function get_user_to_edit($user_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 }",
"public function testUpdateUser()\n {\n }",
"public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }",
"function editUsers(string $first_name, string $last_name, string $email, string $password, int $id) : void\n{\n\n $db = new Database;\n $db = $db->dbConnect();\n\n // requète pour modifier un user précis\n $sql = \"UPDATE user SET first_name = :first_name, last_name = :last_name, mail = :mail, password = :password WHERE id = :id\";\n\n /* on hashe le nouveau mot de passe */\n $passwordHashed = password_hash($password, PASSWORD_DEFAULT);\n\n\n $editUsers = $db->prepare($sql);\n $editUsers = $editUsers->execute([\n ':id' => $id,\n ':first_name' => $first_name, \n ':last_name' => $last_name, \n ':mail' => $email,\n ':password' => $passwordHashed\n ]);\n}",
"function alterarUsuario($conexao){\n\t\tif(isset($_POST[\"idusuario\"])){\n\t\t\t/*preenche os dados com as informações vindas do formulário*/\n\t\t\t$nome = $_POST['txtNomeUsuario'];\n\t\t\t$telefone = $_POST['txtTelUsuario'];\n\t\t\t$email = $_POST['txtEmailUsuario'];\n\t\t\t$logradouro = $_POST['txtLograUsuario'];\n\t\t\t$numero = $_POST['txtNumUsuario'];\n\t\t\t$bairro = $_POST['txtBairroUsuario'];\n\t\t\t$cidade = $_POST['txtCidadeUsuario'];\n\t\t\t$estado = $_POST['txtEstadoUsuario'];\n\t\t\t$sexo = isset($_POST['txtSexoUsuario']);\n\t\t\t$dtNasc = $_POST['txtDtnascUsuario'];\n\t\t\t$id = $_POST['idusuario'];\n\n\t\t\t/*Chama a função para alterar no banco passando os novos valores*/\n\t\t\t$retorno = usuario_alterar($conexao,$nome,$telefone,$email,$logradouro,$numero,$bairro,\n\t\t\t\t$cidade,$estado,$sexo,$dtNasc,$id);\n\n\t\t\t/*Se existir algum retorno ele entra coloca uma mensagem de sucesso e chama a pagina para listar os dados*/\n\t\t\tif($retorno){\n\t\t\t\t$retornoExc = \"Contato Alterado com Sucesso!\";\n\t\t\t\t$dados = listarDados($conexao);\n\t\t\t\trequire(\"view_lista.php\");\n\t\t\t}else{\n\t\t\t\t/*retorna mensagem informando que a alteração não foi realizada*/\n\t\t\t\tif(!valida_email($email)){\n\t\t\t\t\t$retornoExc = \"A alteração falhou, digite um email valido!\";\n\t\t\t\t}\n\t\t\t\telse if($nome == \"\"){\n\t\t\t\t\t$retornoExc = \"A alteração falhou o campo nome é obrigatório, tente novamente!\";\n\t\t\t\t}\n\t\t\t\t$dados = listarDados($conexao);\n\t\t\t\trequire(\"view_lista.php\");\n\t\t\t}\n\t\t\t\n\t\t}else if(isset($_GET['codigo'])){\n\t\t\t/*Pega o id passado pela url do contato que deseja excluir*/\n\t\t\t$id = $_GET['codigo'];\n\t\t\t/*Pega os dados do usuário passando a conexão e id*/\n\t\t\t$retorno = usuario_porId($conexao,$id);\n\t\t\t/*Se não existir retorno informa que busca falhou e retorna falso*/\n\t\t\tif(!$retorno){\n\t\t\t\t$retornoExc = \"Falha em buscar o Contato \";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t/*Cria uma linha com os dados do contato passando para a variavel*/\n\t\t\t$dadosUsuario = mysqli_fetch_row($retorno);\n\t\t\t/*Passa para a variavel dados as informações do array com seus indices*/\n\t\t\t$dados = array(\"id\" => $dadosUsuario[0], \"nome\" => $dadosUsuario[1], \"logradouro\" => $dadosUsuario[2] , \"numero\" => $dadosUsuario[3], \"bairro\" => $dadosUsuario[4], \"cidade\" => $dadosUsuario[5], \"estado\" => $dadosUsuario[6], \"telefone\" => $dadosUsuario[7], \"email\" => $dadosUsuario[8], \"sexo\" => $dadosUsuario[9], \"dtNasc\" => $dadosUsuario[10]);\n\t\t\t/*Chama o formulario para alteração do usuário*/\n\t\t\trequire(\"view_form_cadastro_altera_usuario.php\");\n\t\t}else{\n\t\t\t$dados = listarDados($conexao);\n\t\t\trequire(\"view_lista.php\");\n\t\t}\n\t\t\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 }",
"function modificarUsuario(){\n global $conexion, $data;\n $id = $data[\"id\"];\n $usuario = $data[\"usuario\"];\n $email = $data[\"email\"];\n $clave = $data[\"clave\"];\n $resultado = mysqli_query($conexion,\"UPDATE usuario SET usu_usuario='$usuario', usu_clave='$clave' WHERE usu_id='$id'\");\n echo validarError($conexion, true, $resultado);\n }",
"public function editAction()\n {\n // Check logged\n $userId = UserModel::checkLogged();\n \n //We get user data\n $user = UserModel::getUserById($userId);\n \n \n $name = $user['name'];\n \n \n $result = false;\n \n // Form processing\n if (isset($_POST['submit'])) {\n \n // Getting data from the form\n $name = $_POST['name'];\n $password = $_POST['password'];\n \n \n // Form error flag\n $errors = false;\n \n // If necessary, you can validate the values as needed\n if (!UserModel::checkName($name)) {\n $errors[] = 'The name must not be shorter than 2 characters';\n }\n \n if (!UserModel::checkPassword($password)) {\n $errors[] = 'Password must not be shorter than 6 characters';\n }\n \n if ($errors == false) {\n $result = UserModel::edit($userId, $name, $password);\n }\n }\n \n // Connect the view\n $this->view('header.tpl');\n $this->view('view.tpl', ['user' => $user,\n 'result' => $result]\n );\n $this->view('footer.tpl');\n \n return true;\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n\n $loggedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $this->getIdentity()->getId() );\n\n $editedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $id );\n\n $form = $this->createForm('\\Panel\\Form\\User\\User', array(\n 'loggedUserRole' => $loggedUser->getRole(),\n 'editedUserRole' => $editedUser->getRole(),\n ));\n\n if($id)\n {\n $form = $form->bindObjectById($id);\n }\n\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = array(\n 'name' => $request->getPost()->name,\n 'email' => $request->getPost()->email,\n 'phone' => $request->getPost()->phone,\n 'birthDate' => $request->getPost()->birthDate,\n 'height' => $request->getPost()->height,\n 'tmrModifier' => $request->getPost()->tmrModifier,\n 'goalWeight' => $request->getPost()->goalWeight,\n 'personality' => $request->getPost()->personality,\n 'activityLevel' => $request->getPost()->activityLevel,\n 'isFemale' => $request->getPost()->isFemale,\n 'status' => $request->getPost()->status,\n 'role' => $request->getPost()->role,\n );\n\n if($request->getPost()->password!='')\n {\n $data['password'] = $request->getPost()->password;\n }\n\n $form->setData($data);\n\n if ($form->isValid())\n {\n $entityManager = $this->getEntityManager();\n\n $user = $form->getObject();\n\n if($request->getPost()->password!='')\n {\n $user->setPassword($request->getPost()->password);\n }\n\n $userFromEmail = $entityManager\n ->getRepository('Core\\Entity\\User')\n ->findOneBy(array('email' => $user->getEmail()));\n\n if($userFromEmail==null || $userFromEmail->getId()==$user->getId())\n {\n $entityManager->persist($user);\n $entityManager->flush();\n\n $this->flashMessenger()->addSuccessMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User has been modified.\")\n );\n\n if( $id)\n {\n return $this->redirect()->toRoute(\n 'panel/user/:id', array('id' => $id)\n );\n }\n else\n {\n return $this->redirect()->toRoute('panel/user');\n }\n }\n else\n {\n $form->setData($request->getPost());\n\n $this->flashMessenger()->addErrorMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User hasn't been modified. E-mail already exists.\")\n );\n }\n }\n }\n\n $view = new ViewModel();\n $view->setVariable('user', $form->getObject());\n $view->setVariable('form', $form);\n\n return $view;\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 edit(User $user)\n {\n }",
"public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }",
"public function edit(User $user)\n {\n \n }",
"public function actionModificar()\n {\n $model = Yii::$app->user->identity->usuariosDatos;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->localidad === null && $model->direccion === null) {\n $model->geoloc = null;\n }\n if ($model->save() && $model->upload()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Has actualizado tus datos correctamente'));\n }\n }\n\n return $this->render('/usuarios/update', [\n 'modelDatos' => $model,\n 'seccion' => 'personal',\n 'generos' => Utiles::translateArray(UsuariosGeneros::find()\n ->select('sexo')\n ->indexBy('id')\n ->column()),\n ]);\n }",
"public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \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 edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }"
] | [
"0.790183",
"0.7828475",
"0.7823068",
"0.7779322",
"0.7777758",
"0.77514607",
"0.7629311",
"0.7566047",
"0.7548709",
"0.74989766",
"0.74749464",
"0.74551475",
"0.74395186",
"0.7435375",
"0.74068046",
"0.73974115",
"0.7383274",
"0.73637915",
"0.7329798",
"0.7320311",
"0.73102874",
"0.73031855",
"0.729809",
"0.72954327",
"0.72947294",
"0.7294472",
"0.72804016",
"0.7265929",
"0.72408724",
"0.72273594",
"0.721485",
"0.7187042",
"0.7183359",
"0.7176372",
"0.7174409",
"0.7168804",
"0.7167346",
"0.7165642",
"0.7163063",
"0.7151961",
"0.71481526",
"0.71379656",
"0.7137703",
"0.7133399",
"0.7132816",
"0.71327317",
"0.7106565",
"0.7106104",
"0.70999503",
"0.7099445",
"0.7090531",
"0.7081181",
"0.70656997",
"0.70644546",
"0.7058246",
"0.7053417",
"0.7043098",
"0.70424354",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235",
"0.70424235"
] | 0.7320282 | 20 |
metodo para cambiar estado del usuario | public function cambiarEstado(){
$sql = "UPDATE usuarios SET Estado = (CASE WHEN Estado = 1 THEN 0 ELSE 1 END)
WHERE IdUsuario = '{$this->idUsuario}';";
$res = $this->conexion->setQuery($sql);
return $res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updatedUsuario()\n {\n // Notificamos al otro componente el cambio\n $this->emit('cambioUsuario', $this->usuario);\n }",
"public function openUser()\n {\n $this->isUser = true;\n }",
"function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }",
"public function getEstadoUsuario() {\n\t\treturn $this->estadoUsuario;\n\t}",
"public static function isUser(){\n if(isset($_SESSION['role'])) {\n $status = Validation::Nettoyer_string($_SESSION['role']);\n if($status==\"user\"){\n return \"user\";\n } else {\n return \"visiteur\";\n }\n }else{\n return \"visiteur\";\n }\n }",
"public function actionUserState ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\t\t\t\t$user->active = $post[ 'state' ];\n\t\t\t\t$user->save();\n\t\t\t}\n\t\t\techo $post[ 'state' ];\n\n\t\t\tYii::$app->end();\n\t\t}",
"public function set_new_user () { //вынести в отдельный класс Admin\n \n if ($this->user_status == 0) {\n file_put_contents ('user.csv', $this->userID.\",\". time() .\"\\n\", FILE_APPEND);\n $this->set_new_password();\n $result = 'Новый пользователь: '.$this->userID.\"\\n\";\n }\n else {\n $result = 'Пользователь: '.$this->userID.\" уже зарегистрирован\\n\";\n }\n return $result; \n }",
"public function getStatus() \n {\n if ($this->status) \n {\n \techo 'user status : присутствует<br><br><br>';\n }\n else\n {\n \techo 'user status : отсутствует<br><br><br>';\t\n }\n }",
"function status($uuid){\n perfil_superior();\n if ($uuid==$this->session->userdata('usuario')[\"uuid\"]) {\n #MENSAJE ERROR\n $this->session->set_flashdata('mensaje_error',\"No puedes cambiar tu propio estado\");\n redirect('usuarios/index','refresh');\n }\n $resultado=$this->Usuario_Model->get_user($uuid);\n if ($resultado[\"status\"]==1) {\n $usuario = [\n \"status\"=> 0,\n \"fecha_modificacion\" => date('Y-m-d H:i:s') \n ];\n $mensaje = \"Desactivado\";\n }else{\n $usuario = [\n \"status\"=> 1,\n \"fecha_modificacion\" => date('Y-m-d H:i:s') \n ];\n $mensaje = \"Activado\";\n }\n $this->Usuario_Model->update($uuid,$usuario);\n\n #MENSAJE EXITO\n $this->session->set_flashdata('mensaje_exito',\"Usuario \".$mensaje);\n redirect('usuarios/index','refresh');\n \n \n }",
"public function current_status(){\n\t\t$username = $this->CI->session->userdata('username');\n\t\t$password = $this->CI->session->userdata('password');//THIS WILL BE MD5 already because that is how we stored it there\n\t\t\n\t\tif($username && $password)\n\t\t\treturn $this->validate($username, $password);\n\t\telse\n\t\t\treturn false;\n\t}",
"function identifyUser() {\n}",
"abstract protected function getUser();",
"public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }",
"public function solicitaUsuario()\n {\n // Lo emitimos por evento\n $this->emit('cambioUsuario', $this->usuario);\n }",
"static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"abstract public function user();",
"private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }",
"public function setUserToLoggedIn($result) {\n // this is dangerous and lazy but will be fine for the assignment.\n $_SESSION['is_logged_in'] = true;\n $_SESSION['user_id'] = $result->id;\n $_SESSION['username'] = $result->username;\n $_SESSION['membership'] = $result->membership;\n $_SESSION['avatar'] = $result->avatar;\n $_SESSION['created_at'] = $result->created_at;\n }",
"function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}",
"protected function update_user_is () {\n\t\t$this->is_guest = $this->user_id == User::GUEST_ID;\n\t\t$this->is_user = false;\n\t\t$this->is_admin = false;\n\t\tif ($this->is_guest) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Checking of user type\n\t\t */\n\t\t$groups = User::instance()->get_groups($this->user_id) ?: [];\n\t\tif (in_array(User::ADMIN_GROUP_ID, $groups)) {\n\t\t\t$this->is_admin = true;\n\t\t\t$this->is_user = true;\n\t\t} elseif (in_array(User::USER_GROUP_ID, $groups)) {\n\t\t\t$this->is_user = true;\n\t\t}\n\t}",
"public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }",
"public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}",
"public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }",
"function grabUserAccountInfo(){\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$session = JFactory::getSession();\n\t\t$post \t = $app->input->post->getArray();\n\t\t\n\t\t$session->set('userInfo', $post, 'register');\n\t\t\n\t\t//find step 3 or 4; step 4 = normal registration; step 3 = skip plan\n\t\t$skipPlan \t= $session->get('skipPlan', 0, 'register');\n\t\t$step = ($skipPlan) ? 'step=3' : 'step=4';\n\t\t\n\t\t$link = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&'.$step, false);\n\t\t$this->setRedirect($link);\n\t\treturn false;\n\t}",
"private function setUser() {\n if (Request::has(\"include-user-read\") && Request::input(\"include-user-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-user-write\") && Request::input(\"include-user-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-user-execute\") && Request::input(\"include-user-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }",
"public function getEnableUserState();",
"function user_login_status() {\n $g = get_session('user_data');\n if (!empty($g)) {\n return true;\n }\n return false;\n}",
"private function logInVOUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(44);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }",
"function autenticado() {\t\n\tif(!isset( $_SESSION['autenticado'])) {\n\t\treturn false;\n\t} else {\n\t\treturn $_SESSION['autenticado'];\n\t}\n\t\n}",
"private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }",
"protected function hasLoginBeenProcessed() {}",
"function getUser() {\r\n\t\treturn false;\r\n\t}",
"public function user_mode() {\n if( (!isset($_SESSION[\"admin\"][\"user_mode\"])) || ($_SESSION[\"admin\"][\"user_mode\"] != 1) ) {\n $_SESSION[\"admin\"][\"user_mode\"] = 1;\n } elseif($_SESSION[\"admin\"][\"user_mode\"] == 1) {\n $_SESSION[\"admin\"][\"user_mode\"] = 0;\n }\n }",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function getUserInput() {\n\n $backWithSession = isset($_SESSION['isLoggedIn']);\n $this->setBackWithSession($backWithSession);\n $userIsLoggedIn = $this->gateKeeper->getIsLoggedIn();\n $wantsToLogout = isset($_REQUEST[self::$logout]);\n $hasUserCookieSet = isset($_COOKIE[self::$cookieName]);\n $wantsToLogin = isset($_REQUEST[self::$login]);\n $postedRegistrationForm = $_SERVER[\"REQUEST_METHOD\"] === \"POST\" && isset($_REQUEST[\"register\"]);\n $clickedRegistrationLink = isset($_REQUEST[\"register\"]) && $_REQUEST[\"register\"] === \"1\";\n\n if ($userIsLoggedIn || $backWithSession) {\n\n if ($wantsToLogout) {\n $this->setWantsToLogout(true);\n }\n\n if ($backWithSession && $hasUserCookieSet) {\n $this->setWantsToLogin(true);\n $this->setBackWithSession(true);\n $this->user = new User();\n $this->user->setSessionID($this->getRandomSessionCookie($_COOKIE[self::$cookieName]));\n $this->user->setUsername($_COOKIE[self::$cookieName]);\n\n }\n\n } else {\n\n if ($wantsToLogin) {\n $this->setWantsToLogin(true);\n $this->initializeLogin();\n\n } else if ($postedRegistrationForm) {\n $this->setWantsToRegister(true);\n $this->initializeRegistration();\n\n } else if ($clickedRegistrationLink) {\n $this->setWantsToRegister(true);\n $this->shouldBypassController = true;\n\n }\n }\n }",
"static public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$item = \"usu_descri\";\n\t\t\t\t$valor = $_POST[\"ingUsuario\"];\n\t\t\t\t$pass = $_POST[\"ingPassword\"];\n\n\t\t\t\t$respuesta = ModeloUsuarios::MdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\tif($respuesta[\"usu_descri\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"])\n\t\t\t\t{\n\n\t\t\t\t\tif($respuesta['estado'] == 'A')\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$_SESSION[\"iniciarSesion\"] = \"ok\";\n\t\t\t\t\t\t$_SESSION[\"id\"] = $respuesta[\"id\"];\n\t\t\t\t\t\t// $_SESSION[\"nombre\"] = $respuesta[\"nombre\"];\n\t\t\t\t\t\t$_SESSION[\"usuario\"] = $respuesta[\"usu_descri\"];\n\t\t\t\t\t\t// $_SESSION[\"foto\"] = $respuesta[\"foto\"];\n\t\t\t\t\t\t// $_SESSION[\"perfil\"] = $respuesta[\"perfil\"];\n\n\t\t\t\t\t\techo '<script>\n\t\n\t\t\t\t\t\twindow.location = \"inicio\";\n\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activo, porfavor, comuniquese con el administrador</div>';\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t}\n\n\t}",
"public function check_insta_user() {\n \n }",
"public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }",
"public function activarUsuario() {\n\t\t$this->id_status = self::STATUS_ACTIVED;\n\t\treturn $this->save () ? $this : null;\n\t}",
"function authorization() {\n\t\t//~ screening user data\n\t\t$user_data=mysql::screening_array($_POST);\n\t\t//~ Find a user with the same name and taking his key\n\t\t$find_user=mysql::query(\"SELECT * FROM `users` WHERE `login_user`='\".$user_data['login'].\"';\", 'assoc');\n\t\tif (!$find_user) {\n\t\t\t//~ user not found\n\t\t\tself::$error='Пользователь не найден';\n\t\t\treturn false;\n\t\t} else {\n\t\t\t//~ user found\n\t\t\t$passwd=md5($find_user['key_user'].$user_data['passwd'].SECRET_KEY); //~ password hash with the private key and user key\n\t\t\tif ($passwd==$find_user['passwd_user']) {\n\t\t\t\t//~ passwords match\n\t\t\t\t$_SESSION['id_user']=$find_user['id_user'];\n\t\t\t\t$_SESSION['login_user']=$find_user['login_user'];\n\t\t\t\t//~ if user select \"remember me\"\n\t\t\t\tif (isset($user_data['remember']) and $user_data['remember']=='on') {\n\t\t\t\t\t$cook_code=$this->generateCode(15);\n\t\t\t\t\t$user_agent=mysql::screening($_SERVER['HTTP_USER_AGENT']);\n\t\t\t\t\tmysql::query(\"INSERT INTO `session` (`id_sess`, `id_user`, `code_sess`, `user_agent_sess`) VALUES (NULL, '\".$find_user['id_user'].\"', '\".$cook_code.\"', '\".$user_agent.\"');\");\n\t\t\t\t\tsetcookie(\"id_user\", $_SESSION['id_user'], time()+3600*24*30);\n\t\t\t\t\tsetcookie(\"code_user\", $cook_code, time()+3600*24*30);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//~ passwords not match\n\t\t\t\tself::$error='Пользователь не найден или пароль не совпадают';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function set_user_state() {\n\t\t$session = session();\n\t\t$request = \\Config\\Services::request();\n\n\t\t//Check if he logged in and he is the host\n\t\tif(!isset($_SESSION['logged_in']) || !$this->checkHost()) {\n\t\t\treturn redirect()->to('/auth/signin');\n\t\t}\n\n\t\t$game_session = $request->getPost('game_session');\n\t\t$user_id = $request->getPost('user_id');\n\t\t$mute = $request->getPost('mute');\n\t\t$buzzer = $request->getPost('buzzer');\n\n\t\t$gameModel = new GameModel();\n\t\tif(!isset($user_id) || $user_id <= 0)\n\t\t\t$user_id = -1;\n\t\tif(isset($mute))\n\t\t\t$data = $gameModel->set_user_state($user_id, $game_session, 'mute', $mute);\n\n\t\tif(isset($buzzer))\n\t\t\t$data = $gameModel->set_user_state($user_id, $game_session, 'buzzer', $buzzer);\n\n\t\treturn true;\n\t}",
"public function actualizarUsuario()\n {\n //quitamos el id del array y lo guardamos a parte\n $datos = $_POST;\n $ciu = isset($datos['CIU']) ? $datos['CIU'] : $this->session->userdata(\"ciu\");\n unset($datos['CIU']);\n\n //miramos si ha enviado imagen de perfil. de ser asi se procesa en otro metodo aparte y se quita del array\n if (isset($datos['img'])) {\n self::actualizarImagenPerfil($datos['img']);\n unset($datos['img']);\n }\n\n echo $this->Usuarios_model->actualizarUsuario($ciu, $datos);\n }",
"public function checkUserSettings(){\n $data = $this->db->start()->get('*','user', array(array('id', '=', $_SESSION['_user']['id'])))->first();\n $_SESSION['_user'] = array('id' => $data->id, 'firstname' => $data->firstname, 'lastname' => $data->lastname, 'email' => $data->email, 'userLevel' => $this->getuserLevel($data->id)); \n }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"function cambiarEstado(){\n global $conexion, $data;\n $id = $data[\"id\"];\n $estado = $data[\"estado\"];\n $resultado = mysqli_query($conexion,\"UPDATE usuario SET usu_estado='$estado' WHERE usu_id='$id'\");\n echo validarError($conexion, true, $resultado);\n }",
"function revisar_usuario() {\n return isset($_SESSION['nombre']); //valida que exista un nombre en session\n}",
"public function r_user(){\n\t\tif (!empty($this -> user)) {\n\t\t\techo 'value = \"'.$this -> user.'\"';\n\t\t}\n\t}",
"protected function _session_update_info(){\n\t\t$info = session_info($this->_state_session_id);\n\t\t$this->_user_name = $info['name'];\n\t\t$this->_user_id = $info['user_id'];\n\t\t$this->_user_email = $info['email'];\n\t\t$this->_user_class_id = $info['userclass_id'];\n\t\t$this->_user_class_name = $info['userclass_name'];\n\t}",
"private function setViewed(){\n if ( !$this->isViewed() ){\n $viewKey = $this->getViewKey();\n\n if ( Auth::check() ){ //user had login, record user action\n Cache::put($viewKey.':user:'.Auth::user()->id, time(), Config::get('counter.viewCountDuration'));\n $this->recordUser('view');\n } else { //guest. use session\n session([$viewKey=>time()]);\n }\n\n return true;\n }\n\n return false;\n }",
"public function GetUserLoggedInStatus()\n {\n \n $this->User_Logged_In = isset($_SESSION['USER_LOGIN']['LOGIN_RECORD']) ? true : false;\n }",
"function iniciar_sesion($id_user, $pass){\n\t\t\t//if ( no lo encontro )\n\t\t\t\t//return false;\n\t\t\t$_SESSION['id_usuario'] = $id_usuario;\n\t\t\t$_SESSION['tipo'] = $type;\n\t\t\t$_SESSION['usuario'] = $usuario;\n\t\t\treturn true;\n\t\t}",
"private function checkValidUser() {\n return;\n if(!($this->getData('key') == $this->sessionId && isset($_SESSION['user']) && isset($_SESSION['valid']) && $_SESSION['valid'] === true)) {\n $this->output = array(\n 'success' => false,\n 'key' => 'kMIvl'\n );\n\n // Terminate the call now, user isn't allowed to perform this action\n $this->renderOutput(true);\n }\n }",
"function estaLogueado() {\n return isset($_SESSION[\"email\"]);\n }",
"public function profil()\n {\n // J'appelle toutes les variables dont j'ai besoin par défaut dans la buildview\n $login = $this->request->getSession()->getAttribut(\"login\"); // recupere le login\n $id = $this->request->getSession()->getAttribut(\"idUser\"); // récupère l'id\n $newpassword = $this->request->getParameterByDefault('newpassword');\n $newpasswordverif = $this->request->getParameterByDefault('newpasswordverif');\n $msgs = [];\n\n\n // j'arrive en post car des données sont saisies dans le formulaire\n if($newpassword && $newpasswordverif)\n {\n\n if($newpassword != $newpasswordverif)\n {\n $msgs[] = \"Les mots de passe ne correspondent pas.\";\n }\n\n else\n {\n $this->user->newPassword($newpassword, $id);\n $msgs[] = \"Le mot de passe a bien été mis à jour.\";\n }\n }\n\n // j'arrive sur la vue en POST mais le champs newpassword ou le champs newpasswordverif n'est pas saisi\n // j'affiche des erreurs insérées dans un tableau.\n else if($_SERVER['REQUEST_METHOD'] === 'POST')\n {\n if(!$newpassword)\n {\n $msgs[] = \"Le nouveau mot de passe n'a pas été saisi correctement.\";\n }\n\n if(!$newpasswordverif)\n {\n $msgs[] = \"La confirmation du nouveau mot de passe n'a pas été saisi correctement.\";\n }\n }\n\n // j'arrive sur la vue en Get\n $this->buildView(array('id' => $id, 'login' => $login, 'msgs' => $msgs));\n\n }",
"public function userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}",
"public function usuario() {\n return $_SESSION['usuario'];\n }",
"function pdp_user_control($pseudo){\n \t$re = new DbManager();\n \t$info = $re -> pdp_user($pseudo);\n \treturn $info ;\n }",
"public function getUserState(){\n return($this->userState);\n }",
"function isUser(){\n\t\tif(isset($_SESSION['type']) && $_SESSION['type']=='user')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function agregarUsuario(){\n \n }",
"public function is_inspector()\n {\n $session = $this->session->userdata('user');\n if($session)\n {\n if($session['role'] == 'INSPECTOR')\n {\n if(date('H') > 7 AND date('H') < 14)\n {\n $access = FALSE;\n }\n else\n {\n $access = TRUE;\n }\n\n $session['timeAccess'] = $access;\n $this->session->set_userdata($session);\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n return FALSE;\n $this->log_out();\n }\n }",
"public function _checkAndGetUserActive()\n {\n return $this->find('id_user,name,lastname,email,salt,password', [\n 'username' => $this->username,\n 'sw_active' => 1\n ]);\n }",
"function _read_user_session_ss()\n {\n\t\t$ret = false;\n\t\t\n\t\treturn $ret;\n\t}",
"public function processUser(){\n \n $this->setCurrentUser();\n $this->setUsersAttributes();\n }",
"public function checkUsersSession(){\n\t}",
"public function getUsuarioValidado()\n\t{\n\t\treturn $this->usuario_validado;\n\t}",
"function loggedin() {return $this->login_state!=0;}",
"function mcomprobarUsuarioSesion() {\n\t\t$conexion = conexionbasedatos();\n\t\tif (isset($_SESSION[\"nickname\"]) ) {\n\t\t\t$nickname = $_SESSION[\"nickname\"];\n\n\t\t\t$consulta = \"select * \n\t\t\t\t\t\t from final_USUARIO\n\t\t\t\t\t\t where nickname = '$nickname';\";\n\n\t\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\t\tif ($datos = $resultado->fetch_assoc()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -2;\n\t\t}\n\t\t\n\t}",
"function user_logged_in($user_id) {\n \n }",
"function inativaUsuario($id){\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\n\t\t\t\t\"UPDATE Usuario\n\t\t\t\t\tSET usuario_ativo = FALSE\n\t\t\t\t\tWHERE usuario_id = :id AND usuario_ativo = TRUE\n\t\t\t\t\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $statm->execute();\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}",
"public function m_Euser(){\n\t\tif ($this -> e_user !== '') {\n\t\t\techo $this -> E_inicio.$this -> e_user.$this -> E_fin;\n\t\t}\n\t}",
"protected function isUserLoggedIn() {}",
"protected function isUserLoggedIn() {}",
"function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}",
"public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}",
"public function actualizarInfoUsuario(){\n \n if(isset($_PUT[\"editFname\"])){\n \n $datos = array(\n \"id\" => $_PUT[\"\"],\n \"Fname\" => $_PUT[\"\"],\n \"Lname\" => $_PUT[\"\"],\n \"Pass\" => $_PUT[\"\"],\n \"Area\" => $_PUT[\"\"],\n );\n\n $actualizar = UsersModel::actualizarInfoUsuario($datos, \"usuario\");\n\n if($actualizar){\n header(\"location: \".URL_PAGE.\"viewUser/\".$_PUT[\"\"]);\n }; \n \n\n }\n\n }",
"public function loggedin_face (){\n\t\treturn (bool) $this->session->userdata('user_profile[\"id\"]');\n\t\t}",
"function activar_usuario ($id_colaborador) {\n\t\n\t$UpdateRecords = \"UPDATE colaboradores \n\t\tSET estado='1' WHERE id_colaborador='$id_colaborador'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords);\n\t\tmysql_close($connection);\n\t\n\t}",
"public function simulateUser() {}",
"function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}",
"private function ifoCadUser()\n {\n $infoCadUser = new AdmsRead();\n $infoCadUser->fullRead(\"SELECT env_email_conf, adms_niveis_acesso_id, adms_sits_usuario_id FROM adms_cads_usuarios WHERE id =:id LIMIT :limit\", \"id=1&limit=1\");\n $this->IfoCadUser = $infoCadUser->getResultado();\n\n }",
"function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}",
"public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }",
"function ft_hook_loginsuccess() {}",
"protected function antes() {\n\t // $accion = str_replace(\"accion_\", '', $this->accion);\n\t\t\t// \n\t // $this->permiso = \\FMT\\Usuarios::getPermiso($_SESSION['iu'])['permiso'];\n // $this->id_puerto = \\FMT\\Usuarios::getMetadata($_SESSION['iu'])['metadata'];\n\t // $permisos_sistema = json_decode(PERMISOS);\n\t // if(isset($permisos_sistema->$control->$accion) && in_array($this->permiso, $permisos_sistema->$control->$accion)) {\n\t // return true;\n\t // } else {\n\t // $control = new \\App\\Controlador\\Error('na');\n\t // $control->procesar();\n\t // $datos = [];\n\t // $datos['session_data'] = $_SESSION['datos_usuario_logueado'];\n\t // \\FMT\\Logger::event('no_autorizado',$datos);\n\t // exit;\n\t\t\t// \n\t // }\n\t return true; \n\t}"
] | [
"0.6455207",
"0.63300776",
"0.63046795",
"0.6186323",
"0.61799073",
"0.6153554",
"0.61444426",
"0.61425465",
"0.60665756",
"0.6041984",
"0.60292757",
"0.6024787",
"0.6024632",
"0.600542",
"0.5988096",
"0.5979015",
"0.59667397",
"0.59580386",
"0.5947786",
"0.59324056",
"0.59206814",
"0.5918115",
"0.5912387",
"0.59093326",
"0.5895126",
"0.58912605",
"0.5858985",
"0.5857118",
"0.58480126",
"0.5839348",
"0.5838828",
"0.5834768",
"0.58187747",
"0.5817798",
"0.5812814",
"0.5812814",
"0.5812814",
"0.5812814",
"0.5812814",
"0.5812814",
"0.5812814",
"0.5812814",
"0.5807124",
"0.57997775",
"0.57943374",
"0.57927465",
"0.578877",
"0.57818544",
"0.5781705",
"0.57677686",
"0.57677686",
"0.57677686",
"0.57677686",
"0.57677686",
"0.57677686",
"0.57677686",
"0.5767669",
"0.5761874",
"0.57507205",
"0.5743621",
"0.5741713",
"0.573216",
"0.5728293",
"0.57219887",
"0.5716892",
"0.56968397",
"0.5693959",
"0.5689901",
"0.56888443",
"0.56869745",
"0.56856316",
"0.5684833",
"0.5676471",
"0.56763774",
"0.5675256",
"0.567354",
"0.5663387",
"0.56632066",
"0.5659359",
"0.56493837",
"0.5645561",
"0.5643802",
"0.564025",
"0.56370497",
"0.56359154",
"0.56318945",
"0.5631327",
"0.56289065",
"0.56289065",
"0.5627342",
"0.56262845",
"0.5622367",
"0.56200296",
"0.5614944",
"0.56090075",
"0.56060207",
"0.5605474",
"0.5601962",
"0.5600805",
"0.56001526",
"0.5599459"
] | 0.0 | -1 |
metodo para eliminar usuario | public function eliminarUsuario(){
$sql ="DELETE FROM usuarios WHERE IdUsuario = '{$this->idUsuario}';";
$res = $this->conexion->setQuery($sql);
return $res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }",
"public function eliminarUsuario()\n {\n $bd = new Bd($this->tabla);\n $sql = \"DELETE FROM usuarios WHERE id=\" . $_GET['id'];\n\n $resultado = $bd->consulta($sql);\n if ($resultado == true) {\n header('location: gestionUsuarios.php');\n }\n }",
"public function eliminarUsuario() {\n $this->db->delete('usuarios', array('usuario' => $this->input->post(\"usuario\"))); \n return \"true\";\n }",
"function eliminarUser($id) {\n $sql = \"DELETE FROM usuario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }",
"public function delete($usuario_has_hojaruta);",
"static public function ctrBorrarUsuario(){\n\t\tif (isset($_POST['idUsuario'])) {\n\t\t\tif ($_POST['fotoUsuario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUsuario\"]);\n\t\t\t\trmdir('Views/img/usuarios/'.$_POST['usuario']);\n\t\t\t}\n\t\t$answer=adminph\\User::find($_POST['idUsuario']);\n\t\t$answer->delete();\n\t\t}\n\t}",
"public function deleteUser()\n {\n \n $headers = getallheaders();\n $token = $headers['Authorization'];\n $key = $this->key;\n $userData = JWT::decode($token, $key, array('HS256'));\n $id_user = Users::where('email', $userData->email)->first()->id;\n $id_users = $_POST['idUser'];\n $id = $id_users;\n\n $user = Users::find($id);\n\n $rolUser = Users::where('email', $userData->email)->first();\n \n\n if ($rolUser->rol_id == 1){\n\n $user_name = Users::where('id', $id_users)->first()->name;\n Users::destroy($id);\n\n return $this->success('Acabas de borrar a', $user_name);\n\n }else{\n return $this->error(403, 'No tienes permisos');\n }\n \n\n if (is_null($user)) \n {\n return $this->error(400, 'El lugar no existe');\n }\n // }else{\n\n // $user_name = Users::where('id', $id_users)->first()->name;\n // Users::destroy($id);\n\n // return $this->success('Carlos he borrado el usuario', $user_name);\n // }\n }",
"public function eliminar($id){\r\n //se eliminan todos los datos de este usuario de la tabla asignación\r\n return $this->db->delete('user', array('id' => $id));\r\n }",
"public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}",
"public function eliminarUsuario()\r\n {\r\n if(isset($_REQUEST['id'])){\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n $result = $userController->deleteUser($_REQUEST['id']);\r\n \r\n /**\r\n * Variable de sesión usada para mostrar la notificación del\r\n * resultado de la solicitud.\r\n */\r\n $_SESSION['result'] = $result;\r\n }\r\n\r\n header('Location: ?c=Registro&a=usuarios');\r\n\r\n }",
"function eliminar(){\n global $conexion, $data;\n $id = $data[\"id\"];\n $eliminado = $data[\"eliminado\"];\n $resultado = mysqli_query($conexion,\"UPDATE usuario SET usu_eliminado='$eliminado' WHERE usu_id='$id'\");\n echo validarError($conexion, true, $resultado);\n }",
"public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }",
"function deleteUsuario($username){\r\n\r\n\t\t$sql = \"DELETE FROM \" . $this->_tablename . \" WHERE usuario = '\" . $username . \"'\";\r\n\r\n\t\t$rs = $this->_db->leer($sql);\r\n\t}",
"function borrar(){\n $id=$_POST[\"id\"];\n $consulta=\"DELETE FROM usuarios WHERE id = \".$id.\"\";\n echo $consulta. \"<br>\";\n \n\n $resultado = $conector->query($consulta);\n mostrarListado();\n }",
"public function delete_user($user);",
"public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non può essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }",
"public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }",
"public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}",
"public function delete(){\n\t\t$sql = new Sql();\n\t\t$sql->query(\"DELETE FROM TB_USUARIOS WHERE idusuario=:ID\", array(\n\t\t\t':ID'=>$this->getIdusuario()\n\t\t));\n\n\t\t$this->setIdusuario(null);\n\t\t$this->setDeslogin(null);\n\t\t$this->setDessenha(null);\n\t\t$this->setDtcadastro(new DateTime());\n\t}",
"public function deleteUser()\n {\n $this->delete();\n }",
"function user_remove($user_info)\n {\n }",
"public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}",
"function eliminarDiaryUser($id) {\n $sql = \"DELETE FROM diario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }",
"public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }",
"public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }",
"function eliminarPer(){\n require \"app/Views/eliminarP.php\";\n $usuario = new Usuario();\n //Mandar datps\n $usuario->id=$_POST['id'];\n $usuario->contrasenia=$_POST['password'];\n $usuario->eliminar();\n if(isset($_SESSION['Usuarios']))\n unset($_SESSION['Usuarios']);\n $_SESSION['Usuarios']=false;\n\n header(\"Location:/Proyecto/index.php?controller=Usuario&action=star\");\n }",
"public function delete(){\n\t\t\t$sql = new sql();\n\n\t\t\t$sql->query(\"DELETE FROM tb_usuarios WHERE idusuario= :ID\", array(\n\t\t\t\t\":ID\"=>$this->getIdusuario()\n\t\t\t));\n\n\t\t\t$this->setIdusuario(0);\n\t\t\t$this->setDeslogim(\"\");\n\t\t\t$this->setDessenha(\"\");\n\t\t\t$this->setDtcadastro(new DateTime());\n\t\t}",
"public function EliminarUsuarios()\n{\n\n\t$sql = \" select codigo from ventas where codigo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codigo\"])) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\n\t\t$sql = \" delete from usuarios where codigo = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codigo);\n\t\t$codigo = base64_decode($_GET[\"codigo\"]);\n\t\t$stmt->execute();\n\n\t\theader(\"Location: usuarios?mesage=1\");\n\t\texit;\n\n\t}else {\n\n\t\theader(\"Location: usuarios?mesage=2\");\n\t\texit;\n\t}\n\n}",
"public function eliminarUsuarioAction($id){\n\t\t//Conectar con la base de datos.\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usuario = $em->getRepository('TheClickCmsAdminBundle:Usuarios')->find($id);\n\t\t$em->remove($usuario);\n\t\t$em->flush();\n\t\treturn new Response('Usuario Eliminado');\n\t}",
"static function ctrBorrarUsuario()\n\t{\n\n\t\tif(isset($_GET['idUsuario']))\n\t\t{\n\t\t\t$tabla = \"usuarios\";\n\t\t\t$datos = $_GET['idUsuario'];\n\n\t\t\t// vamos a eliminar la foto\n\t\t\t//si hay una foto entonces eliminamos \n\t\t\tif($_GET['fotoUsuario'] != \"\")\n\t\t\t{\n\t\t\t\t// unlink — Borra un fichero\n\t\t\t\t// vamos a borrar ese archivo o imagen en esa carpeta\n\t\t\t\t// unlink($_POST['fotoUsuario']);\n\t\t\t\tunlink($_GET['fotoUsuario']);\n\n\t\t\t\t//rmdir borra directorio\n\t\t\t\trmdir('vistas/img/usuarios/'.$_GET[\"usuario\"]);\n\t\t\t}\n\n\t\t\t// solicitamos una repuesta al modelo de usuario en el metodo mdlBorrarUsuario\n\t\t\t$respuesta = ModeloUsuarios::mdlBorrarUsuario($tabla,$datos);\n\n\t\t\tif($respuesta)\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se elimino correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>';\n\t\t\t}\n\t\t}\n\t}",
"public function EliminarRegistro()\n\t{\n\t\t$usuario = UsuarioFacebook::ObtenerUsuarioActivo();\n\t\tif(!$usuario->EsSuperUsuario)\n\t\tthrow new Exception('No eres súper usuario, así que no puedes eliminar a otros usuarios');\n\t\tif($usuario->IdFacebook == $this->IdFacebook)\n\t\tthrow new Exception('No puedes auto-eliminarte');\n\t\t/*\n\t\t * NOTA: Las claves foráneas que no se eliminan son obligatorias\n\t\t * para los datos del club. Si alguna clave restringe la eliminación del usuario,\n\t\t * entonces será imposible realizar dicha acción.\n\t\t * Para esto puede usar la suspensión dle usuario.\n\t\t */\n\t\t$conexionBd = new ConectorBaseDatos();\n\t\t$idFacebook = $conexionBd->Escapar($this->IdFacebook);\n\t\t$conexionBd->IniciarTransaccion();\n\t\t// Eliminar ítems vendidos\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM Venta WHERE IdUsuario = %s\", $idFacebook));\n\t\t// Eliminar álbumes\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM LaminaAlbum WHERE Album IN (SELECT Id FROM Album WHERE IdUsuario = %s)\", $idFacebook));\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM Album WHERE IdUsuario = %s\", $idFacebook));\n\t\t// Eliminar historial de puntos\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM Puntos WHERE IdUsuario = %s\", $idFacebook));\n\t\t// Eliminar membresía de grupos\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM UsuarioGrupo WHERE Usuario = %s\", $idFacebook));\n\t\t// Eliminar cambio de nivel\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM CambioNivel WHERE IdUsuario = %s\", $idFacebook));\n\t\t// Eliminar permisos concedidos\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM PermisoUsuario WHERE Usuario = %s\", $idFacebook));\n\t\t// Eliminar asistencias\n\t\t$conexionBd->EjecutarComando(sprintf(\"DELETE FROM Asistencia WHERE IdUsuario = %s\", $idFacebook));\n\t\t// Heredar los usuarios validados por el próximo a eliminarse\n\t\t$conexionBd->Sentencia = sprintf(\"UPDATE UsuarioFacebook SET ValidadoPor = %s WHERE ValidadoPor = %s\",\n\t\t$conexionBd->Escapar($usuario->IdFacebook),\n\t\t$idFacebook\n\t\t);\n\t\t$conexionBd->EjecutarComando();\n\t\t// Eliminarlo.\n\t\t$conexionBd->EjecutarComando();\n\t\t$conexionBd->Sentencia = sprintf(\"DELETE FROM UsuarioFacebook WHERE IdFacebook = %s\",\n\t\t$idFacebook\n\t\t);\n\t\t$conexionBd->EjecutarComando();\n\t\t$conexionBd->ConfirmarTransaccion();\n\t\t$conexionBd->Desconectar();\n\t}",
"function deletaUsuario($usuario) {\n $conn = new Conexao();\n $conector = $conn->abreConexao();\n\n // SQL\n $sql = \"DELETE FROM usuario WHERE \"\n . \"login = '\".$usuario->getLogin().\"'\";\n\n $sqlRun = mysqli_query($conector, $sql);\n $conector = $conn->fechaConexao($conector);\n return true;\n }",
"public static function Eliminar($idUsuario)\n\t\t{\n\t\t\t$bd = BD::Instancia();\n\t\t\t$consulta = \"\";\n\t\t\t$res = new Comunicacion();\n\t\n\t\t\tif($idUsuario == '')\n\t\t\t{\t\n\t\t\t\t$res->exito = false;\n\t\t\t\t$res->mensaje = t(\"Error deleting user\");\n\t\t\t\t$res->errores = t(\"User not defined\");\n\t\t\t\treturn $res;\n\t\t\t}\n\t\n\t\t\t// si se elimina un administrador hay que asegurarse de que no es el único, sino nadie más podría administrar\n\t\t\t$consulta = \"SELECT COUNT(*) FROM usuario WHERE usuario_id!= '\". $idUsuario .\"' AND usuario_rol_id = '1' \";\n\t\n\t\t\t$numFilas = $bd->ContarFilas($consulta); \n\t\t\tif ( $numFilas == 0 )\n\t\t\t{\n\t\t\t\t$res->exito = false;\n\t\t\t\t$res->mensaje = t(\"Error deleting user\");\n\t\t\t\t$res->errores = t(\"This is the only administrator account. You can't delete it\");\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$consulta = \"DELETE FROM usuario WHERE usuario_id='\". $idUsuario .\"'\";\n\t\t\t$bd->Ejecutar($consulta);\n\t\t\t\n\t\t\t// los registros que eran propiedad de este usuario ahora pasan a ser del administrador\n\t\t\t$bd->Ejecutar(\"UPDATE profesional SET profesional_usuario_id='1' WHERE profesional_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE documento SET documento_usuario_id='1' WHERE documento_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE obra SET obra_usuario_id='1' WHERE obra_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE bibliografia SET bibliografia_usuario_id='1' WHERE bibliografia_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE intervencion SET intervencion_usuario_id='1' WHERE intervencion_usuario_id='\".$idUsuario.\"' \");\n\t\t\t\n\t\t\t// si todo ha ido bien construimos la respuesta JSON y la devolvemos\n\t\t\tif( $bd->ObtenerErrores() == \"\" )\n\t\t\t{\t\t\t\t\n\t\t\t\t$res->exito = true;\n\t\t\t\t$res->mensaje = t(\"User deleted successfully\");\n\t\t\t\t$res->errores = \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$res->exito = false;\n\t\t\t\t$res->mensaje = t(\"Error deleting user\");\n\t\t\t\t$res->errores = $bd->ObtenerErrores();\n\t\t\t}\n\t\t\treturn $res;\n\t\t}",
"public function eliminar($id){\n \n $this->validarToken();\n\n $datosUsuario = User::find($id);\n if($datosUsuario){\n $datosUsuario->delete();\n return ['status' => true];\n }\n \n return ['status' => false];\n}",
"public function eliminarAction()\n {\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n $idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n\n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n try {\n $resultado = $this->_modeloMovimiento->eliminar($id, $this->_usuario);\n \n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n \n \n } catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }",
"function eliminarpermiso()\n {\n $oconexion = new conectar();\n //se establece conexión con la base de datos\n $conexion = $oconexion->conexion();\n //consulta para eliminar el registro\n $sql = \"UPDATE permiso SET eliminado=1 WHERE id_permiso=$this->id_permiso\";\n // $sql=\"DELETE FROM estudiante WHERE id=$this->id\";\n //se ejecuta la consulta\n $result = mysqli_query($conexion, $sql);\n return $result;\n }",
"public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }",
"function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}",
"public static function remove() {\n if ($u = static::check_record_existence()) {\n if ($u->remove())\n flash('Usuário deletado com sucesso.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }",
"public function destroy(User $usuario)\n {\n \\DB::table('bitacora')->insert(\n [\n 'id_user' => Auth::user()->id,\n 'ip' => request()->ip(),\n 'log' => \"Se ha eliminado el usuario: \".ucwords(strtolower($usuario->name)),\n 'fecha' => date(\"Y-m-d\")\n ]\n );\n $usuario->delete();\n Session::flash('message','Usuario Eliminado correctamente');\n return redirect()-> route('usuario.index');\n }",
"function eliminarClientes($idCliente){\n\t\t\t\t\n\t\t\t//SQL\n\t\t\t$query = \"DELETE FROM users WHERE id = $idCliente;\";\n\t\t\t$rst = $this->db->enviarQuery($query,'CUD');\n\t\t\treturn $rst;\n\t\t}",
"public function eliminarUsuario($id){\n\t\t\t\n\t\t\tif(!$this->filtrarInt($id)){/**Comprobamos que nos pasan un id desde la vista*/\n \t$this->redireccionar('administrador');/**Si no lo pasan, nos devuelve a la pantalla administrador*/\n \t}\n\t\t\t\t\t\t\n\t\t\t $this->_administrador->eliminarUsuario(/**Si nos pasan el id desde la vista, llamamos a la funcion del modelo para eliminar el usuario*/\n \n\t\t\t\t\t$this->filtrarInt($id)/** Con esta linia le pasamos a la funcion el id del usuario que se borrara*/\n\t\t\t);\n\t\t\t\n\t\t\t$this->redireccionar('administrador');/**Cuando se haya borrado, nos devolvera a la vista del administrador*/\n\t\t\n\t\t}",
"public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }",
"function eliminarUsuario($params = null)\n {\n $this->helper->checkLoggedIn();\n //compruebo permisos\n $this->helper->checkAdmin();\n $usuario_id = $params[':ID'];\n $this->model->removeUsuario($usuario_id);\n header(\"Location: \" . ADMIN);\n }",
"function eliminarUoFuncionario(){\r\n\t\t$this->objFunSeguridad=$this->create('MODUoFuncionario');\t\r\n\t\t$this->res=$this->objFunSeguridad->eliminarUoFuncionario($this->objParam);\r\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\r\n\t}",
"public function delUser($id_usuario){\n $sql = new Sql();\n $remUse = $sql->query('DELETE FROM usuarios WHERE id_usuario = :id_usuario', array(':id_usuario'=>$id_usuario));\n if(!is_array($remUse)){\n return true;\n }else{\n return false;\n }\n }",
"function eraseUserById($var)\n {\n $bdd = connexMedoo();\n $bdd->delete(\"utilisateurs\", [\n 'id' => $var\n ]);\n }",
"public function DeleteAdmin(){\n $val = new User();\n if ($val->CheckAdminUser() == false){\n header(\"location:/login\");\n }\n\n if (isset($_GET[\"param\"]) == false) {\n //Si il n'y a pas le paramètre ID_USER, on redirige vers la liste des utilisateurs\n header(\"location:/admin/list\");\n exit();\n } else {\n $param = (isset($_GET[\"param\"])) ? $_GET[\"param\"] : \"\";\n\n $val = new User();\n $val->setUserID($param);\n $result = $val->SQLGetOne(BDD::getInstance());\n\n if ((isset($_GET[\"param\"])) && (isset($_POST[\"ID_User\"]))){\n try {\n $response = $val->SQLDeleteUser(BDD::getInstance());\n\n if ($response[0]) {\n header(\"location:/admin/list\");\n } else {\n echo \"Une erreur c'est produite : ${response[1]}\";\n }\n } catch(\\Exception $e) {\n echo $e->getMessage();\n }\n } else if(isset($_GET[\"param\"])) {\n if (($result[0] == false) || $result[1] == \"No_Data\") {\n header(\"location:/admin/list\");\n\n } else {\n //On vérifie que le l'ID est différent de celui de la session\n if ($param == $_SESSION[\"ID_USER\"]){\n echo \"<h1><div class='msgerror'>Impossible de supprimer le compte, vous êtes connecté à ce compte ! <a href='/admin/list'>Cliquez ici pour retourner à la liste</a></div></h1>\";\n } else {\n\n echo $this->twig->render(\"UserAdmin/DeleteUser.html.twig\", [\n \"Pseudo\" => $result[1][\"PSEUDO\"],\n \"ID_User\" => $result[1][\"ID_USER\"],\n \"IsOnline\" => isset($_SESSION[\"Pseudo\"])\n ]);\n }\n }\n }\n }\n\n }",
"public function delete($id_user){\n\t\t\t \n\t\t\t$this -> query = \"DELETE FROM usuari WHERE id='$id_user'\";\n\t\t\t$this -> executa_query();\n\t\t}",
"public static function eliminarUsuario($usuario) {\n $query = \"DELETE FROM rol_usuario WHERE usuario_usuario=?\"; //Estos parametros seran sustituidos mas adelante por valores.\n $stmt = conexion::$conexion->prepare($query);\n\n $stmt->bind_param(\"s\", $usuario);\n\n /* Ejecución de la sentencia. */\n $stmt->execute();\n\n //Borramos el usuario de la tabla usuarios\n $query = \"delete from usuario where usuario=?\"; //Estos parametros seran sustituidos mas adelante por valores.\n $stmt = conexion::$conexion->prepare($query);\n\n $stmt->bind_param(\"s\", $usuario);\n\n /* Ejecución de la sentencia. */\n $stmt->execute();\n }",
"public function eliminar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToDelete' => trim($_POST['especialidadToDelete'])\n ];\n \n // Validar carga de especialidadToDelete\n if(empty($data['especialidadToDelete'])){\n $data['especialidadToDelete_error'] = 'No se ha seleccionado la especialidad a eliminar';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToDelete_error'])){\n // Crear especialidad\n if($this->especialidadModel->eliminarEspecialidad($data['especialidadToDelete'])){\n flash('especialidad_success', 'Especialidad eliminada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToDelete_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }",
"function deleteUser()\n {\n $validateF = new ValidateFunctions();\n if ($_SESSION['id'] == $_GET['']) {\n logUserOut();\n }\n $id = $validateF->sanitize($_GET['id']);\n $userRp = new UserRepository();;\n $hasUser = $userRp->getOneFromDB($id);\n if ($hasUser != 0) {\n $this->deleteUserImage($id);\n $this->removeUser($id);\n $_SESSION['success'] = ['User deleted successfully'];\n } else {\n $_SESSION['error'] = ['No user found.'];\n }\n header('Location:index.php?action=adminUsers');\n }",
"function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}",
"static public function delete(){\n\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/DeleteRequest.php');\n\n\t\t$requests = new DeleteRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\tif(count($errors) > 0){\n\n\t\t\t//Verifica se id não existe no banco ou deixar enviar, força o redirecionamento para pagina /users\n\t\t\tif( isset($errors['id']) ){\n\n\t\t\t\t$back = '/users?errors=' . json_encode(['id' => $errors['id']]);\n\n\t\t\t}else{\n\n\t\t\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users';\n\t\t\t\t$back .= '?id='.$_POST['id'].'&errors=' . json_encode($errors);\n\n\t\t\t}\n\n\t\t\theader('Location: ' . $back);\n\n\t\t}else{\n\n\t\t\t//Caso não houver nenhum impedimento, faz o delete do usuario\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\t$crud->delete($_POST['id']);\n\n\t\t\t//Redireciona para pagina de /users\n\t\t\theader('Location: /users?success=Usuário deletado com sucesso');\n\t\t\t\n\t\t}\n\n\t}",
"public function destroy($usuario_id)\n {\n }",
"function eliminar_empresa($empresa_id) {\n\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t//La empresa owner no se puede eliminar\n\t\t$this -> db -> where('owner', 0);\n\t\t$data['activated'] = 0;\n\n\t\t//Audit field\n\t\t$data['user'] = $this->auth_frr->is_logged_in();\n\n\t\tif ($this -> db -> update('empresas', $data)) {\n\t\t\t//Eliminamos los usuarios que hayan pertenecido a esa empresa\n\t\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t\tif ($this -> db -> update('users', $data))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t} else\n\t\t\treturn false;\n\t}",
"public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }",
"public function eliminarUsuario($id){\n DB::table('usuarios')->where('id', '=', $id)->delete();\n return redirect('/Session/PanelControl')->with('status_exito', \"Éxito, elimino el usuario.\");\n }",
"public static function eliminar_usuario($id){\n\t\techo \"En delete\";\n\t\t\n\t\t$query = \"DELETE FROM usuarios WHERE id=:id LIMIT 1\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->bindParam(\":id\", $id);\n\t\t$resultado->execute();\n\n\t\tif ($resultado->execute()) {\n\t\t\treturn true;\n\t\t}\n \n\t\treturn false;\n\n\t}",
"function eliminarUsuario($idUsuario){\n\t\t$this->actualizarPerfilesUsuario(array(),$idUsuario);\n\t\treturn $this->delete($idUsuario);\n\n\t\t/*$sql=\"UPDATE \".$this->tabla.\" set id_estado=2 where id_usuario=\".$idUsuario;\n\t\t$query=$this->oDBM->query($sql);\n\t\treturn $this->oDBM->affected_rows();*/\n\t}",
"public function postEliminar(){\n\t\t$id_persona = Input::get('id');\n\t\t\n\t\tif(!Persona::where('idPersona', '=', $id_persona)->count()){\n\t\t\treturn 'Error';\n\t\t}\n\n\t\tif(!Persona::where('idPersona', '=', Session::get('id_persona'))->count()){\n\t\t\treturn \"Error.\";\n\t\t}\n\n\t\t$persona = Persona::find($id_persona);\n\t\t$persona->estado = 0;\n\t\t$persona->save();\n\t\treturn 'Usuario eliminado correctamente.';\n\n\t}",
"public function deleteUser($idUser){\n $query = \"DELETE FROM final_usuario WHERE idUser=\".$idUser;\n return $this->con->action($query);\n }",
"public function destroy(){\n \n //comprueba que llega el formulario de confirmación\n if(empty($_POST['borrar']))\n throw new Exception(\"No se recibió confirmación\");\n \n //recupera el identificador via POST\n $id= intval($_POST['id']);\n \n //intenta borrar el usuario de la BDD\n if(Usuario::borrar($id)===false)\n throw new Exception('No se pudo borrar');\n \n //muestra la vista de éxito\n $mensaje= \"Borrado del usuario $id correcto.\";\n include 'views/exito.php';\n }",
"public function eliminarderivoAction()\n {\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n $idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n\n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n try {\n $resultado = $this->_modeloDerivotemporal->eliminar($id, $this->_usuario);\n\t\t\t\t\t\n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n\t\t\t\t\n\t\t} catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }",
"public function eliminar_usuario($id_usuario)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Searching if user exists in DB\n\n\t\t\t$sql_search = \"SELECT id_usuario FROM usuarios\n\t\t\t\t\t\t WHERE id_usuario = :id_usuario\";\n\n\t\t\t$resultado_search = $this->db->prepare($sql_search);\n\t\t\t$resultado_search->bindValue(\":id_usuario\", $id_usuario);\n\n\t\t\t// failed query\n\t\t\tif(!$resultado_search->execute())\n\t\t\t{\n\t\t\t\theader(\"Location:index.php?usuarios&m=1\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t// User has been found in the DB\n\t\t\t\tif($resultado_search->rowCount() > 0)\n\t\t\t\t{\n\t\t\t\t\t// we are gonna delete the user by id\n\n\t\t\t\t\t$sql_delete = \"DELETE FROM usuarios \n\t\t\t\t\t\t\t\t WHERE id_usuario = :id_usuario\";\n\n\t\t\t\t\t$resultado_delete = $this->db->prepare($sql_delete);\n\t\t\t\t\t$resultado_delete->bindValue(\":id_usuario\", $id_usuario);\n\n\t\t\t\t\t// failed query\n\t\t\t\t\tif(!$resultado_delete->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\theader(\"Location:index.php?usuarios&m=1\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($resultado_delete->rowCount() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// User has been deleted successfully\n\t\t\t\t\t\t\theader(\"Location:index.php?usuarios&m=3\");\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// User has not been deleted\n\t\t\t\t\t\t\theader(\"Location:index.php?usuarios&m=4\");\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// if user has not been found in DB\n\t\t\t\t\theader(\"Location:index.php?usuarios&m=5\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}",
"static function removeUser() : string\n {\n return \"DELETE\n FROM users\n WHERE id = :id;\";\n }",
"public function remove_user() { return $this->STOR->remove_user(); }",
"function DELETE()\n{\n\t$comprobar = $this->comprobar_login(); //Busca si la tupla es correcta o tiene algun error\n\n\tif($comprobar == true)\n\t{\t\n\t $sql = \"\tDELETE FROM \n\t \t\t\t\tUSUARIOS\n\t \t\t\tWHERE(\n\t \t\t\t\tlogin = '$this->login'\n\t \t\t\t)\n\t \t\t\t\";\n\n\t \tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Borrado realizado con éxito';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\treturn $resultado;\n\t}else\n\t{\n\t\treturn $comprobar;\n\t}\n}",
"public function eliminar()\n\t{\n\t\textract($_REQUEST);\n\t\t$db=new clasedb;\n\t\t$conex=$db->conectar();\n\t\t$sql=\"DELETE FROM asistencias WHERE id=\".$id_asistencias;\n\t\t\n\t$res=mysqli_query($conex,$sql);\n\t\tif ($res) {\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Registro eliminado\");\n\t\t\t\t\twindow.location=\"ControlA.php?operacion=index\";\n\t\t\t\t</script>\n\t\t\t<?php\n\t\t} else {\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Registro no pudo ser eliminado, Vuelva a intentarlo!\");\n\t\t\t\t\twindow.location=\"ControlA.php?operacion=index\";\n\t\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}",
"function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }",
"function borrarUsuari($id){\n $conn=connexioBD();\n $sql=\"DELETE FROM usuaris WHERE id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n $conn->close();\n}",
"public function destroy(){\n $query = 'delete from Usuario where\n user_id = \"'.$this->getUser_id().'\"';\n $this->driver->exec($query);\n }",
"function delete_usuario($user_id)\n {\n return $this->db->delete('usuarios',array('user_id'=>$user_id));\n }",
"function eliminar_autonomo()\n\t{\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$this->eliminar();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t\t$this->manejador_interface->mensaje(\"El proyecto '{$this->identificador}' ha sido eliminado\");\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\t$this->manejador_interface->error( \"Ha ocurrido un error durante la eliminacion de TABLAS de la instancia:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t$e->getMessage() );\n\t\t}\n\t}",
"public function eliminar()\n\t{\n\t\t// Toma el id del rol actual\n\t\t$id = $this->id;\n\n\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Elimina al rol de la bd encontrado por id\n\t\tif($conexion->conn->query(\"DELETE FROM \". static::$tablaConsulta . \" WHERE id = $id LIMIT 1\")) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function deleteUser($email,$telefon=''){\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n if (isAdmin($_SESSION[\"jog\"])) {\n try{\n if ($this->userModel->deleteUserByAdmin($telefon) && $this->userModel->deleteUserByAdmin0($email) && $this->userModel->deleteFromUserCartItems($email)) { \n flash('deleted','A '.$email.' felhasználó törlése sikeres volt!','alert alert-success');\n redirect('admins/userHandler');\n }else{\n flash('deleted','A '.$email.' felhasználó törlése sikertelen volt sajnos!','alert alert-danger');\n redirect('admins/userHandler');\n }\n }catch(PDOException $ex){\n flash('deleted',$ex->getMessage(),'alert alert-danger');\n redirect('admins/userHandler');\n }finally{\n flash('deleted', 'Egyéb hiba történt');\n redirect('admins/userHandler');\n }\n }else{\n redirect('index');\n }\n }\n }",
"static public function ctrBorrarUsuario(){\n \t\t\t\n \t\t\tif(isset($_GET['idUsuario'])){\n\n \t\t\t\t$tabla = \"usuarios\";\n \t\t\t\t$item = \"codusuario\";\n \t\t\t\t$valor = $_GET[\"idUsuario\"];\n\n/*\n\t\t\t\tif($_GET[\"fotoUsuario\"] != \"\" ){\n\t\t\t\t\tunlink($_GET[\"fotoUsuario\"]);\n\t\t\t\t\trmdir('vistas/img/usuarios/'.$_GET[\"usuario\"]);\n\t\t\t\t} */\n\t\t\t//\techo '<script>console.log('.$valor.') </script>';\n\n\n\n \t\t\t\t$respuesta = ModeloUsuarios::mdlEliminarUsuario($tabla, $item , $valor);\n\n \t\t\t\tif($respuesta = \"ok\"){\n\n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡El usuario ha sido borrado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n\n \t\t\t\t}\n\n \t\t\t}\n\n \t\t \n \t\t}",
"function delete_user($ci) {\n\t\t$qDelete = \"DELETE FROM alumno WHERE ci='$ci'\";\t\n\t\treturn \"Alumno Eliminado\";\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($qDelete); \n\t\n\t\treturn mysql_error();\n\t\t\n\t}",
"function supprimer($userID)\n{\n require('_connexionbdd.php');\n\n if ($userID != null) {\n $bdd = my_pdo_connexxionWeCon();\n $req = $bdd->prepare(\"DELETE FROM sousmembres WHERE identifiant = ?\");\n $req -> execute(array($userID));\n }\n}",
"public function removeUser()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_user]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_user]);\n\t\t}\n\t}",
"public function eliminar_empresa_controlador(){\n\n\t\t$codigo=mainModel::decryption($_POST['codigo-del']);\n\t\t$Privilegio=mainModel::decryption($_POST['privilegio-admin']);\n\n\t\t$codigo=mainModel::limpiar_cadena($codigo);\n\t\t$Privilegio=mainModel::limpiar_cadena($Privilegio);\n\n\t\tif($Privilegio==1){\n\n\t\t\t$consulta1=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaCodigo FROM libro WHERE EmpresaCodigo='$codigo'\");\n\n\t\t\t\n\t\t\tif($consulta1->rowCount()<=0){\n\t\t\t\t$ElimEmp=empresaModelo::eliminar_empresa_modelo($codigo);\n\t\t\t\t\n\t\t\t\tif($ElimEmp->rowCount()==1){\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"recargar\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Empresa Eliminada\",\n\t\t\t\t\t\t\t\"Texto\"=>\"Se elimino la empresa de manera satisfactoria\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t\t\t\t];\t\n\t\t\t\t}else{\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"Lo sentimos no se puede eliminar la empresa, \",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t];\n\t\t\t\t}\t\n\t\t\t}else{\n\t\t\t\t$alerta=[\n\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\"Texto\"=>\"No se puede eliminar la empresa, teniendo en cuenta que hay libros asociados a esta empresa\",\n\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t];\n\t\t\t}\n\t\t}else{\n\t\t\t\t$alerta=[\n\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\"Texto\"=>\"No se puede eliminar la empresa.\",\n\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t];\n\t\t}\n\t\treturn mainModel::sweet_alert($alerta);\n\t\t\n\t}",
"public function utilisateurSupprimerUn($id)\n\t{\n\t\tGestion::supprimer(\"Utilisateur\",\"idUtilisateur\",$id);// votre code ici\n\t}",
"function eliminarUsuario($id) {\n\n $conex=Conexion::getInstance();\n $sql = \"delete from usuarios where id = ?\"; //prepared statements\n $query = $conex->dbh-> prepare($sql);\n $result = $query -> execute(array($id)); //prepared statements value\n \n if($result){\n echo \"<script>alert('Eliminado')</script>\";\n }else{\n echo \"<script>alert('error al eliminar')</script>\";\n }\n \n}",
"public function procDeleteUser() {//IF time permits, re-implement using new User classes\r\n global $session;\n\r\n /* uid error checking */\n $field = \"deluser\"; //Use the field for uid\r\n $subuid = $_POST[$field];\r\n\r if($subuid == $session->user->getUID()) { /* Make sure no one tries and delete themselves */\n $session->form->setError($field, \"* You can't delete yourself!<br />\");\n }\n\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Delete user from database */\r\n $session->database->removeUser($subuid, DB_TBL_ADMINS);\r\n $session->database->removeUser($subuid, DB_TBL_TELLERS);\r\n $session->database->removeUser($subuid, DB_TBL_CUSTOMERS);\n }\n header(\"Location: \".$session->referrer);\r\n }",
"public function delete_user() {\n $query = 'DELETE FROM ' . $this->table_name . ' WHERE vendor_id = :vendor_id';\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean data\n\n // Bind data\n $stmt->bindParam(':vendor_id', $this->vendor_id);\n\n // Execute query\n if($stmt->execute()) {\n return true;\n }\n\n //Error $stmt->error;\n return false;\n }",
"function borrarUsuario($parametros) {\n $sql = \"DELETE FROM usuarios WHERE DNI=:dni_usuario\";\n\n //Preparamos la consulta\n $consulta_borrar_usuario = $this->conexionBBDD->prepare($sql,array());\n\n //Ejecutamos la consulta y borramos el usuario\n $consulta_borrar_usuario->execute($parametros);\n }",
"public function actionDelete($id){\r\n\t\t$x = new Admin_User_Model_User();\r\n\t\t$x->setId($id)->delete();\r\n\t\t//$id = $this->getId();\r\n\t\t$mensajes = \r\n\t\t\tCore_App::getInstance()\r\n\t\t\t\t->loadLayoutDom()\r\n\t\t\t\t->getLayout()\r\n\t\t\t\t->getBlock('contenedor_mensajes');\r\n\t\t$eliminada = true;//deleteEnLaBase()\r\n\t\tif($eliminada){\r\n\t\t\tif($mensajes)\r\n\t\t\t\t$mensajes->addSuccessMessage(htmlentities('Usuario eliminado correctamente'));\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif($mensajes)\r\n\t\t\t\t$mensajes->addErrorMessage(htmlentities(\"No se pudo eliminar usuario, error en la operación\"));\r\n\t\t}\r\n\t\treturn($eliminada);\r\n\t}",
"public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}",
"public function removeAction() : object\n {\n if ($_SESSION['permission'] === \"user\") {\n $form = new UserDeleteForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/remove\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Delete account\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }",
"public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}",
"function deleteUser($username)\r\n {\r\n $this->querySimpleExecute('delete from t_user where useUsername = ' . $username);\r\n }",
"function delUser() // Renomeada para n�o ser usada. Antiga delUser() \n{\n\tglobal $xoopsDB, $myts, $xoopsConfig, $xoopsModule;\n\n\t$query = \"SELECT * FROM \". $xoopsDB->prefix('xmail_newsletter') .\" WHERE user_email='\" . $myts->makeTboxData4Save($_POST['user_mail']) . \"' \";\n\t$result = $xoopsDB->query($query);\n\t$myarray = $xoopsDB->fetchArray($result);\n\n\t$mymail = $myts->makeTboxData4Save($_POST['user_mail']);\n\tif ($myarray) {\n\t\tif ($myarray['confirmed'] == '0')\n\t\t\treturn -1;\n\n\t\t$query = \"DELETE from \" . $xoopsDB->prefix('xmail_newsletter') . \" WHERE user_email='$mymail'\";\n\t\t$result = $xoopsDB->queryF($query);\n\t\t\n\t\t// eliminar o perfil\n\t\t$sql=' delete from '.$xoopsDB->prefix('xmail_perfil_news').' where user_id='.$myarray['user_id'];\n\t\t$result2=$xoopsDB->queryf($sql);\n\t\tif(!$result2){\n\t\t\txoops_error('Erro ao eliminar perfil'.$xoopsDB->error());\n\t\t}\n\t\t\t\n\t\t\n\t\treturn 1;\n\t} else {\n\t\treturn -2;\n\t}\n}",
"function deleteUsuario($id)\n{\n\t$con = getDBConnection();\n\t$sql = \"DELETE FROM usuarios WHERE id = :id\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->bindParam(':id', $id);\n\t$stmt->execute();\n}",
"function User_Remove($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\tj::SQL(\"DELETE FROM jfp_xuser WHERE ID=?\",$UserID);\n\t\tj::SQL(\"DELETE FROM jf_users WHERE ID=?\",$UserID);\n\t}",
"function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}",
"public function deleteUser($id){\n$sql = \"DELETE FROM utilisateurs WHERE id = :id\";\n $stmt= $this->pdo->prepare($sql);\n $stmt->execute([\n 'id' => $id\n ]);\n}",
"public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }",
"function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }",
"function delete_user()\n {\n\n //return true if successful\n }",
"public function delete($user){\n }"
] | [
"0.7947555",
"0.7922452",
"0.77157605",
"0.7622332",
"0.75866574",
"0.7546615",
"0.75427824",
"0.7513886",
"0.7512889",
"0.74368805",
"0.7381548",
"0.73614705",
"0.73560697",
"0.73514766",
"0.733505",
"0.7331273",
"0.7317113",
"0.73118526",
"0.73096913",
"0.72904795",
"0.72772515",
"0.7269095",
"0.72642374",
"0.7239967",
"0.72320354",
"0.72195625",
"0.7214006",
"0.7210363",
"0.72073567",
"0.7203935",
"0.7198889",
"0.7190818",
"0.7181324",
"0.7138",
"0.71341074",
"0.71229017",
"0.71100897",
"0.71093506",
"0.7102005",
"0.71009266",
"0.7094733",
"0.709406",
"0.70812297",
"0.70769125",
"0.7071646",
"0.70670605",
"0.70645344",
"0.7062875",
"0.70494485",
"0.7046018",
"0.70361364",
"0.7035014",
"0.70298976",
"0.7029077",
"0.70197344",
"0.7016712",
"0.70146763",
"0.70139056",
"0.7013871",
"0.70035875",
"0.6985507",
"0.69777405",
"0.69715273",
"0.6968157",
"0.6962408",
"0.69591635",
"0.6954054",
"0.6953316",
"0.69513226",
"0.6939395",
"0.69369143",
"0.6936149",
"0.69333035",
"0.6929886",
"0.6920531",
"0.69160485",
"0.6898117",
"0.68952596",
"0.68929446",
"0.6889798",
"0.6886966",
"0.6880066",
"0.6874046",
"0.68724287",
"0.6870033",
"0.685611",
"0.6853583",
"0.6844334",
"0.68388915",
"0.68367636",
"0.68322146",
"0.6829952",
"0.68292624",
"0.68245614",
"0.6821717",
"0.6811006",
"0.6807011",
"0.6797996",
"0.6795906",
"0.6795641"
] | 0.7583335 | 5 |
crear metodo paar retornar los datos del usuario | public function getDatosUsuario(){
$sql = "SELECT *
FROM usuarios WHERE Usuario = '{$this->usuario}' AND Clave='{$this->clave}';";
$data = $this->conexion->getTable($sql);
$row = mysqli_fetch_assoc($data);
return $row;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function datos_usuario(){\n\t\t$data = json_decode(json_encode($_SESSION['USER']),true);\n\n\t\t$result = $this->_db->query(\"\n\t\tSELECT a.roleid FROM \".DB_PRE.\"role_assignments a, \".DB_PRE.\"context b \n\t\tWHERE a.userid = '$data[id]' AND a.contextid = b.id AND b.instanceid =\".ID_CURSO\n\t\t);\n\n\t\t$rol = 0;\n\t\tif (!$result) {\n\t\t\tprintf(\"Errormessage datos_usuario: %s\\n\", $this->_db->error);\n\t\t}else{\n\t $rol_user = $result->fetch_all(MYSQLI_ASSOC);\n\t if(count($rol_user) > 0){\n\t \t$rol = $rol_user['0']['roleid'];\n\t }\n \t}\n\n\t\t$usuario = array(\n\t\t\t\"id\" => $data['id'],\n\t\t\t\"nombre\" => $data['firstname'],\n\t\t\t\"apellido\" => $data['lastname'],\n\t\t\t\"codigo_estudiante\" => $data['idnumber'],\n\t\t\t\"rol\" => $rol\n\t\t);\n\n\t\t$datos_add = $this->_db->query(\"\n\t\t\tSELECT e.per_aca, b.id_facultad, a.id_programa, e.idnumber as codigo_curso, a.id_genero, a.idnumber\n\t\t\tFROM am_usuario a, am_programa b, \".DB_PRE.\"course e\n\t\t\tWHERE a.id_programa = b.id_programa\n\t\t\tAND e.id = \".ID_CURSO.\"\n\t\t\tAND id_moodle = \".$data['id']\n\t\t\t);\n\n\t\tif (!$datos_add) {\n\t\t\tprintf(\"Errormessage datos_add: %s\\n\", $this->_db->error);\n\t\t}else{\n\t\t\t$row = $datos_add->fetch_all(MYSQLI_ASSOC);\n\t\t\tforeach ($row as $key) {\n\t\t\t\tforeach ($key as $data => $value) {\n\t\t\t\t\t$usuario[$data] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $usuario;\n\t}",
"private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}",
"public function getdatosUsuarios(){\n\t\t$bd = new bd();\n\t\t$result = $bd->doSingleSelect($this->u_table,\"id = {$this->id}\");\n\t\tif($result){\n\t\t\t$this->datosUsuario($result[\"direccion\"], $result[\"telefono\"], $result[\"descripcion\"], $result[\"estados_id\"], $result[\"facebook\"], $result[\"twitter\"],$result[\"website\"],$result[\"certificado\"],$result[\"id_sede\"]);\n\t\t\t$this->id = $result[\"id\"];\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function fetchUsuario() {\n\n $usuarios = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM usuario\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $username = $row['username'];\n $password = $row['password'];\n $email = $row['email'];\n $poblacion = $row['poblacion'];\n $idioma = $row['idioma'];\n $telefono = $row['telefono'];\n $url = $row['url'];\n $foto = $row['foto'];\n $textoPresentacion = $row['textoPresentacion'];\n $administrador = $row['esAdministrador'];\n $registrado = $row['esUsuarioRegistrado'];\n $professional = $row['esUsuarioProfesional'];\n $usuario = new Usuario($id, $username, $password, $email, $poblacion, $idioma, $telefono, $url, $foto, $textoPresentacion, $administrador, $registrado, $professional);\n array_push($usuarios, $usuario);\n }\n\n return $usuarios;\n }",
"public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }",
"public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }",
"public function getUsuarios(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraUsuarios\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM usuarios \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM usuarios LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}",
"public function cargarUsuario(){\n $query = \"SELECT nombre, apellido, sexo, DATE_FORMAT(fecha_nac, '%d/%m/%Y') AS fecha_nac, correo FROM usuario WHERE codUsuario = \".parent::string($this->getCodUsuario()).\";\";\n $result = mysqli_query(parent::conexion(), $query);\n $arreglo = null;\n\n if(!$result){\n \t\tdie(\"Error\");\n } else{\n while($data = mysqli_fetch_assoc($result)){\n $arreglo[] = $data;\n \t\t }\n }\n\n parent::desconectar();\n return json_encode($arreglo);\n }",
"function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}",
"private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }",
"function modeloUserGetAll (){\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $db = AccesoDatos::getModelo();\n $tusuarios = $db->getUsuarios();\n foreach ($tusuarios as $clave=>$user){\n \n $tabla[$user->id]= ['nombre'=>$user->nombre,\n 'correo'=>$user->correo,\n 'plan'=>PLANES[$user->plan],\n 'estado'=>ESTADOS[$user->estado],\n ];\n }\n return $tabla;\n}",
"public function getUsuario($id,$cedula){\r\n\t$pdo = Database::connect();\r\n//Utilizamos parametros para la consulta:\r\n\t$sql = \"select * from cat_usuarios where ID_US=?\";\r\n\t$consulta = $pdo->prepare($sql);\r\n//Ejecutamos y pasamos los parametros para la consulta:\r\n\t$consulta->execute(array($id));\r\n//Extraemos el registro especifico:\r\n\t$dato = $consulta->fetch(PDO::FETCH_ASSOC);\r\n//Transformamos el registro obtenido a objeto:\r\n\t$usuario=new Usuarios();\r\n\t$usuario->setID_US($dato['ID_US']);\r\n\t$usuario->setCEDULA_US($dato['CEDULA_US']);\r\n\t$usuario->setNOMBRE_US($dato['NOMBRE_US']);\r\n\t$usuario->setAPELLIDO_US($dato['APELLIDO_US']);\r\n\t$usuario->setFECHANAC_US($dato['FECHANAC_US']);\r\n\t$usuario->setCIUDAD_US($dato['CIUDAD_US']);\r\n\t$usuario->setTELEFONO_US($dato['TELEFONO_US']);\r\n\t$usuario->setGENERO_US($dato['GENERO_US']);\r\n\t$usuario->setAPELLIDO_US($dato['APELLIDO_US']);\r\n\t$usuario->setDIRECCION_US($dato['DIRECCION_US']);\r\n\t$usuario->setFECHAREGISTRO_US($dato['FECHAREGISTRO_US']);\r\n\t$usuario->setEMAIL_US($dato['EMAIL_US']);\r\n\r\n\tDatabase::disconnect();\r\n\treturn $usuario;\r\n}",
"public function getUsuario() {\n }",
"public function getUsuario(){\n $sql=\"SELECT id, tipo, tipo_identificacion, numero_identificacion, apellidos, nombres, razon_social, codigo, \n direccion, telefono1, telefono2, celular1, celular2, email1, email2, fecha_nacimiento, profesion, \n actividades, rol, fecha_registro, descripcion FROM ctk_usuario where estado=1\";\n //$sentencia=$this->conexion_db->prepare($sql);\n //$sentencia->execute(array());\n //$resultado=$sentencia->fetchAll(PDO::FETCH_ASSOC);\n //otra opcion \n //$resultado=$this->conexion_db->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n $resultado=$this->conexion_db->query($sql)->fetchAll(PDO::FETCH_OBJ);\n //$sentencia->closeCursor();\n return $resultado;\n $this->conexion_db=null;\n \n //El ejemplo que se encuentra a continuacion realiza la consulta con la libreria mysqli\n /*\n $resultado=$this->conexion_db->query(\"SELECT codigo_ticket, abierto_por, fecha_apertura, fecha_cierre, \n descripcion_evento, tecnico_ctk FROM ctk_ticket WHERE tecnico_ctk='\".$buscar.\"'\");\n $ticket=$resultado->fetch_all(MYSQLI_ASSOC);\n return $ticket;\n */\n }",
"function get_info_usuario($id_usuario){\n\n return $this->db->query(\"SELECT*\n FROM usuarios\n WHERE usuarios.usuario_id = $id_usuario\")->result_array();\n }",
"function compruebaLoginUsuario($bd){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n\n //Utilizo los objetos DAO para añadir el usuario a la BD\n $daoUsuario = new Usuarios($bd);\n $usuario = new Usuario();\n $usuario->setPassword($arrayFiltrado[\"password\"]);\n $usuario->setUsuario($arrayFiltrado[\"usuario\"]);\n $resultado = $daoUsuario->compruebaCredenciales($usuario);\n //Compruebo si tengo usuario\n if($resultado!=false) {\n $usuario->setPassword(null);\n $usuario->setId($resultado[\"id\"]);\n $usuario->setImagen($resultado[\"imagen\"]);\n return $usuario;\n }\n else\n return false;\n}",
"public function readUsuarios()\n\t{\n\t\t$sql = 'SELECT IdRol, Nombre, Apellido, Telefono, Email, u.IdEstado, IdUsuario \n FROM usuarios u ORDER BY Apellido';\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}",
"function obtenerDatosUsuario($parametros) {\n $sql = \"SELECT nombre, apellidos, email, telefono, dni, administrador, pass FROM usuarios WHERE dni = :dni\";\n\n //Preparamos la consulta\n $consulta_usuario = $this->conexionBBDD->prepare($sql,array());\n\n //Ejecutamos la consulta\n $consulta_usuario->execute($parametros);\n\n //Devolvemos los resultados\n return $consulta_usuario->fetch(PDO::FETCH_NUM);\n }",
"public static function getUsuarios()\n {\n $query = \"SELECT id,nombre,email,usuario,privilegio,fecha_registro FROM users\";\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->execute();\n\n $filas = $resultado->fetchAll();\n\n return $filas;\n }",
"function getUsuarios(){\n\t\n\t\treturn conectar()->query( \"SELECT * FROM usuarios\");\n\t}",
"function getUsuarios()\n{\n\t$con = getDBConnection();\n\t$sql = \"SELECT * FROM usuarios\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->execute();\n\t$usuarios = null;\n\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$usuario = new Usuario();\n\t\t$usuario->setID($row['id']);\n\t\t$usuario->set($row['nombre'],$row['apellidos'],$row['user_name'],$row['password'],$row['email']);\n\t\t$usuarios[] = $usuario;\n\t}\n\treturn $usuarios;\n}",
"public function getLoggedUserData(){\r\n if($this->isUserLogged()){\r\n // ziskam data uzivatele ze session\r\n $userId = $_SESSION[$this->userSessionKey];\r\n // pokud nemam data uzivatele, tak vypisu chybu a vynutim odhlaseni uzivatele\r\n if($userId == null) {\r\n // nemam data uzivatele ze session - vypisu jen chybu, uzivatele odhlasim a vratim null\r\n echo \"SEVER ERROR: Data přihlášeného uživatele nebyla nalezena, a proto byl uživatel odhlášen.\";\r\n $this->userLogout();\r\n // vracim null\r\n return null;\r\n } else {\r\n // nactu data uzivatele z databaze\r\n $userData = $this->selectFromTable(TABLE_USER, \"id_uzivatel=$userId\");\r\n // mam data uzivatele?\r\n if(empty($userData)){\r\n // nemam - vypisu jen chybu, uzivatele odhlasim a vratim null\r\n echo \"ERROR: Data přihlášeného uživatele se nenachází v databázi (mohl být smazán), a proto byl uživatel odhlášen.\";\r\n $this->userLogout();\r\n return null;\r\n } else {\r\n // protoze DB vraci pole uzivatelu, tak vyjmu jeho prvni polozku a vratim ziskana data uzivatele\r\n return $userData[0];\r\n }\r\n }\r\n } else {\r\n // uzivatel neni prihlasen - vracim null\r\n return null;\r\n }\r\n }",
"function getUsuario($id){\n $conex=Conexion::getInstance();\n $sql=\"SELECT * FROM usuarios where usuarios.id=$id\";\n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt = $conex->dbh->prepare($sql);\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n // Excecute\n $stmt->execute();\n // solo hay uno o ninguno\n $row = $stmt->fetch();\n if (!$row) {\n $oferta=NULL;\n }\n else {\n \n $oferta=['id'=> $row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],\n 'admin'=>$row['admin'], 'password'=>$row['password']];\n }\n return $oferta;\n}",
"public static function getAllUsuario(){\n $v = array();\n\t\t$conexion = new Database();\n $sql = sprintf('SELECT * FROM agenda_usuarios' );\n $rows = $conexion->query( $sql );\n\n foreach( $rows as $row ){\n\t\t\t$u = new Usuario();\n\t\t\t$u->usuario = $row['USUARIO'];\n $u->password = $row['PASSWORD'];\n $u->codigo = $row['USUARIO_ID'];\n\t\t\t$v[] = $u;\n\t\t}\n return $v;\n }",
"public function agregarUsuario(){\n \n }",
"function getAllUsuarios(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllUsuarios');\n\t\t\treturn $data;\n\t\t}",
"public function login($user, $clave)\n {\n parent::conectar();\n\n \n\n // El metodo salvar sirve para escapar cualquier comillas doble o simple y otros caracteres que pueden vulnerar nuestra consulta SQL\n $user = parent::salvar($user);\n $clave = parent::salvar($clave);\n\n // Si necesitas filtrar las mayusculas y los acentos habilita las lineas 36 y 37 recuerda que en la base de datos debe estar filtrado tambien para una \n \n\t$consulta = 'select id, nombre, cargo from usuarios where email=\"'.$user.'\" and clave= MD5(\"'.$clave.'\")\n\t UNION SELECT codpaci, nombrep, cargo from customers where email =\"'.$user.'\" and clave= MD5(\"'.$clave.'\")';\n\t \n\t \n /*\n Verificamos si el usuario existe, la funcion verificarRegistros\n retorna el número de filas afectadas, en otras palabras si el\n usuario existe retornara 1 de lo contrario retornara 0\n */\n\n $verificar_usuario = parent::verificarRegistros($consulta);\n\n // si la consulta es mayor a 0 el usuario existe\n if($verificar_usuario > 0){\n\n \n\n /*\n Realizamos la misma consulta de la linea 55 pero esta ves transformaremos el resultado en un arreglo,\n ten mucho cuidado con usar el metodo consultaArreglo ya que devuelve un arreglo de la primera fila encontrada\n es decir, como nosotros solo validamos a un usuario no hay problema pero esta funcion no funciona si\n vas a listar a los usuarios, espero que me entiendan xd\n */\n\n $user = parent::consultaArreglo($consulta);\n\n /*\n Bien espero ser un poco claro en esta parte, la variable user\n en la linea 69 pasa a ser un arreglo con los campos consultados en la linea\n 48, entonces para acceder a los datos utilizamos $user[nombre_del_campo] Ok?\n bueno hagamos el ejercicio.\n */\n\n /*\n Inicializamos la sessión | Recuerda con las variables de sesión\n podemos acceder a la informacion desde cualquiera pagina siempre y cuando\n exista una sesión y ademas utilicemos el codigo de la linea 84\n */\n\n session_start();\n\n /*\n Las variables de sesion son muy faciles de usar, es como\n declarar una variable, lo unico diferente es que obligatoria mente\n debes usar $_SESSION[] y .... el nombre de la variable ya no sera asi\n $miVariable sino entre comillas dentro del arreglo de sesion, haber me\n dejo explicar, $_SESSION['miVariable'], recuerda que como declares la variable\n en este archivo asi mismo lo llamaras en los demas.\n */\n\n $_SESSION['id'] = $user['id'];\n $_SESSION['nombre'] = $user['nombre'];\n $_SESSION['cargo'] = $user['cargo'];\n\n /*\n Que porqué almacenamos cargo? es encillo en nuestros proyectos\n pueden existir archivos que solo puede ver un usuario con el cargo de\n administrador y no un usuario estandar, asi que la variable global de\n sesion nos ayudara a verificar el cargo del usuario que ha iniciado sesion\n Ok?\n */\n\n /*\n Recuerda:\n cargo con valor: 1 es: Administrador\n cargo con valor: 2 es: usuario estandar\n puedes agregar cuantos cargos desees, en este ejemplo solo uso 2\n */\n\n // Verificamos que cargo tiene l usuario y asi mismo dar la respuesta a ajax para que redireccione\n if($_SESSION['cargo'] == 1){\n echo 'view/admin/admin.php';\n }else if($_SESSION['cargo'] == 2){\n echo 'view/user/user.php';\n }\n\n\n // u.u finalizamos aqui :v\n\n }else{\n // El usuario y la clave son incorrectos\n echo 'error_3';\n }\n\n\n # Cerramos la conexion\n parent::cerrar();\n }",
"public function getUsuario(){\n\n $usuario = null;\n $abmUs = new abmUsuario();\n $list = $abmUs->buscar(['idUsuario' => $_SESSION['idUsuario']]);\n if (count($list) > 0) {\n $usuario = $list[0];\n }\n return $usuario;\n }",
"public function buscarUsuario($idUser){\n\t\t\t\n\t\t\t$this->load->database();\n\t\t\t\n\t\t\t$query = $this->db->query(\"SELECT * FROM user WHERE id_user = $idUser\");\n\t\t\t\n\t\t\t\t $dados = array();\n\t\t\t\t \tforeach($query->result() as $linha)\n\t\t\t\t \t{\n\t\t\t\t \t\t$dados['id_user'] = $linha->id_user;\n\t\t\t\t \t\t$dados['nome'] = $linha->nome;\n\t\t\t\t \t\t$dados['email'] = $linha->email;\n\t\t\t\t \t\t$dados['login'] = $linha->login;\n\t\t\t\t \t\t$dados['perfil'] = $linha->perfil;\n\t\t\t\t }\n\n\t\t\treturn($dados);\n\t\t\t\n\t\t}",
"public static function modeloUserGet ($userid){\n $datosuser=[];\n $stmt=self::$db->prepare(self::$consulta_user);\n $stmt->bindValue(1,$userid);\n $stmt->execute();\n if ($stmt->rowCount()>0) {\n $stmt->setFetchMode(PDO::FETCH_CLASS,\"Usuario\");\n $cod=$stmt->fetch();\n $datosuser=[\n $cod->clave,\n $cod->nombre,\n $cod->email,\n $cod->plan,\n $cod->estado\n ];\n return $datosuser;\n }\n return null;\n}",
"public function consultarUsuario(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT c.*, a.permissao FROM tbusuarios c, tbpermissao a where c.idpermissao = a.idpermissao and permissao <> 'SUPER-ADMIN'order by c.nome\";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) {\n $idusuario = $row[\"idusuario\"];\n $nome = $row[\"nome\"];\n $email = $row[\"email\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $telefone = $row[\"telefone\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $habilitado = $row[\"habilitado\"];\n $permissao = $row[\"permissao\"]; \n $idpermissao = $row[\"idpermissao\"]; \n\n $dado = array();\n $dado['idusuario'] = $idusuario;\n $dado['nome'] = $nome;\n $dado['email'] = $email;\n $dado['senha'] = $row['senha'];\n $dado['senha_confirma'] = $row['senha_confirma'];\n $dado['idpermissao'] = $idpermissao;\n $dado['permissao'] = $permissao;\n $dado['telefone'] = $telefone;\n $dado['dtnascimento'] = $dtnascimento;\n $dado['habilitado'] = $habilitado; \n $dados[] = $dado;\n }\n\n return $dados;\n\n }",
"public function getUserData(){\n try {\n $user = auth()->user();\n $us=new User();\n if($us->validaEmpresaActiva($user->id_emp)){\n $us=new User();\n $usuario=$us->getUserInfo($user->id);\n return response()->json($usuario);\n }else{\n return response()->json(false);\n }\n } catch (\\Exception $e) {\n return response()->json(\"Error: \".$e);\n }\n }",
"public function get_usuarios()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = \"SELECT * FROM usuarios\";\n\n\t\t\t$resultado = $this->db->prepare($sql);\n\n\t\t\tif(!$resultado->execute())\n\t\t\t{\n\t\t\t\techo \"<h1 class='text-danger bg-danger'>Falla en la consulta</h1>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile($reg = $resultado->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->usuarios[] = $reg;\n\t\t\t\t}\n\n\t\t\t\treturn $this->usuarios;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie(\"Error: {$e->getMessage()}\");\n\t\t}\n\t}",
"public function Listar()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = array();\n\n\t\t\t$stm = $this->pdo->prepare(\"SELECT usuario.`correo`, `usuario`.`clave`, `rol`.`nomRol`, `datospersonales`.`Documento`\nFROM `usuario`\nLEFT JOIN `rol` ON `rol`.`nomRol` = `usuario`.`nomRol` \nLEFT JOIN `datospersonales` ON `datospersonales`.`Documento` = `usuario`.`Documento`\n WHERE correo is not null \");\n\t\t\t$stm->execute();\n\n\t\t\tforeach($stm->fetchAll(PDO::FETCH_OBJ) as $r)\n\t\t\t{\n\t\t\t\t$usu = new Usuario();\n\n\t\t\t\t$usu->__SET('correo', $r->correo);\n\t\t\t\t$usu->__SET('clave', $r->clave);\n\t\t\t\t$usu->__SET('nomRol', $r->nomRol);\n\t\t\t\t$usu->__SET('Documento', $r->Documento);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t$result[] = $usu;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}",
"function getList() {\n $this->db->getCursorParameters(self::TABLA);\n $respuesta = array();\n while ($fila = $this->db->getRow()) {\n $objeto = new Usuario();\n $objeto->set($fila);\n $respuesta[] = $objeto;\n }\n return $respuesta;\n }",
"function ListaUsuarios() {\n\t//obtiene el id del usuario\n $sql = \"SELECT usuario.id, usuario.nombre_usuario, persona.primer_nombre, persona.primer_apellido, usuario.estado, rol.descripcion FROM usuario INNER JOIN persona ON usuario.persona_id = persona.id INNER JOIN rol ON usuario.rol_id = rol.id WHERE usuario.estado = 'ACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\t\t$respuesta->mensaje = \"Usuarios listados\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de usuarios !\";\n\t\t$respuesta->codigo = 0;\n\t}\n\treturn json_encode($respuesta);\n}",
"private function ifoCadUser()\n {\n $infoCadUser = new AdmsRead();\n $infoCadUser->fullRead(\"SELECT env_email_conf, adms_niveis_acesso_id, adms_sits_usuario_id FROM adms_cads_usuarios WHERE id =:id LIMIT :limit\", \"id=1&limit=1\");\n $this->IfoCadUser = $infoCadUser->getResultado();\n\n }",
"public static function get_usuario($usuario){\n\t\t\n\t\t$query = \"SELECT id,nombre,usuario,privilegio,fecha_registro,email FROM usuarios WHERE usuario=:usuario AND password=:password LIMIT 1\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t\n\t\t$resultado->bindValue(\":usuario\", $usuario->getUsuario());\n\t\t$resultado->bindValue(\":password\", $usuario->getPassword());\n\n\t\t$resultado->execute();\n\n\t\t$filas=$resultado->fetch();\n\n\t\t#Creamos el objeto de tipo usuario\n\t\t$usuario = new Usuario();\n\t\t$usuario->setId($filas['id']);\n\t\t$usuario->setNombre($filas['nombre']);\n\t\t$usuario->setUsuario($filas['usuario']);\n\t\t$usuario->setEmail($filas['email']);\n\t\t$usuario->setPrivilegio($filas['privilegio']);\n\t\t$usuario->setFecha_registro($filas['fecha_registro']);\n\n\t\treturn $usuario;\n\n\t}",
"function getDataForm(){\r\n\t\t\t\t$login = $_REQUEST['login']; //login\r\n\t\t\t\t$password = $_REQUEST['password'];//pas\r\n\t\t\t\t$dni = $_REQUEST['dni'];//dni\r\n\t\t\t\t$nombre = $_REQUEST['nombre'];//nombre\r\n\t\t\t\t$apellidos = $_REQUEST['apellidos'];//apellidos\r\n\t\t\t\t$telefono = $_REQUEST['telefono'];//telefono\r\n\t\t\t\t$email = $_REQUEST['email'];//email\r\n\t\t\t\t$fechanacimiento = $_REQUEST['fecha'];//fecha de nacimiento\r\n\t\t\t\t$tipo = $_REQUEST['tipo']; //tipo de usuario\r\n\t\t\t\t\r\n\t\t\t\t$usuario = new Usuarios_Model ($login,$password,$dni,$nombre,$apellidos,$telefono,$email,$fechanacimiento,$tipo); //creamos el objeto usuario\r\n\t\t\t\t\r\n\t\t\t\treturn $usuario; //devolvemos el objeto usuario\r\n\t\t\t}",
"public function UserData(){\n\t\t$this->id = \"\"; \n\t\t$this->nombre =null;\n\t\t$this->cc = null;\n $this->email = null; \n\t\t$this->telefono =null;\n\t\t$this->rol = null;\n\t\t$this->user = null; \n\t\t$this->pass = null;\n \n\t}",
"public static function modeloUserGetAll ():array {\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $stmt=self::$db->query(\"select * from Usuarios\");\n $usuarios=[];\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n while ($cod=$stmt->fetch()) {\n $datosuser= [\n $cod[\"nombre\"],\n $cod[\"email\"],\n PLANES[$cod[\"plan\"]],\n ESTADOS[$cod[\"estados\"]]\n ];\n $usuarios[$cod[\"user\"]]=$datosuser;\n }\n return $usuarios;\n}",
"public function listarUsua(){\n\t\t$sql=\"SELECT USUARI_ID, USUARI_NOMBRES, USUARI_USUARIO\n\t\t FROM usuario ORDER BY USUARI_NOMBRES\";\n\t\treturn ejecutarConsulta($sql);\n\t}",
"public static function get_usuarios(){\n\t\t\n\t\t$query = \"SELECT * FROM usuarios\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->execute();\n\n\t\t$filas=$resultado->fetchAll();\n\n\t\t\n\t\treturn $filas;\n\n\t}",
"public function getUsuario($dados = null){\n\n\t\tif($dados != null){\n\n\t\t\t//Monta a consulta com a seguintes condições\n\t\t\t$this->db->where('email', $dados['login']);\n\t\t\t//$this->db->where('senha', sha1($dados['senha']));\n\t\t\t$this->db->where('senha', $dados['senha']);\n\n\t\t\t//Armazena os registro na variavel query\n\t\t\t$query = $this->db->get('tb_usuario');\n\n\t\t\t//Verifica se foi encontrado um registro com os dados igual a das condições\n\t\t\tif($query->num_rows == 1){\t\n\t\t\t\t//Retorna o registro com os dados semelhantes ao aos dados que foram informados\t\t\n\t\t\t\treturn $query->result_array();\n\t\t\t}\n\t\t}\n\t}",
"function obtenerUsuarios(){\n //Variable que almacena la consulta sql\n $sql = \"select login,Alias\n \t\t\tfrom ENTREGA\";\n\t\t//se ejecuta la query\n $resultado = $this->mysqli->query( $sql );\n if ( $resultado->num_rows == 0 ) { return null; }//miramos si el número de filas es 0.\n //Caragamos las tuplas resultado de la consulta en un array\n while($datos = mysqli_fetch_row ($resultado)){\n //Variable que almacena el array de las tuplas resultado de la query\n $miarray[] = $datos;\n }\n return $miarray;\n }",
"function ReadUser($usu_documento){\n\n $pdo = MIDAS_DataBase::Connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"SELECT usu_codigo, usu_nombre, usu_apellido_1, usu_apellido_2, usu_estado, acc_codigo, acc_clave, ges_perfiles_per_codigo, ges_sede_sed_codigo, usu_foto, acc_tour, acc_primeravez, usu_sexo, emp_codigo, sed_codigo\n FROM ges_acceso\n INNER JOIN ges_usuarios ON usu_codigo = ges_usuarios_usu_codigo\n INNER JOIN ges_sedes ON sed_codigo = ges_sede_sed_codigo\n INNER JOIN ges_empresa ON emp_codigo = ges_empresa_emp_codigo\n WHERE usu_documento = ?\";\n\n $query = $pdo->prepare($sql);\n $query->execute(array($usu_documento));\n\n $results = $query->fetch(PDO::FETCH_BOTH);\n\n MIDAS_DataBase::Disconnect();\n return $results;\n }",
"function retornaUsuarios()\n{\n $PDO = db_connect();\n $sql = \"SELECT id,nome_completo,RA,semestre, usuario, img \n FROM sistema.users \n order by nome_completo ASC;\";\n $stmt = $PDO->prepare($sql);\n $stmt->execute();\n $users = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $usersKeyName = array();\n foreach ($users as $user) {\n $usersKeyName[trim($user['nome_completo'])] = $user;\n }\n $dadosCodificados = json_encode($usersKeyName);\n $objData = json_decode($dadosCodificados);\n return $objData;\n}",
"public function getUsuario($id) {\n $getUsuario = new SqlQuery(); //instancion objeto de la clase para realizar consulta\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para hacer la consulta\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción\n $usuario = $getUsuario->buscarId($id, $tabla);\n $statement = $this->refControladorPersistencia->ejecutarSentencia($usuario); //llamo a la funcion\n $user = $statement->fetchAll(PDO::FETCH_ASSOC);\n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit \n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n return $user;\n }",
"function findAll() \n {\n $usuarios = array();\n $n=0;\n $sql=\"select u.id,u.nombre,u.paterno,u.materno,u.username,u.fechaAlta,\".\n \" u.estatus,u.idTipoUsuario,tu.descripcion from Usuarios u\".\n \" inner join TipoUsuarios tu on tu.id=u.idTipoUsuario\".\n \" order by u.id\";\n \n $usuariosRs = mysqli_query($this->_connDb, $sql); \n while ($row = mysqli_fetch_array($usuariosRs)) {\n $oUsuario = new Usuario(0);\n $oUsuario->setId($row['id']);\n $oUsuario->setNombre($row['nombre']);\n $oUsuario->setPaterno($row['paterno']);\n $oUsuario->setMaterno($row['materno']);\n $oUsuario->setUsername($row['username']);\n $oUsuario->setFechaAlta($row['fechaAlta']);\n $oUsuario->setEstatus($row['estatus']);\n\n // Creamos el objeto de tipo TipoUsuario\n $oTipoUsuario = new TipoUsuario($row['idTipoUsuario']);\n $oTipoUsuario->setDescripcion($row['descripcion']);\n\n // Inyectamos la dependencia de TipoUsuario\n $oUsuario->setTipoUsuario($oTipoUsuario);\n $usuarios[$n]=$oUsuario;\n $n++; \n }\n return $usuarios;\n }",
"private function crearUsuario(){\n \t\t#valida que la solicitud sea mediante un post \n\t if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t \t//envia un error \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405); \n\t }\n\t //valida que los datos a incorporar no sean vacios \n\t if (isset($this->datosPeticion['nombre'], $this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t $nombre = $this->datosPeticion['nombre']; \n\t $pwd = $this->datosPeticion['pwd']; \n\t $email = $this->datosPeticion['email'];\n\n\t //valida la existemcia del usuario mediante el email \n\t if (!$this->existeUsuario($email)){ \n\t $query = $this->_conn->prepare(\n\t \t\"INSERT into usuario (nombre,email,password,fRegistro) \n\t \t VALUES (:nombre, :email, :pwd, NOW())\");\n\t //se le asignan los valores a las variables de la consulta \n\t $query->bindValue(\":nombre\", $nombre); \n\t $query->bindValue(\":email\", $email); \n\t $query->bindValue(\":pwd\", sha1($pwd)); \n\t $query->execute(); \n\t if ($query->rowCount() == 1){ // se inserto bien \n\t $id = $this->_conn->lastInsertId(); \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['msg'] = 'usuario creado correctamente'; \n\t $respuesta['usuario']['id'] = $id; \n\t $respuesta['usuario']['nombre'] = $nombre; \n\t $respuesta['usuario']['email'] = $email; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } else //se envia un error de insercion en la bd\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } else //se envia un error del usuario no existe\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400); \n\t } else { \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } \n\t}",
"function consult_login($dato){\n\t\t// se crean las variables que tentran la data correspondiente en la posicion que esta cada uno de estos datos\n\t\t$cedula=strip_tags($dato[0]);\n\t\t$contrasena=strip_tags($dato[1]);\n\t\t//se crea una variable que instancia la clase que coneccion a la base de datos\n\t\t$mysqli = new conect_database();\n\t\t// se rea una variable que sea igual a la variable que instancio la clase anterior y se realiza una respectiva consulta y se le mandan los respectivos datos\n\t\t$query = $mysqli->prepare(\"select id_usuarios,nombre_usuario,tipo_usuario from t_usuarios where usuario='\".$cedula.\"' and contrasena='\".$contrasena.\"'\");\n\t\t// se ejecuta lo que esta dentro de la variable anterior \n\t\t$query->execute();\t\n // se llama la una de las variables privadas que se crearon al principio y esta va a ser igual a la variable que contiene los datos de la consulta uy se obtienen los datos con get_result();\n\t\t$this->consult=$query->get_result();\n // se creaun bucle que es igual a data que sea igual al metodo inbocado en este caso la variable que contiela los datos de la consulta y se obtiene una colunma o un array (los datos)\n\t\twhile ($data=$this->consult->fetch_row()) {\n // llamamos a la otra variable privada que sera un array y contendra los datos\n\t\t\t$this->dataAll[]=$data;\n\n\t\t}\n // retornamos los datos \n\t\treturn $this->dataAll;\n\t}",
"public function retrieve_all_users()\n {\n $table_pengajar = $this->db->dbprefix('pengajar');\n $table_siswa = $this->db->dbprefix('siswa');\n $table_login = $this->db->dbprefix('login');\n\n $sql = \"SELECT {$table_login}.username, {$table_pengajar}.nama FROM {$table_pengajar} INNER JOIN {$table_login} ON {$table_pengajar}.id = {$table_login}.pengajar_id\n UNION\n SELECT {$table_login}.username, {$table_siswa}.nama FROM {$table_siswa} INNER JOIN {$table_login} ON {$table_siswa}.id = {$table_login}.siswa_id\";\n\n $result = $this->db->query($sql);\n\n $data = array();\n foreach ($result->result_array() as $r) {\n # selain yang login\n if (is_login() && $r['username'] == get_sess_data('login', 'username')) {\n continue;\n }\n $data[] = addslashes($r['nama']) . ' [' . $r['username'] . ']';\n }\n\n return $data;\n }",
"public function usrget() {\n $q = \"SELECT * FROM ass_usuario WHERE usr_contacto='no' ORDER BY usr_nombre ASC\";\n if ($this->id > 0) {\n $q = \"SELECT * FROM ass_usuario WHERE usr_contacto='no' AND usr_id = \" . $this->id;\n }\n //if ($this->sdid > 0) {\n // $q = \"SELECT * FROM fir_usuario WHERE fir_sede_sde_id = \" . $this->sdid;\n //}\n //if ($this->euid > 0) {\n // $q = \"SELECT * FROM fir_usuario WHERE fir_empresa_emp_id = \" . $this->euid;\n //}\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $resultado = mysql_num_rows($con);\n $arr = array();\n while ($obj = mysql_fetch_object($con)) {\n $arr[] = array(\n 'id' => $obj->usr_id,\n 'idcli' => $obj->mzt_cliente_cli_id,\n 'idprov' => $obj->mzt_proveedor_pro_id,\n 'nombre' => ($obj->usr_nombre),\n 'apellido' => ($obj->usr_apellido),\n 'cargo' => ($obj->usr_cargo),\n 'email' => ($obj->usr_email),\n 'identificacion' => ($obj->usr_identificacion),\n 'celular' => ($obj->usr_celular),\n 'telefono' => ($obj->usr_telefono),\n 'habilitado' => ($obj->usr_habilitado),\n 'dtcreate' => ($obj->usr_dtcreate));\n }\n//PEDIR ARCHIVOS\n $qa = \"SELECT arc_nombre FROM ass_archivos WHERE mzt_usuario_usr_id= \" . $this->id;\n if ($qa != \"\") {\n $cona = mysql_query($qa, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $qa);\n $resultadoa = mysql_num_rows($cona);\n $arra = array();\n while ($obja = mysql_fetch_object($cona)) {\n $arra[] = array(\n 'ref_imagen' => ($obja->arc_nombre));\n }\n }\n if ($resultado > 0) {\n $arrjson = array('output' => array('valid' => true, 'response' => $arr, 'response2' => $arra));\n } else {\n $arrjson = $this->UTILITY->error_no_result();\n }\n $this->response = ($arrjson);\n }",
"public function get_usuario_por_id($id_usuario){\r\n $conectar=parent::conexion();// hacemos nuestra conexion\r\n parent::set_names(); // este es para no tener probllemas con las tilde \r\n $sql=\"select * from usuario where id =?\";\r\n $sql=$conectar->prepare($sql); //HACE UNA CONSULTA EN TODOS LOS CAMPOS\r\n $sql->bindValue(1,$id_usuario);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"public function get_usuario($id_login){\n return $this->db->query(\"select * from usuarios where ID_USUARIO=$id_login\"); \n \n }",
"function usuario($usuario) {\r\n $u = $this->consultar($usuario);\r\n $p = $this->perfil($u[\"perfil\"]);\r\n return(array_merge($u, $p));\r\n }",
"function user() {\n $user = $this->ion_auth->user()->row();\n //\n //get id\n $data['profic'] = $this->model_portofolio->select_profic_user($user->id)->row();\n $data['user'] = $user;\n if ($this->model_portofolio->select_metadata($user->id, 1)->row() == NULL) {\n $this->model_portofolio->insert_usermeta($user->id, 1);\n $data['profil'] = $this->model_portofolio->select_metadata($user->id, 1)->row();\n } else {\n $data['profil'] = $this->model_portofolio->select_metadata($user->id, 1)->row();\n }\n if ($this->model_portofolio->select_metadata($user->id, 2)->row() == NULL) {\n $this->model_portofolio->insert_usermeta($user->id, 2);\n $data['pengajaran'] = $this->model_portofolio->select_metadata($user->id, 2)->row();\n } else {\n $data['pengajaran'] = $this->model_portofolio->select_metadata($user->id, 2)->row();\n }\n if ($this->model_portofolio->select_metadata($user->id, 3)->row() == NULL) {\n $this->model_portofolio->insert_usermeta($user->id, 3);\n $data['riset'] = $this->model_portofolio->select_metadata($user->id, 3)->row();\n } else {\n $data['riset'] = $this->model_portofolio->select_metadata($user->id, 3)->row();\n }\n if ($this->model_portofolio->select_metadata($user->id, 4)->row() == NULL) {\n $this->model_portofolio->insert_usermeta($user->id, 4);\n $data['publikasi'] = $this->model_portofolio->select_metadata($user->id, 4)->row();\n } else {\n $data['publikasi'] = $this->model_portofolio->select_metadata($user->id, 4)->row();\n }\n if ($this->model_portofolio->select_metadata($user->id, 5)->row() == NULL) {\n $this->model_portofolio->insert_usermeta($user->id, 5);\n $data['pengalaman'] = $this->model_portofolio->select_metadata($user->id, 5)->row();\n } else {\n $data['pengalaman'] = $this->model_portofolio->select_metadata($user->id, 5)->row();\n }\n if ($this->model_portofolio->select_metadata($user->id, 6)->row() == NULL) {\n $this->model_portofolio->insert_usermeta($user->id, 6);\n $data['pendidikan'] = $this->model_portofolio->select_metadata($user->id, 6)->row();\n } else {\n $data['pendidikan'] = $this->model_portofolio->select_metadata($user->id, 6)->row();\n }\n\n //print_r($data['profic']);\n //print_r($data['user']);\n //print_r($data['publikasi']);\n //print_r($data);\n $this->load->view('portofolio/profil', $data);\n }",
"function getUser() {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'username', 1 => 'title', 2 => 'first_name', 3 => 'last_name', 4 => 'password', 5 => 'contactemail', 6 => 'contacttelephone', 7 => 'newsletter', 8 =>'pcode', 9 => 'store_owner', 10 => 'house', 11 => 'street', 12 => 'town', 13 => 'county', 14 => 'geolong', 15 => 'geolat', 16 => 'avatar', 17 => 'mobile', 18 => 'optout');\n $idfields = array(0 => 'id');\n $idvals = array(0 => $this->ID);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('Username', $res['username']);\n $this->setUserVar('Title', $res['title']);\n $this->setUserVar('FirstName', $res['first_name']);\n $this->setUserVar('LastName', $res['last_name']);\n $this->setUserVar('ContactEmail', $res['contactemail']);\n $this->setUserVar('ContactTelephone', $res['contacttelephone']);\n $this->setUserVar('NewsletterSubscriber', $res['newsletter']);\n $this->setUserVar('Area', $res['pcode']);\n $this->setUserVar('StoreOwner', $res['store_owner']);\n $this->setUserVar('House', $res['house']);\n $this->setUserVar('Street', $res['street']);\n $this->setUserVar('Town', $res['town']);\n $this->setUserVar('County', $res['county']);\n $this->setUserVar('PCode', $res['pcode']);\n $this->setUserVar('Long', $res['geolong']);\n $this->setUserVar('Lat', $res['geolat']);\n $this->setUserVar('Avatar', $res['avatar']);\n $this->setUserVar('Mobile', $res['mobile']);\n $this->setUserVar('DMOptOut', $res['optout']);\n $this->formatAddress();\n $this->formatEmail();\n if ($this->Lat == '')\n {\n $this->GeoLocate();\n }\n }\n }\n }",
"public function UsuariosPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios where codigo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codigo\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"function showUD() {\n $rows = self::$db->getRows(\"SELECT * FROM usuario where tipousuario = 2\"); \n $arrayUsuario= array(); \n foreach ($rows as $c){\n $aux = new Usuario($c{'idusuario'},$c{'usuario'},$c{'contrasenia'},$c{'tipousuario'});\n array_push($arrayUsuario, $aux);\n }\n return $arrayUsuario; \n }",
"function cadastrarUser(){\n //$this->session->set_tempdata('erro-acesso', 'login e senha não correspondem!', 5);\n\t \n\t\t/*$verificarUser = $this->login->get_verificar_user('sytesraul', '513482am');\n\t\tif($verificarUser != null) :\n\t\t\techo \"USUARIO JA CADASTRADO \".$verificarUser->name_login;\n\t\tendif;*/\n\t //redirect('login/acessoAceito', 'refresh');\n\t \n\t\t$dados['titulo'] = 'Cadastrar Usuário';\n\t\t$dados['h2'] = 'Tela de Cadastro';\n\t\t$this->load->view('login/cadastrar_user_view', $dados);\n\t\t\n\t\t\n\t}",
"function recuperarUsuario()\n {\n $_codigo=$this->codigo ; \n $this->dataBaseAccess(); \n $mySelect = 'select Codigo_empresa,Nome,Senha where Codigo = ' . $this->Codigo ;\n $ret = mysqli_query($this->myCon , $mySelect) ;\n $numRows= mysqli_num_rows($ret); \n if($numRows>0)\n {\n $reg = mysqli_fetch_array($ret) ;\n $this->Codigo_empresa=$reg['Codigo_empresa'] ;\n $this->Nome=$reg['Nome'] ;\n $this->Senha=$reg['Senha'] ;\n mysqli_close( $this->myCon );\n $this->records_found=$numRows ;\n return true ; // ja cadastrado \n }else{\n mysqli_close( $this->myCon );\n return false ; \n }\n }",
"function GetAllUser(){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM buku ORDER BY judul_buku\");\n\t\tif($hasil->num_rows()>0){\n\t\t\tforeach($hasil->result() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t*/\n\t\t$query=$this->db->get('user');\n\t\tforeach($query->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}",
"function list_user(){\n $user = $this->db->get('data_diri');\n return $user;\n }",
"public function buscarUsuarios(){\n\t\t}",
"function Usuario($idUsuario = '')\n\t\t{\n\t\t\t$this->id = \"usuario_id\";\n\t\t\t$this->tabla = \"usuario\";\n\t\t\t\n\t\t\t$this->exitoListar = t(\"User list obtained successfully\");\n\t\t\t$this->errorListar = t(\"Error obtaining user list\");\n\t\t\t$this->exitoInsertar = t(\"User created successfully\");\n\t\t\t$this->exitoActualizar = t(\"User updated successfully\");\n\t\t\t$this->errorInsertar = t(\"Error creating user\");\n\t\t\t$this->errorActualizar = t(\"Error updating user\");\t\n\t\t\t\n\t\t\t$this->campos = array(\n\t\t\t\t'usuario_id' => array('tipo'=>'id','nulo'=>true,'msg'=>t('Invalid user ID'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_nombre' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid user name'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_login' => array('tipo'=>'string','nulo'=>false,'msg'=>t('Invalid user login'),'valor'=>null,'lectura'=>false),\n\t\t\t\t'usuario_password' => array('tipo'=>'string','nulo'=>false,'msg'=>t('Invalid password'),'valor'=>null,'lectura'=>false),\n\t\t\t\t'usuario_rol_id' => array('tipo'=>'int','nulo'=>false,'msg'=>t('Invalid Rol'),'valor'=>null,'lectura'=>false),\n\t\t\t\t'usuario_email' => array('tipo'=>'email','nulo'=>true,'msg'=>t('Invalid email'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_apellido1' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid surname1'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_apellido2' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid surname2'),'valor'=>'','lectura'=>false),\n\t\t\t\t'usuario_detalles' => array('tipo'=>'html','nulo'=>true,'msg'=>t('Invalid details'),'valor'=>'','lectura'=>false)\n\t\t\t);\n\n\t\t\t$this->relaciones = array(\n\t\t\t\n\t\t\t\t'rol' => array (\n\t\t\t\t\t'tabla' => 'rol',\n\t\t\t\t\t'relacion' => '1a1',\n\t\t\t\t\t'soloLectura' => true,\n\t\t\t\t\t'clavePrimaria' => 'usuario_rol_id',\n\t\t\t\t\t'claveAjena1' => 'rol_id',\n\t\t\t\t\t'claveAjena2' => '',\n\t\t\t\t\t'campos' => array(\n\t\t\t\t\t\t'rol_id' => array('tipo'=>'id','nulo'=>true,'msg'=>t('Invalid rol id'),'valor'=>'','lectura'=>true),\t\t\t\t\t\n\t\t\t\t\t\t'rol_nombre' => array('tipo'=>'string','nulo'=>true,'msg'=>t('Invalid rol name'),'valor'=>'','lectura'=>true)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$this->campos['usuario_id']['valor'] = $idUsuario;\n\t\t}",
"public function recepcionUsuario($nombre , $password){\n\t\t\t$result_child = $this->_db->query(\"SELECT * FROM usuario WHERE login_usu = '\".$nombre.\"'\");\n\t\t\t$retorna_child = $result_child->fetch_all(MYSQL_ASSOC);\n\n\t\t\t//mensaje por defecto indicando que no se registro\n\t\t\t//genera mensaje para el sistema\n\t\t\t$outp = array('activo'=> \"0\");\n\n\t\t\t//verifica que exista el usuario\n\t\t\tif (!$result_child) {\n \t\t\treturn \"Falló SELECT usuario: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t}else{\n\n\t\t\t\tif (count($retorna_child) > 0) {\n\t\t\t\t\t//print_r(count($retorna_child));\n\t\t\t\t\t//busca su grupo de usuario para asignar un rol \n\t\t\t\t\t$result_master = $this->_db->query(\"SELECT * FROM grupousu WHERE idGrupoUsu = '\".$retorna_child[0]['GrupoUsu_idGrupoUsu'].\"'\");\n\t\t\t\t\t$retorna_master = $result_master->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t\t//verifique que tenga un grupo de usuario\n\t\t\t\t\tif (!$result_child) {\n\t \t\t\t\treturn \"Falló SELECT grupousu: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//verifica la contrasena\n\t\t\t\t\t\tif (md5($retorna_child[0]['pass_usu']) == $password) {\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('idUsuario'=> \"\".$retorna_child[0]['idUsuario'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'nombres_usu'=> \"\".$retorna_child[0]['nombres_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'apellidos_usu'=> \"\".$retorna_child[0]['apellidos_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'GrupoUsu_idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'activo'=> \"1\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn $outp;\n\t\t\t\t\t\t\t$result_child->close();\n\t\t\t\t\t\t\t$result_master->close();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('activo'=> \"0\"\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t$outp[] = array('activo'=> \"0\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t\n\t\t}",
"public function getUsuariosLogin($datos)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from usuarios WHERE correo=:correo && password=:contrasena');\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n if($stmt->execute())\n {\n \n //Variables para iniciar una sesion \n \n $respuesta = $stmt->rowCount();\n $resultado =$stmt->fetch();\n session_start();\n $_SESSION[\"idUsuario\"]=$resultado[\"idUsuario\"];\n $_SESSION[\"nombre\"]=$resultado[\"nombre\"];\n $_SESSION[\"apellido\"]=$resultado[\"apellido\"];\n $_SESSION[\"nombre_usuario\"]=$resultado[\"nombre_usuario\"];\n $_SESSION[\"contrasena\"]=$resultado[\"password\"];\n $_SESSION[\"apellido\"]=$resultado[\"apellido\"];\n $_SESSION[\"correo\"]=$resultado[\"correo\"];\n $_SESSION[\"fecha_registro\"]=$resultado[\"fecha_registro\"];\n $_SESSION[\"ruta_img\"]=$resultado[\"ruta_img\"];\n $_SESSION[\"tipoUsuario\"]=$resultado[\"tipoUsuario\"];\n\n return $respuesta;\n }else\n {\n return \"error\";\n }\n }",
"function getUserInfo($id){\n\t\n\t$usr_info = mysql_fetch_object(listAll(\"user\", \"WHERE id = '$id'\"));\n\t$descripcion = getUserData($id, \"2\");\n\t$user_img = getUserData($id, \"1\");\n\t$direccion = getUserData($id, \"3\");\n\t$ciudad = getUserData($id, \"10\");\n\t$cp = getUserData($id, \"4\");\n\t$pais = getUserData($id, \"5\");\n\t$telefono = getUserData($id, \"6\");\n\t$movil =getUserData($id, \"7\");\n\t$exp = getUserData($id, \"14\");\n\t$cam = getUserData($id, \"11\");\n\t$lentes = getUserData($id, \"12\");\n\t$equip = getUserData($id, \"13\");\n\t$cover = getUserData($id, \"16\");\n\t$user_pago = getUserData($id, \"17\");\n $escuelaFotografia = getUserData($id, \"18\");\n $masEducacion = getUserData($id, \"19\");\n $experienciaLaboral = getRecentUserData($id, \"20\");\n $idiomas = getUserData($id, \"22\");\n $habilidades = getUserData($id, \"21\");\n $rut = getUserData($id, \"23\");\n\t\n\tif($usr_info->gender == \"H\"){\n\t\t$gender = \"Hombre\";\n\t}else{\n\t\t$gender = \"Mujer\";\n\t}\n\n\t$paisf = listAll(\"paises\",\"WHERE iso = '$pais->description'\");\n\t$rs_paisf = mysql_fetch_object($paisf);\n\t\n\t$user['id'] = $usr_info->id;\n\t$user['user_type'] = $usr_info->user_type;\n\t$user['email'] = $usr_info->user;\n $user['new_email'] = $usr_info->new_email;\n $user['new_email_code'] = $usr_info->new_email_code;\n\t$user['descripcion'] = $descripcion->description;\n\t$user['user_img']= $user_img->description;\n\t$user[\"name\"] = $usr_info->name;\n\t$user['lastname'] = $usr_info->lastname;\n\t$user['dob']= DateHelper::getLongDate($usr_info->dob);\n $user['user_dob'] = DateHelper::getShortDate($usr_info->dob, 'd/m/Y');\n\t$user['sex']= $gender;\n\t$user['act']= $usr_info->act;\n\t$dob = explode(\"-\",$usr_info->dob);\n\t$user['ano'] = $dob[0];\n\t$user['mes'] = $dob[1];\n\t$user['dia'] = $dob[2];\n\t$user['direccion'] = $direccion->description;\n\t$user['ciudad'] = $ciudad->description;\n\t$user['cp'] = $cp->description;\n\t$user['pais'] = utf8_encode($rs_paisf->nombre);\n\t$user['pais_ab'] = utf8_encode($rs_paisf->iso);\n\t$user['telefono'] = $telefono->description;\n\t$user['movil'] = $movil->description;\n\t$user['exp'] = $exp->description;\n $user['escuela-fotografia'] = $escuelaFotografia->description;\n $user['mas-educacion'] = $masEducacion->description;\n $user['experiencia-laboral'] = json_decode($experienciaLaboral->description);\n $user['idiomas'] = json_decode($idiomas->description);\n $user['habilidades'] = json_decode($habilidades->description);\n $user['rut'] = $rut->description;\n\t$user['cam'] = json_decode($cam->description);\n\t$user['lentes'] = json_decode($lentes->description);\n\t$user['equip'] = json_decode($equip->description);\n\t$user[\"act_code\"] = $usr_info->act_code;\n $user[\"profile_completed\"] = $usr_info->profile_completed;\n $user[\"wizard_completed\"] = $usr_info->wizard_completed;\n $user[\"wizard_contact_creative_completed\"] = $usr_info->wizard_contact_creative_completed;\n\t$user['user_cover'] = $cover->description;\n\t$user['user_pago'] = $user_pago->description;\n\t$user['full_name'] = ucwords($user[\"name\"] . \" \" . $user['lastname']);\n //TODO make it an external function\n //TODO set a default image if file does not exists\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/profile.jpg\")){\n $user['profile_image_url'] = \"profiles/\".sha1($usr_info->id).\"/profile.jpg\";\n } else {\n if ($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER) {\n $user['profile_image_url'] = \"images/profile_default_photographer.jpg\";\n } else {\n $user['profile_image_url'] = \"images/profile_default_client.jpg\";\n }\n }\n\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/cover.jpg\")){\n $user['cover_image_url'] = \"profiles/\".sha1($usr_info->id).\"/cover.jpg\";\n } else {\n $user['cover_image_url'] = \"images/cover_default.jpg\";\n }\n\n return $user;\n}",
"function obtenerUsuarioPorId( $dbh, $id_u ){\r\n\t\t// Devuelve el registro de un usuario dado su id\r\n\t\t$q = \"select idUSUARIO, nombre, apellido, email, cargo, \r\n\t\tactivo, date_format(fecha_creacion,'%d/%m/%Y') as fregistro \r\n\t\tfrom usuario where idUSUARIO = $id_u\";\r\n\r\n\t\treturn mysqli_fetch_array( mysqli_query ( $dbh, $q ) );\r\n\t}",
"private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }",
"public function valorarUsuario($nickname, $puntuacion){\r\n if(!$this->dao){\r\n $this->dao = new UsuarioDAO();\r\n }\r\n $aux= $this->dao;\r\n return $aux->valorarUsuario($nickname, $puntuacion);\r\n }",
"public static function recuperartodo(){\r\n\t\t\r\n\t\t\t$consulta = \"SELECT * FROM usuaris;\";\r\n\t\t\t$datos = Database::get()->query($consulta);//ejecutar la consulta\r\n\t\t\t$usuaris = array();\r\n\t\t\r\n\t\t\twhile($usuari = $datos->fetch_object('UsuarioModel'))\r\n\t\t\t\t$usuaris[] = $usuari;\r\n\t\t\t\t$datos->free();\t\t\t//liberar memoria\r\n\t\t\t\treturn $usuaris;\r\n\t\t}",
"public function getUsuario( ){\n\t\t \treturn $this->usuario;\n\t\t }",
"public function dadosLogin(){\n\t\t$sql=\"select id_empresa from empresa where email=:email and senha=:senha\";\n\t\t//prepara o comando a ser executado no banco de dados\n\t\t$query=$this->con->prepare($sql);\n\t\t//set as variáveis no comando sql e executa no banco de dados\n\t\t$query->execute(array(\"email\"=>$this->email,\"senha\"=>$this->senha));\n\t\t//retorna resultado com um array assoc\n\t\t$resultado = $query->fetch(PDO::FETCH_ASSOC);\n\t\t//retorna os dados do usuário se estiver tudo ok, senão retorna falso\n\t\tif($resultado){\n\t\t\treturn $resultado;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }",
"function datos_usuario($id_usuario) {\n\t\t$query = \"SELECT colaboradores.*, colaboradores_permisos.*\n\t\tFROM colaboradores, colaboradores_permisos\n\t\tWHERE colaboradores.id_colaborador='$id_usuario'\n\t\tAND colaboradores.id_colaborador=colaboradores_permisos.id_colaborador\n\t\tAND colaboradores.estado=1\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}",
"private function login(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t} //es una peticion POST\n\t\tif(isset($this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t\t\t#el constructor padre se encarga de procesar los datos de entrada\n\t\t\t$email = $this->datosPeticion['email']; \n \t\t$pwd = $this->datosPeticion['pwd'];\n \t\t//si los datos de la solicitud no es tan vacios se procesa\n \t\tif (!empty($email) and !empty($pwd)){\n \t\t\t//se valida el email\n \t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) { \n \t\t\t//consulta preparada mysqli_real_escape()\n \t\t\t\t$query = $this->_conn->prepare(\n \t\t\t\t\t\"SELECT id, nombre, email, fRegistro \n \t\t\t\t\t FROM usuario \n \t\t\t\t\t WHERE email=:email AND password=:pwd \");\n \t\t\t\t//se le prestan los valores a la query\n \t\t\t\t$query->bindValue(\":email\", $email); \n \t\t\t$query->bindValue(\":pwd\", sha1($pwd)); \n \t\t\t$query->execute(); //se ejecuta la consulta\n \t\t\t//Se devuelve un respuesta a partir del resultado\n \t\t\tif ($fila = $query->fetch(PDO::FETCH_ASSOC)){ \n\t\t\t $respuesta['estado'] = 'correcto'; \n\t\t\t $respuesta['msg'] = 'Los datos pertenecen a un usuario registrado';\n\t\t\t //Datos del usuario \n\t\t\t $respuesta['usuario']['id'] = $fila['id']; \n\t\t\t $respuesta['usuario']['nombre'] = $fila['nombre']; \n\t\t\t $respuesta['usuario']['email'] = $fila['email']; \n\t\t\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t\t\t } \n \t\t\t}\n \t\t} \n\t\t} // se envia un mensaje de error\n\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(3)), 400);\n\t}",
"function getUsers()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`customers`\";\n\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $users = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $user = new UserEntity();\n $user->setIdUser($data->idUser);\n $user->setNom_societe($data->Nom_societe);\n $user->setAbreviations($data->Abreviations);\n $user->setAdresse($data->Adresse);\n $user->setTel($data->Tel);\n $user->setEmail($data->Email);\n $user->setSecteur($data->Secteur);\n $user->setCreatedAt($data->createdat);\n\n $users[] = $user;\n }\n\n if ($users) {\n return $users;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }",
"public function get_objeto_usuario($id = 1) {\n $usuario = $this->Usuario_ci_model->getUsuario($id);\n echo \"O usuário é:\";\n echo \"<pre>\";\n var_dump($usuario);\n echo \"</pre>\";\n }",
"public function data_user(){\n\t\treturn $this->db->get('registrasi');\n\t}",
"private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }",
"function getUsuari($email){\n $conn=connexioBD();\n $sql=\"SELECT * FROM usuaris WHERE email='$email'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n $user=$usuari; \n }\n }\n return $user;\n $resultado->free();\n $conn->close();\n}",
"public function usuarios()\n {\n \treturn $this->hasMany(reciclausers::class, 'perfilId', 'id');\n \t// nombre del modelo con el que se relaciona, llave foranea, llave de la tabla.\n }",
"public function getUsers()\n {\n $usuarios = $this->Etapas->getUsers()->usuarios->usuario; //usuarios seg.users\n echo json_encode($usuarios);\n }",
"public function getUsuarios ():array {\n $tuser = [];\n $this->stmt_usuarios->setFetchMode(PDO::FETCH_CLASS, 'Usuario');\n \n if ( $this->stmt_usuarios->execute() ){\n while ( $user0 = $this->stmt_usuarios->fetch()){\n $tuser[]= $user0;\n }\n }\n return $tuser;\n }",
"public function consultarUsuario($parametros)\n {\n //echo \"<h1>$correo -- $contrasena</h1>\";\n // header('Location: ../vistas/index.php');\n\n #LLAMO LA CONEXION PARA PODER CONSULTAR A LA BASE DE DATOS\n $modelo = new Conexion_PDO();\n $conexion = $modelo->get_Conexion_Mysql();\n #PREPARO LA SQL PARA VERIFICAR SI EL USUARIO EXISTE Y ESTA ACTIVO\n $sql = \"SELECT priape,segape,nom from datosiniciales\";\n $statement = $conexion->prepare($sql);\n $statement->execute();\n $resultados = $statement->fetch();\n // VERIFICA SI EL RESULTADO ES DIFERENTE DE VACIO QUIERE DECIR QUE EL CORREO SI EXISTE Y ESTA ACTIVO\n if ($resultados != '') {\n\n echo \"<br>- \"$resultados['priape'];\n echo \"<br>- \"$resultados['segape'];\n echo \"<br>- \"$resultados['nom'];\n return 1;\n\n // $_SESSION['identificacion'] = $dato['numeroid'];\n // $_SESSION['nombre'] = $dato['nombre1'];\n // $_SESSION['apellido'] = $dato['apellido1'];\n // header('location:acceso.php');\n\n } else {\n return 2;\n // echo \"Error, verifica tu usuario y contraseña\";\n // header('location:../index.php');\n }\n\n }",
"public function traer_usuarios()\n {\n $usuarios=array();\n $this->db->select('cedula, nombre, email, celular, empresa, razon_social');\n $this->db->from('usuarios');\n $this->db->join('empresas','usuarios.empresa=empresas.id');\n $query=$this->db->get();\n if($query->num_rows()>0)\n {\n foreach ($query->result() as $row)\n {\n $usuarios[$row->cedula]['cedula']=$row->cedula;\n $usuarios[$row->cedula]['nombre']=$row->nombre;\n $usuarios[$row->cedula]['email']=$row->email;\n $usuarios[$row->cedula]['celular']=$row->celular;\n $usuarios[$row->cedula]['empresa']=$row->empresa;\n $usuarios[$row->cedula]['razon_social']=$row->razon_social;\n }\n }\n \n return $usuarios;\n }",
"function listarUsuarios(){\n \n $conex=Conexion::getInstance();\n $stmt = $conex->dbh->prepare(\"SELECT * FROM usuarios\"); \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->execute();\n $listaUsuarios=[];\n while ($row = $stmt->fetch()){\n $listaUsuarios[]=array('id'=>$row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],'admin'=>$row['admin'],'password'=>$row['password']) ; \n }\n return $listaUsuarios;\n}",
"public function getUsuario(){\n return $this->usuario;\n }",
"public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }",
"function tampil_data_user()\n\t{\n\t\t$data = mysqli_query($this->connect, \"select * from user\");\n\t\twhile ($d = mysqli_fetch_array($data)) {\n\t\t\t$hasil[] = $d;\n\t\t}\n\t\treturn $hasil;\n\t}",
"function obtenerUsuario_Especialista(){\n\t\t\n\t\t$user = 'user';\n\t\t\n\t\t$query = $this->db->from('usuario')->where('perfil',$user)->get();\n\t if($query-> num_rows() > 0) return $query->result_array();\n\t else return false ;\n\t\t\n\t}",
"public function autenticar(Autenticar $autenticar){\n\n $sql = \"select * from tbl_funcionario where matricula = '\".$autenticar->getLogin().\"' and senha = '\".$autenticar->getSenha().\"'\";\n\n echo $sql;\n \n $pdoConn = $this->conn->startConnection();\n\n $select = $pdoConn->query($sql);\n\n if($rsContatos=$select->fetch(PDO::FETCH_ASSOC)){\n // echo \"AQQUI\";\n // var_dump($rsContatos);\n \n // require_once('model/usuarioCmsClass.php');\n $user = new UsuarioCms();\n\n $user->setId($rsContatos['id']);\n $user->setNome($rsContatos['nome']);\n $user->setLogin($rsContatos['matricula']);\n $user->setSenha($rsContatos['senha']);\n $user->setIdPermissao($rsContatos['id_permissao']);\n\n return $user;\n }else{\n return \"FALHA\";\n }\n\n $this->conn->closeConnection();\n\n }",
"public function obtenerDatosUsuario($email){\n\t\t$user = array();\n\t\t$sql = \"SELECT U.nombres, U.apellidos \n\t\t\t\tFROM cnp_admin_usuarios_adm U\n\t\t\t\tWHERE U.usuario = '$email'\";\n\t\t$query = $this->db->query($sql);\n\t\tif ($query->num_rows() > 0){\n\t\t\tforeach($query->result() as $row){\n\t\t\t\t$user[\"nombres\"] = $row->NOMBRES; \n\t\t\t\t$user[\"apellidos\"] = $row->APELLIDOS; \n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->db->close();\n\t\treturn $user;\n\t}",
"public function buscar_Usuario2($id){\n\t\t$sql = \"select Documento, Nombres, Apellidos, Usuario, Password, Pregunta, Respuesta,\n\t\t\tTipo_Documento,Ciudad, Direccion, Edad,Foto,Telefono,Correo_Electronico,\n\t\t\tGenero,perfiles_Nombre \n\t\t\tfrom usuarios where Documento='$id'\";\n\t\t$registros = $this->bd->consultar($sql);\n\t\tif($reg=mysql_fetch_array($registros)){\n\t\t\t$this->usuario->set_Nid($reg['Documento']);\n\t\t\t$this->usuario->set_Usuario($reg['Usuario']);\n\t\t\t$this->usuario->set_Password($reg['Password']);\n\t\t\t$this->usuario->set_Nombres($reg['Nombres']);\n\t\t\t$this->usuario->set_Apellidos($reg['Apellidos']);\n\t\t\t$this->usuario->set_TipoId($reg['Tipo_Documento']);\n\t\t\t$this->usuario->set_Ciudad($reg['Ciudad']);\n\t\t\t$this->usuario->set_Direccion($reg['Direccion']);\n\t\t\t$this->usuario->set_Email($reg['Correo_Electronico']);\n\t\t\t$this->usuario->set_Pregunta($reg['Pregunta']);\n\t\t\t$this->usuario->set_Respuesta($reg['Respuesta']);\n\t\t\t$this->usuario->set_Celular($reg['Telefono']);\n\t\t\t$this->usuario->set_Edad($reg['Edad']);\n\t\t\t$this->usuario->set_Foto($reg['Foto']);\n\t\t\t$this->usuario->set_Genero($reg['Genero']);\n\t\t\t$this->usuario->set_Perfil($reg['perfiles_Nombre']);\n\n\t\t}\n\t}",
"public function getRUser($post)\n\t{\n\t\ttry {\n\t\t\t$condicion = '';\n\t\t\t$aux_ids = array();\n\t\t\t#Si existe el id del personal, buscar los bienes de la persona\n\t\t\tif ( isset($post['servidor_id']) && !empty($post['servidor_id']) ) \n\t\t\t{\n\t\t\t\t$servidor = $post['servidor_id']; \n\n\t\t\t\t$this->sql = \" SELECT bien_id FROM asignacion WHERE personal_id = ? \";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam( 1,$servidor );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes_ids = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\tforeach ($bienes_ids as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->bien_id);\n\t\t\t\t}\n\t\t\t\t/*Conversion a string*/\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t\n\t\t\t\t/*Buscar en la tabla de bienes , las asignaciones registradas*/\n\t\t\t\t$this->sql = \" SELECT \n\t\t\t\t\tb.id,\n\t\t\t\t\tb.descripcion,\n\t\t\t\t\tb.serie,\n\t\t\t\t\tb.status,\n\t\t\t\t\tb.inventario,\n\t\t\t\t\tb.desc_ub,\n\t\t\t\t\tm.nombre AS marca,\n\t\t\t\t\tg.nombre AS grupo,\n\t\t\t\t\tt.nombre AS tipo,\n\t\t\t\t\tmo.nombre AS modelo,\n\t\t\t\t\tb.fecha_reg AS registro,\n\t\t\t\t\tb.fecha_adq AS adquisicion,\n\t\t\t\t\tUPPER(c.nombre) AS color,\n\t\t\t\t\tma.nombre AS material,\n\t\t\t\t\tp.nombre AS proveedor,\n\t\t\t\t\tCONCAT(\n\t\t\t\t\t pe.nombre,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_pat,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_mat\n\t\t\t\t\t) AS asignadoa\n\t\t\t\t FROM bienes AS b\n\t\t\t\t INNER JOIN marcas AS m\n\t\t\t\t ON\n\t\t\t\t m.id = b.marca_id\n\t\t\t\t INNER JOIN grupos AS g\n\t\t\t\t ON\n\t\t\t\t g.id = b.grupo_id\n\t\t\t\t INNER JOIN t_bienes AS t\n\t\t\t\t ON\n\t\t\t\t t.id = b.tipo_id\n\t\t\t\t INNER JOIN modelos AS mo\n\t\t\t\t ON\n\t\t\t\t mo.id = b.modelo_id\n\t\t\t\t INNER JOIN color AS c\n\t\t\t\t ON\n\t\t\t\t c.id = b.color_id\n\t\t\t\t INNER JOIN materiales AS ma\n\t\t\t\t ON\n\t\t\t\t ma.id = b.material_id\n\t\t\t\t INNER JOIN proveedores AS p\n\t\t\t\t ON\n\t\t\t\t p.id = b.pro_id\n\t\t\t\t INNER JOIN asignacion AS a\n\t\t\t\t ON\n\t\t\t\t a.bien_id = b.id\n\t\t\t\t INNER JOIN personal AS pe\n\t\t\t\t ON\n\t\t\t\t pe.id = a.personal_id WHERE b.id IN ($aux_ids) \";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\t\n\t\t\t\treturn json_encode($bienes) ;\n\t\t\t} \n\t\t\telseif( isset($post['area']) && !empty($post['area']) )\n\t\t\t{\n\t\t\t\t$area = $post['area'];\n\t\t\t\t#Buscar a los usuarios pertenecientes al area\n\t\t\t\t$this->sql = \"SELECT id FROM personal WHERE area_id = ?\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam(1,$area);\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$personas = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\tforeach ($personas as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->id);\n\t\t\t\t}\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t#ubicar los bienes con las personas (En asignaciones)\n\t\t\t\t$this->sql = \"SELECT bien_id FROM asignacion WHERE personal_id IN (?)\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam(1,$aux_ids);\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$asignaciones = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\t#Limpiar arreglo auxiliar\n\t\t\t\tunset($aux_ids);\n\t\t\t\t$aux_ids = array();\n\t\t\t\tforeach ($asignaciones as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->bien_id);\n\t\t\t\t}\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t#Buscar los bienes (Bienes)\n\t\t\t\t$this->sql = \"SELECT \n\t\t\t\t\tb.id,\n\t\t\t\t\tb.descripcion,\n\t\t\t\t\tb.serie,\n\t\t\t\t\tb.status,\n\t\t\t\t\tb.inventario,\n\t\t\t\t\tb.desc_ub,\n\t\t\t\t\tm.nombre AS marca,\n\t\t\t\t\tg.nombre AS grupo,\n\t\t\t\t\tt.nombre AS tipo,\n\t\t\t\t\tmo.nombre AS modelo,\n\t\t\t\t\tb.fecha_reg AS registro,\n\t\t\t\t\tb.fecha_adq AS adquisicion,\n\t\t\t\t\tUPPER(c.nombre) AS color,\n\t\t\t\t\tma.nombre AS material,\n\t\t\t\t\tp.nombre AS proveedor,\n\t\t\t\t\tCONCAT(\n\t\t\t\t\t pe.nombre,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_pat,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_mat\n\t\t\t\t\t) AS asignadoa\n\t\t\t\t FROM bienes AS b\n\t\t\t\t INNER JOIN marcas AS m\n\t\t\t\t ON\n\t\t\t\t m.id = b.marca_id\n\t\t\t\t INNER JOIN grupos AS g\n\t\t\t\t ON\n\t\t\t\t g.id = b.grupo_id\n\t\t\t\t INNER JOIN t_bienes AS t\n\t\t\t\t ON\n\t\t\t\t t.id = b.tipo_id\n\t\t\t\t INNER JOIN modelos AS mo\n\t\t\t\t ON\n\t\t\t\t mo.id = b.modelo_id\n\t\t\t\t INNER JOIN color AS c\n\t\t\t\t ON\n\t\t\t\t c.id = b.color_id\n\t\t\t\t INNER JOIN materiales AS ma\n\t\t\t\t ON\n\t\t\t\t ma.id = b.material_id\n\t\t\t\t INNER JOIN proveedores AS p\n\t\t\t\t ON\n\t\t\t\t p.id = b.pro_id\n\t\t\t\t INNER JOIN asignacion AS a\n\t\t\t\t ON\n\t\t\t\t a.bien_id = b.id\n\t\t\t\t INNER JOIN personal AS pe\n\t\t\t\t ON\n\t\t\t\t pe.id = a.personal_id\n\t\t\t\t WHERE b.id IN ($aux_ids)\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\treturn json_encode($bienes);\n\t\t\t}else{\n\t\t\t\treturn json_encode( array('message'=>'No selecciono ningún criterio') );\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$this->result = array('error' => $e->getMessage() );\n\t\t}\t\n\t}",
"public function User()\n\t{\n\t\t$datos = $this->Admin_Usuarios->getUsuario($this->input->get('id'));\n\t\tforeach($datos->result() as $res)\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'id'\t\t\t=> $res->idDatosprofesor,\n\t\t\t\t'nombre' \t\t=> $res->Nombres,\n\t\t\t\t'apellidop'\t\t=> $res->Primerapellido,\n\t\t\t\t'apellidom'\t\t=> $res->Segundoapellido,\n\t\t\t\t'curp' \t\t\t=> $res->Curp,\n\t\t\t\t'rfc' \t\t\t=> $res->RFC,\n\t\t\t\t'sexo' \t\t\t=> $res->Sexo,\n\t\t\t\t'nacimiento' \t=> $res->Fechanacimiento,\n\t\t\t\t'nacionalidad' \t=> $res->Nacionalidad,\n\t\t\t\t'enacimiento' \t=> $res->Estadodenacimiento,\n\t\t\t\t'ecivil' \t\t=> $res->Estadocivil,\n\t\t\t\t'correo' \t\t=> $res->Correo,\n\t\t\t\t'telefonot' \t=> $res->TelefonoTrabajo,\n\t\t\t\t'telefonoc' \t=> $res->TelefonoCasa,\n\t\t\t\t'img' \t\t\t=> $res->foto,\n\t\t\t\t'telefonop' \t=> $res->TelefonoPersonal\n\n\t\t\t);\n\t\t}\n\t\t$data['titulo'] = 'SAPTC | Detalles';\n\t\t$this->load->view('Admin/detallesUsuario', $data);\n\t}",
"public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }",
"function RellenaDatos()\n{\n $sql = \"SELECT *\n\t\t\tFROM USUARIOS\n\t\t\tWHERE (\n\t\t\t\t(login = '$this->login') \n\t\t\t)\";\n\n\tif (!$resultado = $this->mysqli->query($sql))\n\t{\n\t\t\treturn 'Error de gestor de base de datos';\n\t}else\n\t{\n\t\t$tupla = $resultado->fetch_array();\n\t}\n\treturn $tupla;\n}"
] | [
"0.7569714",
"0.74899966",
"0.73902774",
"0.73869604",
"0.7370471",
"0.7360455",
"0.73283273",
"0.73048264",
"0.72857463",
"0.72098",
"0.7176482",
"0.7169043",
"0.716823",
"0.71600366",
"0.7152903",
"0.713124",
"0.7116144",
"0.71130174",
"0.71078575",
"0.71045876",
"0.70887405",
"0.7088346",
"0.7073333",
"0.70675415",
"0.7063138",
"0.7052295",
"0.7033367",
"0.7012801",
"0.70125777",
"0.70076",
"0.699972",
"0.6993189",
"0.6986546",
"0.6974507",
"0.69724417",
"0.6954743",
"0.6948846",
"0.6946807",
"0.69455695",
"0.6937648",
"0.6932478",
"0.6931413",
"0.6927378",
"0.6925166",
"0.6921033",
"0.69047624",
"0.6890203",
"0.688923",
"0.6888664",
"0.6877425",
"0.68719304",
"0.68678373",
"0.6856477",
"0.6855459",
"0.6851868",
"0.6842595",
"0.6831894",
"0.6827105",
"0.68252873",
"0.6823604",
"0.6822058",
"0.68189484",
"0.68087614",
"0.6807621",
"0.6806598",
"0.68063545",
"0.6792304",
"0.679212",
"0.6781987",
"0.6781847",
"0.67657435",
"0.6760944",
"0.6756407",
"0.6749348",
"0.6746171",
"0.6739354",
"0.67319965",
"0.672941",
"0.67285466",
"0.67259246",
"0.67251664",
"0.67245317",
"0.6723831",
"0.67237276",
"0.6721114",
"0.671896",
"0.67151505",
"0.67149633",
"0.6710392",
"0.6704576",
"0.67039007",
"0.67023164",
"0.6702104",
"0.669798",
"0.6697313",
"0.66946566",
"0.66934806",
"0.6693237",
"0.6691879",
"0.66910017"
] | 0.67342037 | 76 |
Run the database seeds. | public function run()
{
Reply::truncate();
$tickets = Ticket::all();
$faker = Faker::create();
Reply::create([
'ticket_id' => $tickets[0]->id,
'user_id' => 1,
'name' => null,
'message' => $faker->paragraphs(3, true)
]);
Reply::create([
'ticket_id' => $tickets[4]->id,
'user_id' => 1,
'name' => null,
'message' => $faker->paragraphs(3, true)
]);
Reply::create([
'ticket_id' => $tickets[4]->id,
'user_id' => null,
'name' => $tickets[4]->name,
'message' => $faker->paragraphs(3, true)
]);
} | {
"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 |
An English category name that is recommended for a product. | public function getCategoryName()
{
if (is_null($this->categoryName)) {
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_CATEGORY_NAME);
if (is_null($data)) {
return null;
}
$this->categoryName = (string) $data;
}
return $this->categoryName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}",
"public function categoryName() {\n $categories = array(\n 'Fantasy',\n 'Technology',\n 'Thriller',\n 'Documentation',\n );\n\n return $categories[array_rand($categories)];\n }",
"public function getCategoryName()\n {\n return $this->cat->title;\n }",
"public function get_cat_name() {\n $c = $this->cat;\n $tmp = \"\";\n switch($c) {\n case 1:\n $tmp = \"News\";\n break;\n case 2:\n $tmp = \"Eventi\";\n break;\n case 3:\n $tmp = \"Pubblicazioni\";\n break;\n }\n return $tmp;\n }",
"public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}",
"public function getCategoryName()\n {\n return ($this->category !== null?$this->category->name:'-');\n }",
"public static function label()\n {\n return __('Categories');\n }",
"public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }",
"private function getCategory() {\n return '';\n }",
"public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}",
"public static function singularLabel()\n {\n return __('Category');\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function getName()\n {\n return $this->get(\"category_name\");\n }",
"public function defaultName() { return \"Enter the category name...\"; }",
"public function get_category()\n {\n return 'New Features';\n }",
"public function get_category()\n {\n return 'New Features';\n }",
"public function getFormCategory()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->category));\n\t}",
"public function getCategoryName()\n {\n $oCategory = $this->getCategory();\n\n if ($oCategory instanceof oxCategory) {\n return $oCategory->getTitle();\n }\n\n return null;\n }",
"public function get_category()\n {\n return 'Information Display';\n }",
"public function getCategoryNameAttribute()\n {\n if (isset($this->category) and $this->category) {\n return $this->category->title;\n }\n\n return;\n }",
"public function getCategory() {\n return $this->randomQuote->category_name;\n }",
"public function getCategoryNameAttribute()\n {\n $categoryString = '';\n $categories = $this->categories()->first();\n if (!empty($categories) && $categories->parent_category()) {\n $categoryString = $categories->parent_category->title . ',';\n }\n if (!empty($categories)) {\n $categoryString .= $categories->title;\n }\n return $categoryString;\n }",
"public function get_category()\n {\n return 'Graphical';\n }",
"public function get_category()\n {\n return 'Graphical';\n }",
"public function getCategoryNameAttribute()\n {\n return $this->category->name ?? '';\n }",
"public function getCategoryName(): ?string\n {\n return $this->categoryName;\n }",
"public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}",
"function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}",
"function alaya_cat_name($cate_ID){\n\t$current_cat = get_category($cate_ID);\n\t$cate_name = $current_cat->name;\n\t$cate_name = apply_filters('alaya_cat_name', $cate_name);\n\treturn $cate_name;\n}",
"public function getCategoryDescription() {\n //as part of a search in a gridview, that is why we are returning it\n //only if not empty\n if (!empty($this->idCategoria)) {\n return $this->idCategoria;\n }\n return $this->_categoryDescription;\n }",
"public function getAdditionalCategoryComment()\n {\n return '<p>' . __('Additional variables available') . ': [category], [categories], [store_name], [website_name]<br>' .\n '<p><font color = \"#ea7601\">' . __('Note: The variables [category] and [categories] should be used when categories are added in product path only to avoid duplicates in meta tags') . '.</font>';\n }",
"function getCategoryNameById($cat_id) {\n $ci = & get_instance();\n $category = $ci->crud->get(ES_PRODUCT_CATEGORIES, array('id' => $cat_id));\n if (count($category) > 0) {\n return $category['name'];\n } else {\n return \"Not available\";\n }\n}",
"public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }",
"public function product_name($name,$category)\n {\n $pro_name = $this->Dbmodel->get_product_name($name,$category); \n return $pro_name;\n }",
"public static function getStorageName()\n {\n return 'nb_commerce_product_category';\n }",
"public function getCategoryId(): string\n {\n return $this->categoryId;\n }",
"public function token_the_category() {\n\t\treturn implode( ', ', wp_list_pluck( (array)get_the_category(), 'name' ) );\n\t}",
"function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }",
"function wp_getCategoryName($catID){\n\n\t$catOptions=get_option('rss_import_categories');\n\tif(!empty($catOptions)){\n\t\t$idnum='cat_name_'.$catID;\n\t\t$rssmi_cat_name=(isset($catOptions[$idnum]) ? $catOptions[$idnum] : null);\t\n\t\treturn\t$rssmi_cat_name;\n\t}\n}",
"public function getCategoria()\n {\n return \"Cliente com Risco\";\n }",
"public function getNom_cat()\n {\n return $this->nom_cat;\n }",
"public function getCategoria()\n {\n return \"Cliente com alta credibilidade\";\n }",
"public function getDisplayName()\n {\n return tc('IpAccessControlCategory', $this->name);\n }",
"private function getClassCategory($root) {\n\t\treturn \"Science\";\n\t}",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function getName()\n {\n return 'category_form';\n }",
"public function getCategory(): string;",
"public static function getCategory()\n {\n return self::$category;\n }",
"public function __toString()\n {\n return $this->categoryName;\n }",
"function primary_category_name() {\n\n\tglobal $post_id;\n\t$term = get_the_terms( $post_id, 'primary-category' );\n\tif ( ! $term ) {\n\t\treturn;\n\t} else {\n\t\techo $term[0]->name;\n\t}\n\n}",
"public function translateCategory($lc)\n {\n return $this->LC_CATEGORIES[$lc];\n }",
"private function _getCategoryFieldName()\n\t{\n\t\tif ($this->_categoryFieldName == null) {\n\t\t\t$this->_categoryFieldName = $this->getVar('category_field_name', 'categories');\n\t\t}\n\t\treturn $this->_categoryFieldName;\n\t}",
"public function getVideoCategoryNameAttribute()\n {\n $categoryString = '';\n $categories = $this->categories()->first();\n if (!empty($categories)) {\n $categoryString = $categories->title;\n }\n return $categoryString;\n }",
"private function retrieve_category() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$cat = $this->get_terms( $this->args->ID, 'category' );\n\t\t\tif ( $cat !== '' ) {\n\t\t\t\t$replacement = $cat;\n\t\t\t}\n\t\t}\n\n\t\tif ( ( ! isset( $replacement ) || $replacement === '' ) && ( isset( $this->args->cat_name ) && ! empty( $this->args->cat_name ) ) ) {\n\t\t\t$replacement = $this->args->cat_name;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function get_name() {\n return get_string('pluginname', 'local_categorycreate');\n }",
"public function getOptionCategoryTitle()\n {\n return $this->optionCategoryTitle;\n }",
"public function category(){\n\t\t$_error = \"Select Category\";\n\t\treturn $_error;\n\t}",
"function superfood_elated_woocommerce_category_html_part($class_name = '') {\n\t\tglobal $product;\n\t\t\n\t\t$html = '';\n\t\t$product_categories = wc_get_product_category_list($product->get_id(), ', ');\n\n\t\tif (!empty($product_categories)) {\n\t\t\t\n\t\t\t$html = '<h6 class=\"eltdf-'.esc_attr($class_name).'-category\">'.$product_categories.'</h6>';\n\t\t}\n\t\t\n\t\treturn $html;\n\t}",
"function get_catname($cat_id)\n {\n }",
"function get_cat_name($cat_id)\n {\n }",
"protected function getFirstCategory() {\r\n\t\treturn $this->newsItem->getFirstCategory()->getTitle();\r\n\t}",
"public function categoryDisplayName($category = '')\n {\n $categories = $this->allCategories();\n\n if (array_key_exists($category, $categories)) {\n return $categories[$category];\n } else {\n return '';\n }\n }",
"public function getCategoria()\n {\n return \"Cliente padrão\";\n }",
"public function swc_homepage_product_categories_description() {\n\t\t$description = get_theme_mod( 'swc_homepage_category_description', '' );\n\n\t\tif ( '' !== $description ) {\n\t\t\techo '<div class=\"swc-section-description\">' . wpautop( wptexturize( $description ) ) . '</div>';\n\t\t}\n\t}",
"function cah_news_get_category_name($cat_ID) {\r\n $response = cah_news_get_rest_body('categories/' . $cat_ID);\r\n if ($response) {\r\n return $response->name;\r\n }\r\n}",
"public function getSource()\n {\n return 'product_category';\n }",
"public function getCategory(){\r\n return Mage::registry('current_category');\r\n }",
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}",
"public static function code($category) {\n\t\treturn strtolower(substr($category['displayName'], 0, 2));\n\t}",
"public function getDefaultCategory(): string|null;",
"public function getCategory()\n {\n }",
"public function getCategory($name);",
"public function getMainCategoryTypeStringAttribute(){\n return __('default.other.main_category_types.'.$this->main_category_type);\n }",
"function getCategoryName($categoryId)\n {\n // include the name retriever class and retrieve the category name\n require_once(\"class_libraries/NameRetriever.php\");\n $nameRetriever = new NameRetriever(\"category_id\");\n \n // retrieve the name\n $categoryName = $nameRetriever -> getName($categoryId);\n \n return $categoryName;\n }",
"function getCategoryClass()\n {\n global $category_class;\n \n if ($category_class) {\n // nothing\n } elseif ($category = get_constructor_category()) {\n if (sizeof($category) > 0)\n $category_class = 'category-' .join(' category-', $category);\n } else {\n $category_class = '';\n }\n \n return $category_class;\n }",
"public function getCategoryColor()\n {\n switch ($this->category) {\n case self::CATEGORY_IMAGE:\n return 'warning';\n case self::CATEGORY_AUDIO:\n return 'primary';\n case self::CATEGORY_VIDEO:\n return 'danger';\n }\n\n return 'default';\n }",
"private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}",
"public function get_category()\n {\n return C__CATG__INVOICE;\n }",
"public function getCategory(): string|null;",
"public function getAllCategoryNames();",
"public function getCategoryName($category_value)\n {\n $category_name='';\n $categories=explode(\",\",$category_value);\n $categories_array=$this->_arrayDb->loadArrayv2(\"EP_ARTICLE_CATEGORY\", $this->_lang);\n $cnt=0;\n foreach($categories as $category)\n {\n if($cnt==4)\n break;\n $category_name.=$categories_array[$category].\", \";\n $cnt++;\n }\n $category_name=substr($category_name,0,-2);\n return $category_name;\n }",
"public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}",
"function getCategoryName($categoryID)\n {\n return $this->data->getCategoryName($categoryID);\n }",
"function get_category() {\n return self::CATEGORY_CLUSTER;\n }",
"public function getName()\n\t{\n\t\treturn $this->cat_data['neve'];\n\t}",
"public function getCategory() {}",
"public static function getCategoryDescription() {\n global $lC_Database, $lC_Language, $current_category_id;\n \n $Qcategory = $lC_Database->query('select categories_description from :table_categories_description where categories_id = :categories_id and language_id = :language_id');\n $Qcategory->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategory->bindInt(':categories_id', $current_category_id);\n $Qcategory->bindInt(':language_id', $lC_Language->getID());\n $Qcategory->execute();\n \n $output = '';\n if ($Qcategory->value('categories_description') != '') {\n $output .= $Qcategory->value('categories_description');\n }\n \n return $output;\n }",
"public function getCategory()\n {\n if (!$this->_category) {\n $this->_category = Mage::registry('current_category');\n }\n return $this->_category;\n }",
"public function getKey()\n {\n return $this->getValue('nb_commerce_product_category_key');\n }",
"public function appCategory()\n {\n return File::get_app_category($this->getExtension());\n }",
"function static_cat_name() {\n global $wp;\n $current_url = home_url(add_query_arg(array(),$wp->request));\n if (stripos($current_url, 'th') !== false) {\n return 'posts-th';\n } else {\n return 'posts';\n }\n}",
"public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }",
"public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getTabLabel()\n {\n return __('Import Categories');\n }",
"public function name()\n\t{\n\t\treturn $this->lang->words['stock'];\n\t}"
] | [
"0.7914706",
"0.74377656",
"0.74061257",
"0.73059916",
"0.72884464",
"0.72068703",
"0.7170048",
"0.7143993",
"0.70875216",
"0.7063811",
"0.70516044",
"0.70138085",
"0.70138085",
"0.70138085",
"0.6877625",
"0.68625176",
"0.6844249",
"0.6844249",
"0.6834082",
"0.68192506",
"0.677563",
"0.6739281",
"0.667171",
"0.6638733",
"0.66152334",
"0.66152334",
"0.6572915",
"0.6532991",
"0.645303",
"0.64528",
"0.64488643",
"0.6416051",
"0.6405409",
"0.639271",
"0.6376335",
"0.6327571",
"0.63268256",
"0.6320848",
"0.6281428",
"0.6281314",
"0.6267544",
"0.62538344",
"0.6242805",
"0.6213841",
"0.6205566",
"0.617593",
"0.61682826",
"0.61656415",
"0.6147187",
"0.613864",
"0.61373633",
"0.61186874",
"0.61161125",
"0.610481",
"0.6102406",
"0.6075933",
"0.6059119",
"0.60454065",
"0.604039",
"0.60367364",
"0.6036396",
"0.60332626",
"0.60285246",
"0.60156465",
"0.6007142",
"0.5982708",
"0.59769404",
"0.59768844",
"0.59739256",
"0.59475476",
"0.59444994",
"0.59396654",
"0.59241945",
"0.5922776",
"0.5915743",
"0.5901477",
"0.5870978",
"0.5864714",
"0.5862844",
"0.5858813",
"0.5858066",
"0.58558446",
"0.58488035",
"0.58467644",
"0.58459973",
"0.583731",
"0.58367693",
"0.58329403",
"0.5832759",
"0.5823113",
"0.5818408",
"0.5817519",
"0.5811307",
"0.58032066",
"0.5798787",
"0.57965",
"0.57945806",
"0.57945806",
"0.5778823",
"0.57777125"
] | 0.6646814 | 23 |
Probability score for the category recommendation. | public function getConfidence()
{
if (is_null($this->confidence)) {
/** @psalm-var ?float $data */
$data = $this->raw(self::FIELD_CONFIDENCE);
if (is_null($data)) {
return null;
}
$this->confidence = (float) $data;
}
return $this->confidence;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateProbabilities() {\r\n\t\tApp::import('Model', 'LilBlogs.NbWordfreq'); $this->NbWordfreq = new NbWordfreq();\r\n\t\t$freqTable = $this->NbWordfreq->table;\r\n\t\tif (!empty($this->NbWordfreq->tablePrefix)) $freqTable = $this->NbWordfreq->tablePrefix.$freqTable;\r\n \t// first update the word count of each category\r\n \t\t$data = $this->query(\"SELECT category_id, SUM(count) AS total FROM \".$freqTable.\" GROUP BY category_id\", false);\r\n $total_words = 0;\r\n foreach ($data as $f) {\r\n $total_words += $f[0]['total'];\r\n }\r\n\r\n if ($total_words == 0) {\r\n $this->updateAll(array('word_count'=>0, 'probability'=>0));\r\n return true;\r\n }\r\n \r\n foreach ($data as $f) {\r\n $proba = $f[0]['total']/$total_words;\r\n $this->updateAll(array('word_count'=>$f[0]['total'], 'probability'=>$proba), array('id'=>$f[$freqTable]['category_id']));\r\n }\r\n return true;\r\n\t}",
"public function tokenProbability($token, $category)\n {\n // how many times this word has occurred in documents mapped to this category\n $wordFrequencyCount = 0;\n if (isset($this->wordFrequencyCount[$category][$token])) {\n $wordFrequencyCount = $this->wordFrequencyCount[$category][$token];\n }\n\n // what is the count of all words that have ever been mapped to this category\n $wordCount = $this->wordCount[$category];\n\n // use laplace Add-1 Smoothing equation\n\n return ($wordFrequencyCount + 1) / ($wordCount + $this->vocabularySize);\n }",
"public function getPopularityCoeff()\n {\n $nbRates = count($this->getRates());\n $nbCommentaries = count($this->getCommentaries());\n $avg = $this->getAvgRate();\n return ($nbRates + $nbCommentaries) * $avg;\n }",
"public function getVoteParticipation($categoryId)\n\t{\n\t\t$voterCount=User::model()->getVoterCountInCategory($categoryId);\n\t\t$votesInCat=Vote::model()->count('category_id = :category_id', array('category_id'=>$categoryId));\n\t\treturn $voterCount > 0 ? round(((100*$votesInCat)/($voterCount))) : 0;\n\t}",
"abstract public function score();",
"public function calculate()\n\t{\n\t\t$this->sold();\n\t\t$this->rank();\n\t\t$this->feedback();\n\t\t$this->storeActive();\n\t\t$this->cod();\n\t\t$this->accountAge();\n\t\t$this->imageCount();\n\n\t\treturn $this->score;\n\t}",
"public function illustrationScore()\n {\n return $this->setRightOperand(PVar::ILLUSTRATION_SCORE);\n }",
"public function getCATotalAttribute()\n {\n return $this->ca_test_score + $this->ca_exam_score;\n }",
"private function calcDiscountPercent()\n\t{\n\t if( $this->db->table_exists($this->c_table)) $record = $this->db->query(\"select * from {$this->c_table} where products_count<=? and order_amount<=? order by discount_percent desc\",array($this->products_count,$this->order_amount))->row_array();\n\t if(!@$record) return 0;\n\t return $record['discount_percent'];\n\t}",
"public function score(): int;",
"public function probabilities($text)\n {\n $that = $this;\n $probabilities = [];\n\n if ($that->totalDocuments > 0) {\n $tokens = ($that->tokenizer)($text);\n $frequencyTable = $that->frequencyTable($tokens);\n\n // for this text\n // iterate thru our categories to find the one with max probability\n foreach ($that->categories as $category => $value) {\n $categoryProbability = $that->docCount[$category] / $that->totalDocuments;\n $logProbability = log($categoryProbability);\n foreach ($frequencyTable as $token => $frequencyInText) {\n $tokenProbability = $that->tokenProbability($token, $category);\n\n // determine the log of the P( w | c ) for this word\n $logProbability += $frequencyInText * log($tokenProbability);\n }\n\n $probabilities[$category] = $logProbability;\n }\n }\n\n return $probabilities;\n }",
"public function getAvancement()\n {\n\n $usecases = $this->getUseCases();\n $diviseur = 0;\n $val = 0;\n foreach ($usecases as $usecase) {\n $diviseur = $diviseur + $usecase->poids;\n $val = $val + ($usecase->poids * $usecase->avancement);\n }\n $resultat = $val / $diviseur;\n\n return $resultat;\n }",
"function score()\r\n {\r\n return $this->Score;\r\n }",
"public function UpdateScore() {\n\t\t$this->score = self::ComputeScore( $this->goods, $this->bads );\n\t\t$this->tier = self::GetTier( $this->score );\n\t\treturn $this->score;\n\t}",
"public function vocScore();",
"public static function ComputeScore( $goods, $bads ) {\t\n\t\t$total = $goods+$bads;\n\t\tif( $total == 0 ) return self::BASE_SCORE;\n\t\t$r = (float)Config::$SCORERAMPCONST;\n\t\t\n\t\t$a = min( $total / $r, 1.0 );\n\t\t\n\t\t$sc = round( (float)self::BASE_SCORE * (1.0-$a) + ($goods*99.0/$total) * $a );\n\t\t\n\t\tif( $sc == 99 ) { \n\t\t\t// legendary always needs at least 100 votes.\n\t\t\tif( $total < 100 ) {\n\t\t\t\treturn 98;\n\t\t\t}\n\t\t}\n\t\treturn $sc;\n\t}",
"public function getScore();",
"public function getScore($title){\n $stmt = $this->conn->prepare( 'SELECT rating FROM reviews WHERE title = :title' );\n $stmt->bindParam ( ':title', $title );\n $stmt->execute ();\n $stmt->fetch ();\n $stmh = $this->conn->prepare( 'SELECT rating FROM reviews WHERE title = :title AND rating = \"FRESH\"' );\n $stmh->bindParam ( ':title', $title );\n $stmh->execute ();\n $stmh->fetch ();\n if($stmh->rowCount () == 0)\n return 0;\n else\n return (int) ($stmh->rowCount () / $stmt->rowCount () * 100);\n }",
"public function score()\n {\n $this->score++;\n }",
"public function getDiscountPercent() {\n return $this->item->getDiscountPercent();\n }",
"public function getDiscountPercent()\n\t{\n\t\treturn $this->discount_percent;\n\t}",
"public function getAverageRatingAsPercentageAttribute() : float\n {\n return $this->averageRatingAsPercentage();\n }",
"public function categoryPercentage($val)\n {\n return $this->options(['categoryPercentage' => $val]);\n }",
"private function recommendation($skill){\n $recommendationPoint=0;\n $recommendationPointMaster=0;\n $recommendationPointFive=0;\n $recommendationPointFour=0;\n $recommendationPointThree=0;\n $recommendationPointTwo=0;\n $recommendationPointOne=0;\n $recommendations=$skill->recommendations;\n foreach($recommendations as $recommendation){\n $recommendator=$recommendation->user;\n $rate=$recommendator->rate;\n if($recommendator->is('influencer')){\n $recommendationPointMaster+=Config::get('rate')['recommendation']['attributes']['master']['value'];\n if($recommendationPointMaster>=Config::get('rate')['recommendation']['attributes']['master']['max_value']){\n $recommendationPointMaster=Config::get('rate')['recommendation']['attributes']['master']['max_value'];\n }\n }elseif($rate==5){\n $recommendationPointFive+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFive>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFive=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==4){\n $recommendationPointFour+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFour>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFour=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==3){\n $recommendationPointThree+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointThree>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointThree=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==2){\n $recommendationPointTwo+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointTwo>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointTwo=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==1){\n $recommendationPointOne+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointOne>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointOne=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }\n $recommendationPoint=$recommendationPointMaster+$recommendationPointFive+$recommendationPointFour+$recommendationPointThree+$recommendationPointTwo+$recommendationPointOne;\n }\n //finalize the recommendation calculation points\n if($recommendationPoint>Config::get('rate')['recommendation']['result'][5]){ //5 star\n $calculatedRecommendationPoint=5;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][4] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][5]){ //4 star\n $calculatedRecommendationPoint=4;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][3] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][4]){ //3 star\n $calculatedRecommendationPoint=3;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][2] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][3]){ //2 star\n $calculatedRecommendationPoint=2;\n }elseif($recommendationPoint>=Config::get('rate')['recommendation']['result'][1] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][2]){ //1 star\n $calculatedRecommendationPoint=1;\n }else{ //none star\n $calculatedRecommendationPoint=1;\n }\n $finalRecommendationPoint=$calculatedRecommendationPoint*Config::get('rate')['recommendation']['weight'];\n return $finalRecommendationPoint;\n }",
"public function getScore()\n {\n return $this->score;\n }",
"public function getScore()\n {\n return $this->score;\n }",
"public function getScore()\n {\n return $this->score;\n }",
"public function getScore()\n {\n return $this->score;\n }",
"function scoreLifeExpectancy(){\n //Find the life expectancy based on province and gender, assign a score to that expectancy.\n $userProvince=$_POST[\"province\"];\n $userGender=$_POST[\"gender\"];\n $url = 'data/life-expectancy.json';\n $JSON = file_get_contents($url);\n $life_ex = json_decode($JSON);\n foreach ($life_ex as $category) {\n if($category->SEX == $userGender && $category->GEO == $userProvince){\n switch($userGender){\n case \"Males\":\n $baseline=68.5;\n break;\n case \"Females\":\n $baseline=73.5;\n break;\n }\n $age = $category->Value;\n }\n }\n $points=10+($age-$baseline)*.77;\n return $points;\n}",
"private function randomNumberOfDisabilities() {\n $numDis = 1;\n $probNumDis = rand(0, 100);\n if ($probNumDis > -1 && $probNumDis < 59) {\n // 61% chances for having 1 dis\n $numDis = 1;\n } else if ($probNumDis > 59 && $probNumDis < 79) {\n // 30% chances for having 2 dis\n $numDis = 2;\n } else if ($probNumDis > 79 && $probNumDis < 94) {\n // 15% chances for having 3 dis\n $numDis = 3;\n } else if ($probNumDis > 94 && $probNumDis < 99) {\n // 5% chances for having 4 dis\n $numDis = 4;\n } else if ($probNumDis > 99) {\n // 1% chances for having 5 dis\n $numDis = 5;\n }\n return $numDis;\n }",
"private function calcTraitScores() {\n # scale trait scores based on trip purpose\n $traitScore = ($this->purposeForTravel == 'Vacation') ? self::TRAIT_SCORE \n : self::TRAIT_SCORE*.75; \n \n foreach ($this->cities as $city){\n $score = 0; \n foreach($this->perfectCity as $desiredCityTrait) {\n if (in_array($desiredCityTrait, $city['Vacation'])) {\n $score += $traitScore; \n }\n }\n if($this->purposeForTravel == 'Permanent') {\n foreach($this->perfectCity as $desiredCityTrait) {\n if(in_array($desiredCityTrait, $city['Permanent']))\n $score += $traitScore; \n }\n }\n $this->traitScores[] = $score; \t\n }\n }",
"public function categorize($text)\n {\n $that = $this;\n $maxProbability = -INF;\n $chosenCategory = null;\n\n if ($that->totalDocuments > 0) {\n $probabilities = $that->probabilities($text);\n\n // iterate thru our categories to find the one with max probability\n // for this text\n foreach ($probabilities as $category => $logProbability) {\n if ($logProbability > $maxProbability) {\n $maxProbability = $logProbability;\n $chosenCategory = $category;\n }\n }\n }\n\n return $chosenCategory;\n }",
"private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }",
"public function getPercentageDiscountPrice()\n {\n return $this->percentage_discount_price . ' %';\n }",
"function history_scoring($queried_comp_ids)\n {\n $user_history_cats = $this->input->post('history'); \n\n /* echo \"<br><br>user history cats: <br>\";\n echo \"<pre>\";\n print_r($user_history_cats);\n echo \"</pre>\"; */ \n \n //$this->output->enable_profiler(TRUE);\n \n //get all the companies (that meet the previous criteria) and their associated benefits\n $sql2 = 'SELECT company_id,category_id FROM company_category WHERE company_id IN ('.$queried_comp_ids.')';\n $query2 = $this->db->query($sql2);\n\n //$user_history_cats = implode(',', $user_history_cats); \n \n //build an array with a specific format to be used in the upcoming scoring process\n $company_set = array();\n foreach ($query2->result_array() as $row) {\n $company_set[$row['company_id']][]=$row['category_id'];\n }\n \n /*echo \"<br><br>history category array pre-scoring: <br>\";\n echo \"<pre>\";\n print_r($company_set);\n echo \"</pre>\"; */\n \n \n $scores = array();\n // For every company, we will assign it a score based on how many\n // of the user's category choices it has. Each category is worth 1 point.\n \n foreach($company_set as $company_id => $array_row)\n { \n $score = 0;\n foreach ($array_row as $key=>$category_id)\n {\n //we walk through the array that contains each company's categories\n //then, we search for each category in the user's choices. if we find\n //a match, we give the company a point. and so on...\n \n if (in_array($category_id, $user_history_cats, true)){\n ++$score;\n }\n \n }\n //added the following line to limit max score to 1\n if ($score >1){$score=1;}\n //end of added line\n $scores[$company_id] = $score;\n\n }\n \n arsort($scores);\n /*\n echo \"<br>history category scoring: <br>\";\n print_r($scores);\n */\n return $scores;\n }",
"public function likedPercentage(): string\r\n {\r\n if (count($this->userRatings) < 1) return \"0.00%\";\r\n $count = 0;\r\n foreach ($this->userRatings as $rating)\r\n {\r\n if ($rating >= 5) $count++;\r\n }\r\n return number_format(($count / count($this->userRatings)) * 100, 2) . \"% of users that rated \\\"$this->title\\\" liked this movie.\";\r\n }",
"public function _getCalculatedScore() {\n\t\treturn $this->_calculatedScore;\n\t}",
"public function getCoverageScore()\n {\n return $this->coverage_score;\n }",
"public function getAvgRating()\n {\n $sum =0;\n foreach($this->comments as $comment)\n {\n $sum = $sum + $comment->getRating() ;\n }\n\n if(count($this->comments)) return $sum/count($this->comments);\n\n return 0 ;\n }",
"public function getScoreSum()\n\t{\n\t\treturn (float) $this->score_mc + $this->score_case;\n\t}",
"public function noiseScore();",
"function returnOutcome($precipProbability){\n $outcome = \"\";\n if($precipProbability < 0.05) {\n $outcome = \"Yes! 😎\";\n } else if($precipProbability >= 0.05 && $precipProbability < 0.1){\n $outcome = \"Maybe 🤔\";\n } else {\n $outcome = \"Nope 😔\";\n }\n\n return $outcome;\n}",
"public function scores()\n {\n $outputScores = [];\n foreach ($this->scores as $categoryId => $score) {\n if ($score == 0) continue;\n $outputScores[config('categories')[$categoryId]['name']] = $score;\n }\n\n arsort($outputScores);\n $outputScores = array_slice($outputScores,0,6);\n\n return $outputScores;\n }",
"protected function feedback()\n\t{\n\t\tif ($this->store['feedback_percent'] == 0) {\n\t\t\treturn;\n\t\t}\n\t\t$feedback = $this->store['feedback'] * $this->config->data()['feedback'];\n\t\t$feedbackPercent = ($this->store['feedback_percent'] / $this->config->data()['feedbackPercent']);\n\t\t$score = round($feedback / $feedbackPercent);\n\t\t$this->score += $score;\n\t}",
"private function score_alcohol_use() {\t\t\t\t\t\t//&&& no alcohol use section in scoring\r\n\t\t$data = $this->data['alcohol_use'];\r\n\t\tif($this->demographics['gender']==\"M\"){\r\n\t\t\t$q39=$this->scoreValue(array(5,4,3,2,1),$data['q39']);\r\n\t\t}else{\r\n\t\t\t$q39=$this->scoreValue(array(5,3,1,1,1),$data['q39']);\r\n\t\t}\r\n\t\t$q40=$this->scoreValue(array(1,5),$data['q40']);\r\n\t\t$ob=new stdClass();\r\n\t\t$ob->total=0;\r\n\t\t$ob->data=array('q39'=>array($q39,.6),\r\n\t\t\t\t\t\t'q40'=>array($q40,.4));\r\n\r\n\t\tforeach($ob->data as &$rec){\r\n\t\t\t$rec[2] = $rec[0] * $rec[1];\r\n\t\t\t$ob->total += $rec[2];\r\n\t\t}\r\n\t\treturn $ob;\r\n\t}",
"public function getPositiveFeedbackPercent()\n {\n return $this->positiveFeedbackPercent;\n }",
"public function getScore(): int\n {\n return $this->score;\n }",
"function getScore($weight_adjusted = TRUE) {\n if ($this->is_skipped) {\n return 0;\n }\n if (!isset($this->score)) {\n $this->score = $this->score();\n }\n if (isset($this->question->score_weight) && $weight_adjusted) {\n return round($this->score * $this->question->score_weight);\n }\n return $this->score;\n }",
"public function getConfidence()\n {\n return $this->confidence;\n }",
"public function getConfidence()\n {\n return $this->confidence;\n }",
"public function getScore() : int{\n return $this->score;\n }",
"function scoreBMI(){\n //Find the BMI of the user, and compare that to others.\n $userGender=$_POST[\"gender\"];\n $calcHeight=($_POST[\"height-ft\"] * 12)+$_POST[\"height-in\"];\n $userHeight=$calcHeight*2.54/100;\n $userWeight=($_POST[\"weight\"]*0.453592);\n\n $userBMI=$userWeight / pow($userHeight,2);\n if($userBMI < 18.5){\n $BMIpoints=7.5;\n } elseif($userBMI > 18.5 && $userBMI < 24.9){\n $BMIpoints=20;\n } elseif($userBMI > 24.9 && $userBMI < 29.9){\n $BMIpoints=10;\n } elseif($userBMI > 29.9){\n $BMIpoints=5;\n }\n return $BMIpoints;\n $url = 'data/bmi.json';\n $JSON = file_get_contents($url);\n $BMI = json_decode($JSON);\n foreach ($BMI as $category) {\n if($category->SEX == $userGender && $category->GEO == $userProvince){\n switch($userGender){\n case \"Males\":\n $baseline=68.5;\n break;\n case \"Females\":\n $baseline=73.5;\n break;\n }\n }\n }\n}",
"public function co2Score();",
"public function getFeedbackScore()\n {\n return $this->feedbackScore;\n }",
"public function getPercentual() {\n return $this->nPercentual;\n }",
"public function getTotalDiscount(): float;",
"private function score_preventative_health(){\r\n\t\t$data = $this->data['preventative_health'];\r\n\t\t$today = strtotime(date('Y-m').\"-01\");\r\n\r\n\t\t$q8 = $this->scoreValue(array(5,1), $data['q8']);\r\n\r\n\t\tif($data['q11'] != \"0000-00-00\"){\r\n\t\t\t$date = $data['q11'];\r\n\t\t\tlist($year, $month, $day) = explode('-', $date);\r\n\t\t\tif (($month == \"00\") && ($year != \"0000\")) {\r\n\t\t\t\t$month = \"01\";\r\n\t\t\t}\r\n\t\t\t$q11=mktime(0, 0, 0, $month, \"01\", $year);\r\n\t\t\t$q11=ceil(($today-$q11)/(60*60*24*365));\r\n\t\t\tswitch($q11){\r\n\t\t\t\tcase 1: $q11=5;break;\r\n\t\t\t\tcase 2: $q11=4;break;\r\n\t\t\t\tcase 3: $q11=2;break;\r\n\t\t\t\tdefault: $q11=1;break;\r\n\t\t\t}\t\t\t\t\r\n\t\t}else{\t\t\t\r\n\t\t\t$q11=1;\r\n\t\t}\r\n\r\n\t\t$q12=$this->scoreValue(array(5,1),$data['q12']);\r\n\t\tif ($data['q13'] > 0) {\r\n\t\t\t$q13=$this->scoreValue(array(5,1,5),$data['q13']);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$q13 = 5;\r\n\t\t}\r\n\r\n\t\tif($this->demographics['gender']==\"F\"){\r\n\t\t\tif($data['q14'] != \"0000-00-00\"){\r\n\t\t\t\t$date = $data['q14'];\r\n\t\t\t\tlist($year, $month, $day) = explode('-', $date);\r\n\t\t\t\tif (($month == \"00\") && ($year != \"0000\")) {\r\n\t\t\t\t\t$month = \"01\";\r\n\t\t\t\t}\r\n\t\t\t\t$q14=mktime(0, 0, 0, $month, \"01\", $year);\r\n\t\t\t\t$q14=ceil(($today-$q14)/(60*60*24*365));\r\n\t\t\t\tswitch($q14){\r\n\t\t\t\t\tcase 1: $q14=5;break;\r\n\t\t\t\t\tcase 2: $q14=4;break;\r\n\t\t\t\t\tcase 3: $q14=2;break;\r\n\t\t\t\t\tdefault: $q14=1;break;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif ($this->demographics['age'] < 21) {\r\n\t\t\t\t\t$q14=5;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$q14=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$q15=$this->scoreValue(array(5,1),$data['q15']);\r\n\t\t\tif ($data['q16'] > 0) {\r\n\t\t\t\t$q16=$this->scoreValue(array(5,1,3),$data['q16']);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$q16 = 5;\r\n\t\t\t}\r\n\r\n\t\t\tif($data['q17'] != \"0000-00-00\"){\r\n\t\t\t\t$date = $data['q17'];\r\n\t\t\t\tlist($year, $month, $day) = explode('-', $date);\r\n\t\t\t\tif (($month == \"00\") && ($year != \"0000\")) {\r\n\t\t\t\t\t$month = \"01\";\r\n\t\t\t\t}\r\n\t\t\t\t$q17=mktime(0, 0, 0, $month, \"01\", $year);\r\n\t\t\t\t$q17=ceil(($today-$q17)/(60*60*24*365));\r\n\t\t\t\tswitch($q17){\r\n\t\t\t\t\tcase 1: $q17=5;break;\r\n\t\t\t\t\tcase 2: $q17=4;break;\r\n\t\t\t\t\tcase 3: $q17=2;break;\r\n\t\t\t\t\tdefault: $q17=1;break;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif ($this->demographics['age'] < 40) {\r\n\t\t\t\t\t$q17 = 5;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$q17=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$q14=0;\r\n\t\t\t$q15=0;\r\n\t\t\t$q16=0;\r\n\t\t\t$q17=0;\r\n\t\t}\r\n\r\n\t\tif($this->demographics['gender']==\"M\"){\r\n\t\t\t$q18=$this->scoreValue(array(5,1,5),$data['q18']);\r\n\t\t\t$q19=$this->scoreValue(array(5,1,5),$data['q19']);\r\n\r\n\t\t\tif($data['q20'] != \"0000-00-00\"){\r\n\t\t\t\t$date = $data['q20'];\r\n\t\t\t\tlist($year, $month, $day) = explode('-', $date);\r\n\t\t\t\tif (($month == \"00\") && ($year != \"0000\")) {\r\n\t\t\t\t\t$month = \"01\";\r\n\t\t\t\t}\r\n\t\t\t\t$q20=mktime(0, 0, 0, $month, \"01\", $year);\r\n\t\t\t\t$q20=ceil(($today-$q20)/(60*60*24*365));\r\n\t\t\t\tswitch($q20){\r\n\t\t\t\t\tcase 1: $q20=5;break;\r\n\t\t\t\t\tcase 2: $q20=4;break;\r\n\t\t\t\t\tcase 3: $q20=2;break;\r\n\t\t\t\t\tdefault: $q20=1;break;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif ($q19 == 1) {\r\n\t\t\t\t\t$q20 = 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($q19 == 3) {\r\n\t\t\t\t\t$q20 = 5;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$q20 = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t$q18=0;\r\n\t\t\t$q19=0;\r\n\t\t\t$q20=0;\r\n\t\t}\r\n\r\n// M - q8 (annual exam)\t\t\t\t\t2/3 of score\r\n// q11 (date of last exam)\r\n// q12 (annual flu shot)\r\n// q13 (colorectal screening)\r\n\r\n// q18 (discussed prostate exam)\t1/3 of score\r\n// q19 (PSA test)\r\n// q20 (date of last PSA test)\r\n\r\n// F - q8 (anual exam)\t\t\t\t\t2/3 of score\r\n// q11 (date of last exam)\r\n// q12 (annual flu shot)\r\n// q13 (colorectal screening)\r\n\r\n// q14 (date of last pap)\t\t1/3 of score\r\n// q15 (ever abnormal pap)\r\n// q16 (ever had mamo)\r\n// q17 (date of last mamo)\r\n\r\n\t\t$ob=new stdClass();\r\n\t\t$ob->total=0;\r\n\t\t$ob->data=array('q8'=>array($q8,0),\r\n\t\t\t\t\t\t'q11'=>array($q11,0),\r\n\t\t\t\t\t\t'q12'=>array($q12,.25),\r\n\t\t\t\t\t\t'q13'=>array($q13,.25),\r\n\t\t\t\t\t\t'q14'=>array($q14,.17),\r\n\t\t\t\t\t\t'q15'=>array($q15,.17),\r\n\t\t\t\t\t\t'q16'=>array($q16,.16),\r\n\t\t\t\t\t\t'q17'=>array($q17,0),\r\n\t\t\t\t\t\t'q18'=>array($q18,.25),\r\n\t\t\t\t\t\t'q19'=>array($q19,.25),\r\n\t\t\t\t\t\t'q20'=>array($q20,0)\r\n\t\t);\t\t\t\t\t\t\t\r\n\t\tforeach($ob->data as &$rec){\r\n\t\t\t$rec[2]=$rec[0]*$rec[1];\r\n\t\t\t$ob->total+=$rec[2];\r\n\t\t}\r\n\t\treturn $ob;\r\n\t}",
"public function averageRatingAsPercentage() : float\n {\n $range = config('rateable.minimum') > 0 ? config('rateable.maximum') - config('rateable.minimum') : config('rateable.maximum');\n return ($this->ratings()->count() * $range) != 0 ? $this->sumRating() / ($this->ratings()->count() * $range) * 100 : 0;\n }",
"public function evaluate(State $state): int\n {\n return $state->score();\n }",
"public function getAccumulatedScore()\n {\n return $this->score;\n }",
"public function getAccumulatedScore()\n {\n return $this->score;\n }",
"protected function get_probality( ) {\n// depending on the temperature, Heat Index or Wind Chill Temperature is calculated.\n// Format is tt/dd where tt = temperature and dd = dew point temperature. All units are\n// in Celsius. A 'M' preceeding the tt or dd indicates a negative temperature. Some\n// stations do not report dew point, so the format is tt/ or tt/XX.\n\n if (preg_match('#^PROB([0-9]{2})#',$this->current_group_text,$pieces)) {\n $this->tend++;\n $this->wxInfo['ITEMS'][$this->tend]['CODE_PROBABILITY'] = $this->current_group_text;\n $this->wxInfo['ITEMS'][$this->tend]['PROBABILITY'] = $pieces[1];\n $this->tend--;\n $this->current_ptr++;\n $this->current_group++;\n return;\n }\n\n $this->current_group++;\n\n }",
"function get_question_correct_perc($req_ID) {\n global $myPDO;\n\n // The query to get the IDs of hard questions\n $statement = $myPDO->prepare(\"\n SELECT\n (COUNT( CASE `Correct` WHEN 1 THEN `Correct` END ) / COUNT( * )) *100 AS 'correct_perc'\n FROM\n `rdtom_responses`\n WHERE\n `Question_ID` = :Question_ID\n \");\n\n $statement->bindValue(':Question_ID', $req_ID);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n\n return $result['correct_perc'];\n}",
"public function uvScore();",
"function benefits_scoring($queried_comp_ids)\n {\n $user_benefits_array = $this->input->post('users_benefits'); \n\n //get all the companies (that meet the previous criteria) and their associated benefits\n $sql2 = 'SELECT company_id,benefits_id FROM company_benefits WHERE company_id IN ('.$queried_comp_ids.')';\n $query2 = $this->db->query($sql2);\n \n //build an array with a specific format to be used in the upcoming scoring process\n $company_set = array();\n foreach ($query2->result_array() as $row) {\n $company_set[$row['company_id']][]=$row['benefits_id'];\n }\n\n $scores = array();\n // For every company, we will assign it a score based on what benefits it has\n // and how the user ranked that benefit. Higher ranks are more valuable, so the highest\n // total score wins.\n foreach($company_set as $company_id => $array_row)\n { \n $score = 0;\n foreach ($array_row as $key=>$benefit_id)\n {\n //this line grabs the user's ranking for the benefit_id that this particular company has\n //and assigns it to the score variable. this will be added to the scores matrix\n //and a tally will be kept for each company. \n //KEY POINT: The benefit that is most desired has the highest rank value. For example,\n // if there are 10 options, the user's most desired benefit has a rank of 10. The least\n // desired has a rank of 1.\n \n $score += $user_benefits_array[$benefit_id]['rank'];\n }\n $scores[$company_id] = $score;\n\n }\n \n arsort($scores);\n /*echo \"<br><br>benefits scores: <br>\";\n echo \"<pre>\";\n print_r($scores);\n echo \"</pre>\";*/\n \n return $scores;\n }",
"protected function doCalculateCategoryPosition($collection)\n {\n $result = 0;\n if (count($collection)) {\n foreach ($collection as $userAnswer) {\n if (($question = $userAnswer->getQuestion())) {\n if (($countPointMax = $question->getCountPointMax()) > 0) {\n $result += round($userAnswer->getCountPoint() * 100 / $countPointMax);\n }\n }\n return $result / count($collection);\n }\n }\n return 0;\n }",
"public function getAverageConfidence(): float\n {\n return RoadDamageReport::where('roaddamage_id', $this->id)\n ->avg('confidence');\n }",
"public function getScore()\n {\n }",
"private function score_family_health(){\r\n\t\t$data=$this->data['family_health'];\r\n\t\t$q10=0;\r\n\t\tfor ($x = 1; $x <= 6; $x++){\r\n\t\t\tif($data[\"q10_\".$x] == 0) continue;\r\n\t\t\tif($data[\"q10_\".$x] == 2) continue;\r\n\t\t\t$q10++;\r\n\t\t}\r\n\t\tif ($q10 > 4) $q10=1;\r\n\t\telse if\t($q10 == 4) $q10 = 2;\r\n\t\telse if ($q10 == 3) $q10 = 3;\r\n\t\telse if ($q10 == 2) $q10 = 4;\r\n\t\telse if ($q10 == 1) $q10 = 4;\r\n\t\telse if ($q10 == 0) $q10 = 5;\r\n\t\telse $q10 = 0;\r\n\t\t\r\n\t\t$ob=new stdClass();\r\n\t\t$ob->total=$q10;\r\n\t\t$ob->data=array('q10'=>array($q10,1,$q10));\r\n\t\treturn $ob;\r\n\t}",
"public function iaqScore();",
"public function rating()\n {\n $rating = Review::where('product_id', $this->id)->avg('rating');\n if ($rating) {\n $rating = (float)$rating;\n $rating = round($rating, 2);\n } else {\n $rating = 0;\n }\n return $rating;\n }",
"public function getWeightPercentageForScore( Score $score )\n {\n switch( $score->getMark() )\n {\n case Score::YES:\n case Score::NOT_APPLICABLE: return 100;\n case Score::ACCEPTABLE: return 50;\n case Score::NO: break;\n }\n return 0;\n }",
"public function getMatchedPercent(){\n return $this->percentage;\n }",
"public function getVotesPercentage()\n {\n if ($this->votesPercentage) {\n return $this->votesPercentage;\n }\n\n if ($this->question->getTotalVotes() > 0) {\n return $this->votesPercentage = round($this->votes / $this->question->getTotalVotes() * 100);\n }\n\n return 0;\n }",
"public function getSamplePercentage()\n {\n return $this->sample_percentage;\n }",
"public function getScore()\r\n\t{\r\n\t\treturn $this->root->getAttribute('score');\r\n\t}",
"public function calcRating(){\n //opponents winning percentage\n $owp = 0.0;\n //oppponents opponents winning percentage\n $oowp = 0.0;\n //total number of opponents opponents\n $numOfOppOpps = 0;\n \n for($i=0; $i<$this->numOfOpponents; $i++){\n $opp = $this->teamsPlayed[$i];\n $owp += $opp->getWP();\n for($j=0; $j<$opp->numOfOpponents; $j++){\n \t$oppOpp = $opp->getOpponentByIndex($j);\n \t$oowp += $oppOpp->getWP();\n \t$numOfOppOpps++;\n } \n }\n if($owp == 0 || $this->numOfOpponents == 0){\n $owp = 0;\n } else {\n $owp = $owp/$this->numOfOpponents;\n }\n if($oowp == 0 || $numOfOppOpps == 0){\n $oowp == 0;\n } else {\n $oowp = $oowp/$numOfOppOpps;\n }\n $this->rating = ($this->getWP() *0.25) +\n \t\t ($owp * 0.50) +\n \t\t ($oowp *0.25);\n }",
"public function getPercentageRating($product,$count)\n {\n\n $reviews = DB::table('feedbacks')\n ->where(['approved'=>'1','feedbackable_type'=>'App\\Inventory','feedbackable_id'=>$product])\n ->select('rating', DB::raw('count(*) as total'))\n ->groupBy('rating')\n ->orderBy('rating','desc')\n ->get();\n\n $totalReviews = $count;\n\n for ($i = 5; $i >= 1; $i--) {\n if (! $reviews->isEmpty()) {\n foreach ($reviews as $review) {\n if ($review->rating == $i) {\n $percentage[$i] = round(($review->total / $totalReviews) * 100);\n\n break;\n } else {\n $percentage[$i] = 0;\n }\n }\n } else {\n $percentage[$i] = 0;\n }\n }\n return $percentage;\n }",
"public function getPercentual()\n {\n return $this->percentual;\n }",
"protected function compute(): void\n {\n $election = $this->getElection();\n $score = [];\n\n foreach (array_keys($election->getCandidatesList()) as $oneCandidateKey) {\n $score[$oneCandidateKey] = 0;\n }\n\n foreach ($election->getVotesManager()->getVotesValidUnderConstraintGenerator() as $oneVote) {\n $CandidatesRanked = 0;\n $oneRanking = $oneVote->getContextualRankingWithCandidateKeys($election);\n\n foreach ($oneRanking as $oneRank) {\n $rankScore = 0.0;\n foreach ($oneRank as $oneCandidateInRank) {\n $rankScore += $this->getScoreByCandidateRanking($CandidatesRanked++, $election);\n }\n\n foreach ($oneRank as $oneCandidateInRank) {\n $score[$oneCandidateInRank] += ($rankScore / \\count($oneRank)) * $oneVote->getWeight($election);\n }\n }\n }\n\n array_walk($score, static fn (float &$sc): float => $sc = round($sc, self::DECIMAL_PRECISION));\n ksort($score, \\SORT_NATURAL);\n arsort($score, \\SORT_NUMERIC);\n\n $rank = 0;\n $lastScore = null;\n $result = [];\n foreach ($score as $candidateKey => $candidateScore) {\n if ($candidateScore === $lastScore) {\n $result[$rank][] = $candidateKey;\n } else {\n $result[++$rank] = [$candidateKey];\n $lastScore = $candidateScore;\n }\n }\n\n $this->Stats = $score;\n $this->Result = $this->createResult($result);\n }",
"static function predict($dataByClassMapping, $inputRowData) {\n\t\t$probByClass = self::calculate_prob_by_class($dataByClassMapping, $inputRowData);\n\t\t$className = \"\";\n\t\t$bestProb = -1;\n\n\t\tforeach ($probByClass as $item) {\n\t\t\tif((empty($className) && $className != 0)|| $item[1] > $bestProb) {\n\t\t\t\t$className = $item[0];\n\t\t\t\t$bestProb = $item[1];\n\t\t\t}\n\t\t}\n\n\t\treturn $className;\n\t}",
"public function getPercentage()\n {\n return $this->percentage;\n }",
"public function getCommentPopularity()\n {\n $total = $this->getLikes() + $this->getDislikes();\n if ($total) {\n $popularity = 100 * ($this->getLikes()\n / ($this->getLikes() + $this->getDislikes()));\n return round($popularity);\n } else {\n return 0;\n }\n }",
"function calc_dream_mp_score_a($db, $dreamid, $personid) {\n global $pwpdo;\n $query = \"select pw_vote.vote as mpvote, pw_dyn_dreamvote.vote as dreamvote from\n pw_vote, pw_dyn_dreamvote, pw_division, pw_mp where\n pw_vote.division_id = pw_division.division_id and\n pw_dyn_dreamvote.division_number = pw_division.division_number and\n pw_dyn_dreamvote.division_date = pw_division.division_date\n and pw_vote.mp_id = pw_mp.mp_id\n and pw_mp.person = ? and pw_dyn_dreamvote.dream_id = ?\";\n\n $qrowarray=$pwpdo->fetch_all_rows($query,array($personid,$dreamid));\n $t = 0.0;\n $c = 0.0;\n foreach ($qrowarray as $qrow)\n {\n $weight = 1;\n $mpvote = $qrow['mpvote'];\n $mpvote = str_replace(\"tell\", \"\", $mpvote);\n $dreamvote = $qrow['dreamvote'];\n if ($dreamvote == \"aye3\" or $dreamvote == \"no3\") {\n $dreamvote = str_replace(\"3\", \"\", $dreamvote);\n $weight = 3;\n }\n $t += $weight;\n\n if ($mpvote == $dreamvote)\n $c += $weight;\n elseif ($mpvote == \"both\" or $dreamvote == \"both\")\n $c = $c + ($weight / 2);\n }\n\n return array($c, $t);\n}",
"function getSuccessProbabilityOutcomes($game_id, $round_number, $company_id){\r\n\t\t\t$success=new Model_DbTable_Games_Evolution_Np_NewProducts();\r\n\t\t\t$round_next=$round_number+1;\r\n\t\t\t$products=$this->getProducts($game_id);\r\n\t\t\tforeach ($products as $product) {\r\n\t\t\t\t$probability=($success->getSuccessProbability($game_id, $company_id, $round_next, $product['product_number']))*100;\r\n\t\t\t\tif ($probability==null){\r\n\t\t\t\t\t$probability=0;\r\n\t\t\t\t}\r\n\t\t\t\t$results['product_number_'.$product['product_number']]=$probability;\r\n\t\t\t}\r\n\t\t\treturn $results;\r\n\t\t}",
"private function _getScore($nCoolType, $strCpid)\r\n\t{\r\n//\t\t$arrScore = $scoreRecord->searchCpidScore($nCoolType, $strCpid);\r\n//\t\tif($arrScore === false){\r\n//\t\t\tLog::write('CoolShowSearch::getScore():searchCpidScore() failed', 'log');\r\n//\t\t\treturn false;\r\n//\t\t}\r\n//\r\n//\t\t$nOverall = 0;\r\n//\t\t$nStar1 = 0;\r\n//\t\t$nStar2 = 0;\r\n//\t\t$nStar3 = 0;\r\n//\t\t$nStar4 = 0;\r\n//\t\t$nStar5 = 0;\r\n//\t\t$nTotal = 0;\r\n//\t\t$nTotalScore = 0;\r\n//\t\tforeach ($arrScore as $s){\r\n//\t\t\t$nScore = isset($s['score'])?$s['score']:0;\r\n//\t\t\t$nCount = isset($s['count'])?$s['count']:0;\r\n//\r\n//\t\t\tif( 9 <= $nScore){\r\n//\t\t\t\t$nStar5 += $nCount;\r\n//\t\t\t}\r\n//\t\t\tif(7 <= $nScore && $nScore <= 8){\r\n//\t\t\t\t$nStar4 += $nCount;\r\n//\t\t\t}\r\n//\t\t\tif(5 <= $nScore && $nScore <= 6){\r\n//\t\t\t\t$nStar3 += $nCount;\r\n//\t\t\t}\r\n//\t\t\tif(3 <= $nScore && $nScore <= 4){\r\n//\t\t\t\t$nStar2 += $nCount;\r\n//\t\t\t}\r\n//\t\t\tif($nScore <= 2){\r\n//\t\t\t\t$nStar1 += $nCount;\r\n//\t\t\t}\r\n//\r\n//\t\t\t$nTotalScore += $nScore * $nCount;\r\n//\t\t\t$nTotal += $nCount;\r\n//\t\t}\r\n//\t\tif ($nTotal != 0){\r\n//\t\t\t$nOverall = round($nTotalScore/$nTotal, 1);\r\n//\t\t\t$nStar1 = (int)($nStar1/$nTotal*100);\r\n//\t\t\t$nStar2 = (int)($nStar2/$nTotal*100);\r\n//\t\t\t$nStar3 = (int)($nStar3/$nTotal*100);\r\n//\t\t\t$nStar4 = (int)($nStar4/$nTotal*100);\r\n//\t\t\t$nStar5 = (int)($nStar5/$nTotal*100);\r\n//\t\t}\r\n\r\n\t\t$score = new ScoreProtocol();\r\n\t\t//$score->setScore($nOverall, $nTotal, $nStar1, $nStar2, $nStar3, $nStar4, $nStar5);\r\n\t\treturn $score;\r\n\t}",
"public function score(){\r\n\t\t$scores=array();\r\n\t\t\r\n\t\tif($this->gina){\r\n\t\t\t$scores['current_health_status']=array($this->score_current_health_status(),.09);\r\n\t\t\t//$scores['family_health']=array($this->score_family_health(),\t\t\t\t0);\r\n\t\t\t$scores['preventative_health']=array($this->score_preventative_health(),\t.06);\r\n\t\t\t$scores['weight_nutrition']=array($this->score_weight_nutrition(),\t\t\t.18);\r\n\t\t\t$scores['physical_activity']=array($this->score_physical_activity(),\t\t.18);\r\n\t\t\t$scores['stress_management']=array($this->score_stress_management(),\t\t.07);\r\n\t\t\t$scores['mental_health']=array($this->score_mental_health(),\t\t\t\t.045);\r\n\t\t\t$scores['alcohol_use'] = array($this->score_alcohol_use(), .045);\r\n\t\t\t$scores['self_care']=array($this->score_self_care(),\t\t\t\t\t\t.08);\r\n\t\t\t$scores['tobaco_use']=array($this->score_tobaco_use(),\t\t\t\t\t\t.18);\r\n\t\t\t$scores['readiness_to_change']=array($this->score_readiness_to_change(),\t0);\r\n\t\t\t$scores['biometric_data']=array($this->score_biometric_data(),\t\t\t\t0);\r\n\t\t}else{\r\n\t\t\t$scores['current_health_status']=array($this->score_current_health_status(),.09);\r\n\t\t\t$scores['family_health']=array($this->score_family_health(),\t\t\t\t0);\r\n\t\t\t$scores['preventative_health']=array($this->score_preventative_health(),\t.06);\r\n\t\t\t$scores['weight_nutrition']=array($this->score_weight_nutrition(),\t\t\t.18);\r\n\t\t\t$scores['physical_activity']=array($this->score_physical_activity(),\t\t.18);\r\n\t\t\t$scores['stress_management']=array($this->score_stress_management(),\t\t.07);\r\n\t\t\t$scores['mental_health']=array($this->score_mental_health(),\t\t\t\t.045);\r\n\t\t\t$scores['alcohol_use'] = array($this->score_alcohol_use(), .045);\r\n\t\t\t$scores['self_care']=array($this->score_self_care(),\t\t\t\t\t\t.08);\r\n\t\t\t$scores['tobaco_use']=array($this->score_tobaco_use(),\t\t\t\t\t\t.18);\r\n\t\t\t$scores['readiness_to_change']=array($this->score_readiness_to_change(),\t0);\r\n\t\t\t$scores['biometric_data']=array($this->score_biometric_data(),\t\t\t\t0);\r\n\t\t}\r\n\r\n\t\t$total=0;\r\n\t\tforeach($scores as &$score){\r\n\t\t\t$score[2]=$score[0]->total*$score[1];\r\n\t\t\t$total+=$score[2];\r\n\t\t}\r\n\t\t\r\n\t\t$scores['total']=$total*20;\r\n\t\treturn $scores;\t\t\r\n\t}",
"public function positivePercent(){\n\t\treturn round($this->positive*100/($this->positive+$this->negative+$this->indeterminate), 2);\n\t}",
"private function get_discount_percentage() : float {\n\t\tpreg_match( '/runParams\\.discount=\"(.*?)\";/si', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn floatval( $matches[1] );\n\t}",
"public static function computeRatingPrediction(){\n $itemRatingPredictionArray = array();\n $sim_Rating_product =self::$sim_Rating_product;\n $simSummation= self::$simSummation;\n foreach ($sim_Rating_product as $key => $value) {\n if($simSummation[$key] != 0){\n $itemRatingPredictionArray[$key]= to2Decimal($value/$simSummation[$key]);\n }\n\n }\n arsort($itemRatingPredictionArray);\n RootMeanSquareEstimation::computeRootMeanSqEst($itemRatingPredictionArray);\n return $itemRatingPredictionArray;\n }",
"public function getCalculatedPrioAttribute()\n\t{\n\t\t$level = self::userCurrentLevel();\n\t\t$prio = ($level +1) * $this->prio;\n\t\tif ($this->vip) {\n\t\t\t$prio *= 5; \n\t\t}\n\t\tif ($this->taskPersonal_id == Auth::id()) {\n\t\t\t$prio *=2;\n\t\t}\n\t\tif (!is_null($this->timeCustomercallback)) {\n\t\t\t$prio /=6;\n\t\t}\n\t\tif ($this->waitingForCustomer) {\n\t\t\t$prio /=9;\n\t\t}\n\t\tif ($this->paused) {\n\t\t\t$prio /=11;\n\t\t}\n\t\t$minutes = self::minutesToCallback();\n\t\tif ($minutes<0) {\n\t\t\t$prio *= -$minutes;\n\t\t}\n\t\tif (!is_null($this->timeClosed)) {\n\t\t\t$prio = 0;\n\t\t}\n\t\treturn $prio;\n\t}",
"public function getPageRating()\n {\n $rating = 0;\n\n if (!$this->owner->PageFeedbackEntries()->count()) {\n return $rating;\n }\n\n $stack = [];\n\n /** @var PageFeedbackEntry $feedback */\n foreach ($this->owner->PageFeedbackEntries() as $feedback) {\n $stack[] = (int)$feedback->Rating;\n }\n\n return round(array_sum($stack) / count($stack), 1);\n }",
"public function getDiscount(): int\n {\n return $this->discount;\n }",
"public function getPermanency(){\r\n\t\treturn $this->permanency;\r\n\t}",
"function randomRatingCategory($candidates)\n{\n\t$index = 0;\n\t$groupIndex = 0;\n\t$randomNum = 0;\n\t$chosenGroup = array(); /* group of recipe IDs to return (by chosen rating value) */\n\t\n\t$randomNum = rand(1, 100);\n\t\n\t//assign required recipe IDs to 4-star rating group (if group chosen)\n\tif ($randomNum <= 3)\n\t{\n\t\t//traverse to 4-star ratings in sorted rating array\n\t\twhile (1)\n\t\t{\n\t\t\t//traverse to 4.5-star ratings in sorted rating array\n\t\t\tif ($candidates[$index][1] < 3.75)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (($candidates[$index][1] < 4.25) && ($candidates[$index][1] >= 3.75))\n\t\t\t{\n\t\t\t\t$chosenGroup[$groupIndex] = $candidates[$index][0];\n\t\t\t\t\t\n\t\t\t\t$groupIndex++;\n\t\t\t}\n\t\t\t\t\n\t\t\t$index++;\n\t\t}\n\t}\n\t\n\t//assign required recipe IDs to 4.5-star rating group (if group chosen)\n\tif (($randomNum >= 4) && ($randomNum <= 33))\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\t//traverse to 4.5-star ratings in sorted rating array\n\t\t\tif ($candidates[$index][1] < 4.25)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (($candidates[$index][1] < 4.75) && ($candidates[$index][1] >= 4.25))\n\t\t\t{\n\t\t\t\t$chosenGroup[$groupIndex] = $candidates[$index][0];\n\t\t\t\t\t\n\t\t\t\t$groupIndex++;\n\t\t\t}\n\t\t\t\t\n\t\t\t$index++;\n\t\t}\n\t}\n\t\n\t//assign required recipe IDs to 5-star rating group (if group chosen)\n\tif ($randomNum >= 34)\n\t{\n\t\t//already begins at 5-star ratings\n\t\twhile (1)\n\t\t{\n\t\t\tif ($candidates[$index][1] < 4.75)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\telse \n\t\t\t{\n\t\t\t\t$chosenGroup[$groupIndex] = $candidates[$index][0];\n\t\t\t\t\n\t\t\t\t$index++;\n\t\t\t\t$groupIndex++;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $chosenGroup;\n}",
"private function paper($skill){\n $count=[];\n $paperPoint=0;\n $calculatedPaperPoint=0;\n\n //checking for papers\n foreach($skill->papers as $key=>$paper){ //get all the books and articles for the specified skill\n $countLike=$paper->num_like;\n $countDisLike=$paper->num_dislike;\n if($paper->type==2){ //the paper is book\n $count[$key]=$countLike*Config::get('rate')['paper']['attributes']['book']['like']-($countDisLike*Config::get('paper')['attributes']['book']['dislike']);\n $count[$key]+=Config::get('rate')['paper']['attributes']['book']['book'];\n }elseif($paper->type==1){ //the paper is article\n $count[$key]=$countLike*Config::get('rate')['paper']['attributes']['article']['like']-($countDisLike*Config::get('paper')['attributes']['article']['dislike']);\n $count[$key]+=Config::get('rate')['paper']['attributes']['article']['article'];\n }\n }\n $paperPoint=array_sum($count);\n if($paperPoint>Config::get('rate')['paper']['result'][5]){ //5 star paper\n $calculatedPaperPoint=5;\n }elseif($paperPoint>Config::get('rate')['paper']['result'][4] && $paperPoint<=Config::get('rate')['paper']['result'][5]){\n $calculatedPaperPoint=4;\n }elseif($paperPoint>Config::get('rate')['paper']['result'][3] && $paperPoint<=Config::get('rate')['paper']['result'][4]){\n $calculatedPaperPoint=3;\n }elseif($paperPoint>Config::get('rate')['paper']['result'][2] && $paperPoint<=Config::get('rate')['paper']['result'][3]){\n $calculatedPaperPoint=2;\n }elseif($paperPoint>=Config::get('rate')['paper']['result'][1] && $paperPoint<=Config::get('rate')['paper']['result'][2]){\n $calculatedPaperPoint=1;\n }\n $finalPaperPoint=$calculatedPaperPoint*Config::get('rate')['paper']['weight'];\n return $finalPaperPoint;\n\n }",
"public function getTotalAttribute()\n {\n return $this->ca_test_score + $this->ca_exam_score;\n }",
"public function luxScore();",
"public function averageRating() : float\n {\n return $this->ratings()->exists() ? $this->ratings()->avg('rating') : 0;\n }",
"function getProportional() {return $this->_proportional;}",
"public function getTotalScore()\n {\n $score = 0;\n for ($i = 1; $i <= 3; $i++) {\n $score += $this->getBaseScoreForShot($i) * $this->getMultiplierForShot($i);\n }\n\n return $score;\n }"
] | [
"0.6382101",
"0.5864762",
"0.564101",
"0.55721265",
"0.55614066",
"0.54149026",
"0.5389419",
"0.5271628",
"0.5268445",
"0.5262058",
"0.5241159",
"0.52387077",
"0.5187566",
"0.5184866",
"0.5183988",
"0.5182937",
"0.51759905",
"0.5130408",
"0.51261747",
"0.5113062",
"0.5106066",
"0.509812",
"0.5089648",
"0.5081086",
"0.5078295",
"0.5078295",
"0.5078295",
"0.5078295",
"0.5075478",
"0.5060682",
"0.50481915",
"0.5038423",
"0.50376695",
"0.5032308",
"0.5014656",
"0.50111604",
"0.5010715",
"0.50086117",
"0.49984604",
"0.49979472",
"0.49773878",
"0.4974036",
"0.49624044",
"0.49594706",
"0.49541706",
"0.49516556",
"0.4936481",
"0.49221563",
"0.49131832",
"0.49131832",
"0.49009722",
"0.48950553",
"0.48899883",
"0.48840994",
"0.48819783",
"0.48790213",
"0.4863404",
"0.4862826",
"0.48620436",
"0.48580456",
"0.48580456",
"0.48466364",
"0.48429802",
"0.48386046",
"0.48349327",
"0.483024",
"0.48260653",
"0.48216054",
"0.48205805",
"0.48180252",
"0.48109683",
"0.48103738",
"0.48094374",
"0.47926125",
"0.47893235",
"0.4775585",
"0.47733906",
"0.47661665",
"0.47656462",
"0.47633207",
"0.4759437",
"0.4754843",
"0.47502875",
"0.47376075",
"0.47350097",
"0.472993",
"0.47297046",
"0.47177497",
"0.47176155",
"0.4711473",
"0.47075102",
"0.47054213",
"0.47039938",
"0.47018716",
"0.4693467",
"0.46923372",
"0.46849957",
"0.46818966",
"0.46789533",
"0.46746916",
"0.46713683"
] | 0.0 | -1 |
echo $idc . ' ' . $idp . ' ' . $newComment; | function validComment($newComment, $idc, $idp)
{
/* $oldComment = modifComment($oldComment);
$newComment = modifComment($newComment);
require('view/frontend/editCommentView.php');*/
validModifComment($newComment, $idc);
header('Location: index.php?action=post&id=' . $idp);
// echo $idp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildRecentComments($comments) {\n foreach($comments as $comment){\n echo \"<div class=\\\"panel-body\\\">\\n\n <p>$comment[1] on <a href=\\\"/phase5/pages/info.php?id=$comment[4]\\\">$comment[3]</a></p>\\n\n <p class=\\\"well\\\">$comment[0]</p>\\n\n </div>\\n\";\n }\n}",
"function generateComment(&$eventData, $comment)\n {\n $eventData['comment'] = \"-- $comment --<br>\\n\" . $eventData['comment'];\n }",
"function OutputComment() {\n\t\t$pagecomment = trim($this->shortDescription) ? PrepString($this->shortDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->longDescription) ? PrepString($this->longDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->tags) ? \"<i>\".PrepString($this->tags).\"</i>\" : \"\";\n\t\t$pagecomment = $pagecomment ? $pagecomment : \"<i>(Undocumented)</i>\";\n\t\t$pagecomment = \"<div class='pagecomment'>$pagecomment</div>\";\n\t\treturn $pagecomment;\n\t}",
"function echo_comment_id( $comment_id ) {\n\techo 'Comment ID ' . $comment_id . ' could not be found';\n}",
"function get_comment_ID()\n {\n }",
"public function record_comment(){\n\t\t\t\n\t\t}",
"function getComments($conn){\r\n $sql = \"SELECT * FROM comments ORDER BY cid DESC LIMIT 20\";\r\n $result = $conn->query($sql);\r\n while ($row = $result->fetch_assoc()){\r\n echo \"<div class='comment-box'><p>\";\r\n echo $row['uid'].\"<br>\";\r\n echo $row['date'].\"<br>\";\r\n echo nl2br($row['message']);\r\n echo \"</p></div>\";\r\n }\r\n \r\n}",
"function showComments($postId){\n $user = getUserIdPost($postId);\n $commentIds = getCommentIdsofPost($postId);\n\n\n # displays Comments\n foreach ($commentIds as $commentId) {\n\n printComment($commentId);\n\n }\n\n # new Comment Input Form \n ?>\n <form method=\"POST\">\n <input type=\"hidden\" name=\"postId\" value=\"<?php echo $postId; ?>\">\n <input type=\"hidden\" name=\"user\" value=\"<?php echo $user; ?>\">\n <input type=\"hidden\" name=\"url\" value=\"<?php echo parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH); ?>\">\n <input class=\"inputComment\" type=\"text\" name=\"newCommentText\" maxlength=150 placeholder=\"Comment...\">\n <button class=\"submitComment\" type=\"submit\" name=\"newCommentSubmit\">></button>\n </form>\n\n <?php\n\n}",
"function plc_comment_display( $comment_to_display ) {\n\n\t// Put the single quotes back in\n\t$comment_to_display = str_replace( ''', \"'\", $comment_to_display );\n\n\treturn $comment_to_display;\n}",
"function showComments()\n\t{\n $qry = mysql_query(\"SELECT * FROM `comments` \n WHERE '\" . $this->ytcode .\"' = `youtubecode`\n ORDER BY upload_date DESC\n LIMIT 0,4 \");//DEFAULT: Comments shown=3\n if (!$qry)\n die(\"FAIL: \" . mysql_error());\n\n $html = '';\n while($row = mysql_fetch_array($qry))\n {\n \n $com_user=$row['com_user'];\n $com_user = str_replace('\\\\','',$com_user);\n $comment_dis=$row['com_dis'];\n $comment_dis = str_replace('\\\\', '', $comment_dis);\n $date = new DateTime($row['upload_date']);\n\n $html .= '<p class=\"comment-p\">\n <span class=\"userName\">' . $com_user . '</span>\n <span class=\"divider\">//</span>\n <time datetime=\"' . $date->format('Y-m-d') .'\">'.\n $date->format('d/m/y g:i a')\n .'</time> : '. $comment_dis .'\n </p>'; \n }\n \n return $html;\n\t}",
"public function displayComments()\n {\n global $lexicon;\n $lexicon = new Lexicon(COMMENTIA_LEX_LOCALE);\n\n global $roles;\n $roles = new Roles();\n\n /**\n * Iterates through each comment recursively, and appends it to the var holding the HTML markup.\n *\n * @param array $comment An array containing all the comment data\n */\n\n foreach ($this->comments as $comment) {\n if (isset($this->comments['ucid-'.$comment['ucid']])) {\n $this->renderCommentView($comment['ucid']);\n unset($this->comments['ucid-'.$comment['ucid']]);\n }\n }\n\n if ($_SESSION['__COMMENTIA__']['member_is_logged_in']) {\n $this->html_output .= ('<div class=\"commentia-new_comment_area\">'.\"\\n\".'<h4>'.TITLES_NEW_COMMENT.'</h4>'.\"\\n\".'<textarea id=\"comment-box\" oninput=\"autoGrow(this);\"></textarea>'.\"\\n\".'<button id=\"post-comment-button\" onclick=\"postNewComment(this);\">'.COMMENT_CONTROLS_PUBLISH.'</button>'.\"\\n\".'</div>'.\"\\n\");\n }\n\n return $this->html_output;\n }",
"function comment_ID()\n {\n }",
"function warquest_home_comment_edit_do() {\r\n\r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\t\t \r\n\t/* output */\r\n\tglobal $page;\r\n\t\t\t\r\n\tif ($uid!=0) {\r\n\t\t$query = 'select comment from comment where id='.$uid;\r\n\t\t$result = warquest_db_query($query);\r\n\t\t$data = warquest_db_fetch_object($result);\r\n\t\t\r\n\t\t$comment = $data->comment;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t/* Clear input parameters */\r\n\t\t$comment = \"\";\r\n\t}\r\n\t\r\n\t$page .= \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">function limitText(limitField, limitNum) { if (limitField.value.length >= limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } </script>\";\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\t\r\n\t\r\n\t$page .= '<table>';\r\n\t$page .= '<tr>';\r\n\t$page .= '<td width=\"500\">';\r\n\r\n\tif (isset($other->pid)) {\r\n\t\t$tmp = player_format($other->pid, $other->name, $other->country);\r\n\t} else {\r\n\t\t$tmp = t('GENERAL_ALL');\r\n\t}\r\n\t$page .= t('ALLIANCE_COMMENT_TEXT2', $tmp).'<br/>'; \r\n\t\r\n\t$page .= '<textarea style=\"width:100%\" id=\"comment\" name=\"comment\" rows=\"5\" ';\r\n\t$page .= 'onKeyDown=\"limitText(this,400)\">'.$comment.'</textarea><br/>';\r\n\t$page .= warquest_show_smilies();\r\n\t$page .= '<br/><br/>';\r\n\t\r\n\tif (isset($other->pid)) {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&oid='.$other->pid.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t} else {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t}\r\n\t\r\n\tif ($uid!=0) {\r\n\t\t$page .= ' ';\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_DELETE.'&uid='.$uid, t('LINK_DELETE'), 'delete');\r\n\t}\r\n\t\r\n\t$page .= '</td>';\r\n\t$page .= '</tr>';\r\n\t$page .= '</table>';\r\n\r\n\t$page .= '</div>';\t\r\n}",
"function caldol_modify_author_display_name($author_name, $reply_id){\n\t$author_name = $author_name . \"\";\nreturn $author_name;\n\n}",
"function get_comment_to_edit($id)\n {\n }",
"function edit_comment($comment)\n {\n }",
"function separate_comments(&$comments)\n {\n }",
"function comment_sample($comment_sample, $comment) {\r\n\t\tglobal $db;\r\n\t\t$query = \"UPDATE samples SET\r\n\t\t\tcomment='\".$comment.\"'\r\n\t\t\tWHERE sample_id='\".$comment_sample.\"'\r\n\t\t\";\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t\r\n\t\treturn 'Sample was updated successfuly.';\t\r\n\t}",
"function add_comment($replier, $code, $feed_code) {\n\t\techo '<form target = \"targetframe\" action=\"comment/reply.php\" method=\"post\" enctpye=\"\" name=\"new_comment\">'\n\t\t.'<div class = \"cut-line\"></div>'\n\t\t\t\t.'<input type=\"hidden\" name=\"par_code\" value=\"'.$code.'\" />'\n\t\t\t\t.'<input type=\"hidden\" name=\"feed_code\" value=\"'.$feed_code.'\" />'\n\t\t\t\t.'<textarea class=\"text_cmt form-control message\" name=\"text_cmt\" placeholder=\"Reply to '.$replier.'\"></textarea><br />'\n\t\t\t\t.'<input type=\"submit\" class = \"btn btn-primary pull-right\" value=\"Reply\" />'\n\t\t\t.'</form>';\n\t}",
"public function comm($c){\n\t\t$this->comment = $c;\n\t}",
"function info($output)\n{\n output(\"<comment>$output</comment>\");\n}",
"function displaycomments(){\nif(isset($_POST['vid'])){$this->presentation_url = safeAddSlashes($_POST['vid']);}else{$this->presentation_url = safeAddSlashes($_GET['vid']);}\nif(isset($_POST['lead_comment_author'])){$this->lead_comment_author = safeAddSlashes($_POST['lead_comment_author']);}else{$this->lead_comment_author = safeAddSlashes($_GET['lead_comment_author']);}\nif(isset($_POST['comment_author'])){$this->comment_author = safeAddSlashes($_POST['comment_author']);}else{$this->comment_author = safeAddSlashes($_GET['comment_author']);}\n//database connection begins\nrequire('database/connx.php');\n\n$db = & new MySQL($host,$dbUser,$dbPass,$dbName);\n$sql1=\"select str_name,str_comment,time_pubdate,str_msg_type from comments where str_presentation_url='\" . $this->presentation_url . \"' and str_msg_type='Posted'\" ;\n$result1=$db->query($sql1);\n$this->strcommenthtml3 = \"\";\n$this->strcommenthtml1 = \"<div><div name='no_of_comments'>\" . $result1->size() . \" comments</div>\";\nwhile ($row1 = $result1->fetch()) {\n if($row1['str_msg_type'] == 'Posted'){$this->strcommenthtml2 = \"<div id='msg_type_posted'>\";}\n else{$this->strcommenthtml2 = \"<div id='msg_type_reply'>\";};\n $this->strcommenthtml3 .= $this->strcommenthtml2 . \"<span id='db_comment'>\" . $row1['str_comment'] . \"</span><br/>\" . \"<span id='db_comment_author'>\" . $row1['str_msg_type'] . \" by \" . $row1['str_name'] . \" on \" . $row1['time_pubdate'] . \"</span> <span id='reply'><a href='#postcomment' onclick=\\\"postcomment('reply', '\" . $row1['str_name'] . \"');\\\">Reply</a></span></div>\";\n\n//comment out the reply link\n//$this->strcommenthtml3 .= $this->strcommenthtml2 . \"<span id='db_comment'>\" . $row1['str_comment'] . \"</span><br/>\" . \"<span id='db_comment_author'>\" . $row1['str_msg_type'] . \" by \" . $row1['str_name'] . \" on \" . $row1['time_pubdate'] . \"</span></div>\";\n\n//for each comment, display corresponding replies\n$sql2=\"select str_name,str_comment,time_pubdate,str_msg_type from comments where str_lead_name = '\" . $row1['str_name'] . \"' and str_presentation_url='\" . $this->presentation_url . \"' and str_msg_type='Replied'\";\n//echo $sql2 . \"<p>\";\n$result2=$db->query($sql2);\n$this->strcommenthtml5 = \"\";\n$this->strcommenthtml_1 = \"<div>\";\nwhile ($row2 = $result2->fetch()) {\n if($row2['str_msg_type'] == 'Replied'){$this->strcommenthtml6 = \"<div id='msg_type_reply'>\";}\n else{$this->strcommenthtml7 = \"<div id='msg_type_posted'>\";};\n $this->strcommenthtml5 .= $this->strcommenthtml6 . \"<span id='db_comment'>\" . $row2['str_comment'] . \"</span><br/>\" . \"<span id='db_comment_author'>\" . $row2['str_msg_type'] . \" by \" . $row2['str_name'] . \" on \" . $row2['time_pubdate'] . \"</span> <span id='reply'><a href='#postcomment' onclick=\\\"postcomment('reply', '\" . $row1['str_name'] . \"');\\\">Reply</a></span></div>\";\n\n//comment out the reply link\n//$this->strcommenthtml5 .= $this->strcommenthtml6 . \"<span id='db_comment'>\" . $row2['str_comment'] . \"</span><br/>\" . \"<span id='db_comment_author'>\" . $row2['str_msg_type'] . \" by \" . $row2['str_name'] . \" on \" . $row2['time_pubdate'] . \"</span></div>\";\n }\n$this->strcommenthtml4 = \"</div>\";\n$this->strcommenthtml3 .= $this->strcommenthtml_1 . $this->strcommenthtml5 . $this->strcommenthtml4;\n//end of display of replies\n }\n$this->strcommenthtml4 = \"</div>\";\necho $this->strcommenthtml1 . $this->strcommenthtml3 . $this->strcommenthtml4;\n\n }",
"function recvcommentdata( $parid, $username, $usermessage ) {\n\t\t$this->result = $this->conn->addcomment ( \"x@y\", $parid, $usermessage );\n\t\tif( !$this->result ) {\n\t\t\t$this->outstr .= \"<error>\" . mysql_error() . \"</error>\";\n\t\t\treturn $this->outstr;\n\t\t}\n\t\treturn \"<ok>ok</ok>\";\n\t}",
"static public function upd_comment_stat(object $pp1, array $other=[]): string\n {\n self::$pp1 = $pp1 ;\n if (isset($pp1->shared_dbadapter_obj)) self::$utldb = $pp1->shared_dbadapter_obj ;\n //copy of an already created object can be made by cloning it.\n $uriq = $pp1->uriq ;\n if ('') { echo '<br /><h3>'.__METHOD__ .', line '. __LINE__ .' SAYS:</h3>'\n .'<br />works if redirect commented U R L query array ='.'$u riq=' ;\n if (isset($uriq))\n { echo '<pre>'; print_r($uriq) ; echo '</pre>'; }\n else { echo ' u riq arr. not set<br />' ; } \n //echo '<br />c l a s s name of $dm='.get_class($dm);\n }\n // outputs :\n //c l a s s name of $dm=B12phpfw\\Home_ctr\n //c l a s s name of $Db_post_comment=B12phpfw\\Db_post_comment\n\n $flds = \"SET status=:status, approvedby=:admin\" ;\n $qrywhere = \"WHERE id=:id\" ;\n\n $id = $uriq->id ;\n $stat = $uriq->stat ;\n $binds = [\n ['placeh'=>':status', 'valph'=>$stat, 'tip'=>'str']\n ,['placeh'=>':admin', 'valph'=>$_SESSION[\"adminname\"], 'tip'=>'str']\n ,['placeh'=>':id', 'valph'=>$id, 'tip'=>'int']\n ] ;\n\n $cursor = self::$utldb::uu( self::$tbl, $flds, $qrywhere, $binds );\n\n if ($cursor) {\n if ($stat == 'ON') {$_SESSION[\"MsgSuccess\"]=\"Comment $id approved ! \" ;\n } else {$_SESSION[\"MsgSuccess\"]=\"Comment $id DisApproved ! \" ;}\n }\n else { $_SESSION[\"MsgErr\"]=\"Update Comment $id Went Wrong (Comment approve failed). Try Again !\"; }\n\n /* ?><SCRIPT LANGUAGE=\"JavaScript\">\n alert( \"<?php echo __METHOD__ .', line '. __LINE__ .' SAYS: '\n .'\\\\n $dm->pp1[\\'comments\\']=' \n . (isset($dm->pp1->comments)?$dm->pp1->comments:'NOT SET')\n ; ?>\" \n ) ;\n </SCRIPT><?php */ //works if redirect commented\n //$dm->Redirect_to($dm->pp1->comments);\n return '1';\n }",
"function handle_editcomment($commentid)\n{\n\tdie(\"A hozzászólások nem szerkeszthetőek. A bejegyzések tulajdonosai <a href=\\\"/delcomment/$commentid\\\">törölhetik</a> a hozzászólásokat.\");\n}",
"public function getComment(): string;",
"public function getComment()\n {\n\t$comment = Mage::getSingleton('checkout/session')->getData('customer_comment');\n\tif($comment) {\n\t return htmlspecialchars($comment);\n\t}\n\treturn '';\n }",
"function printID()\n {\n echo str_replace(' ', '', $this->position).substr($this->name, 0,2);;\n }",
"abstract public function comment();",
"function comment_notification_text($notify_message, $comment_id) {\n extract($this->get_comment_data($comment_id));\n if ($comment->comment_type == 'facebook') {\n ob_start();\n $content = strip_tags($comment->comment_content);\n ?>\nNew Facebook Comment on your post \"<?php echo $post->post_title ?>\"\n\nAuthor : <?php echo $comment->comment_author ?> \nURL : <?php echo $comment->comment_author_url ?> \n\nComment:\n\n<?php echo $content ?> \n\nParticipate in the conversation here:\n<?php echo $this->get_permalink($post->ID) ?> \n\n <?php\n return ob_get_clean();\n } else {\n return $notify_message;\n }\n }",
"function get_comments(){\n\n\t}",
"function change_request_comment($comm,$id)\n\t{\n\t\t$data['request_comment'] =$comm;\n\t return $this->db->update('pamm_requests', $data, \"request_id = $id\");\n\t}",
"private function _writeComment()\n {\n $connectionTime = time() - $this->start;\n if ($connectionTime % $this->keepAliveTime === 0) {\n $comment = sprintf(': %s', sha1(mt_rand()) . PHP_EOL);\n\n echo $comment . PHP_EOL;\n }\n }",
"public function message()\n {\n return 'wrong comment id';\n }",
"function tempera_comments_on() {\nglobal $temperas;\nforeach ($temperas as $key => $value) { ${\"$key\"} = $value; }\t\n\tif ( comments_open() && ! post_password_required() && $tempera_blog_show['comments'] && ! is_single()) :\n\t\tprint '<div class=\"comments-link\"><i class=\"icon-comments icon-metas\" title=\"' . __('Comments', 'tempera') . '\"></i>';\n\t\tprintf ( comments_popup_link( __( '<b>0</b>', 'tempera' ), __( '<b>1</b>', 'tempera' ), __( '<b>%</b>', 'tempera' ),(''),__('<b>-</b>','tempera') ));\n\t\tprint '</div>';\n\tendif;\n}",
"protected static function getInfoCommentString($text)\r\n\t{\r\n\t\treturn \"\\n// \" . $text;\r\n\t}",
"function get_comment($comment = \\null, $output = \\OBJECT)\n {\n }",
"public function description(){ return $this->name . \" [\" . $this->ID . \"]\"; }",
"public function formatComment(string $comment): string;",
"function truncate_comment($string) \n{\n\treturn $string[0].$string[1].$string[2].$string[3].$string[4].$string[5].$string[6].$string[7].$string[8].$string[9].$string[10].$string[11].$string[12].$string[13].$string[14].$string[15].$string[16].$string[17].$string[18].$string[19].'...';\n}",
"function truncate_comment($string) \n{\n\treturn $string[0].$string[1].$string[2].$string[3].$string[4].$string[5].$string[6].$string[7].$string[8].$string[9].$string[10].$string[11].$string[12].$string[13].$string[14].$string[15].$string[16].$string[17].$string[18].$string[19].'...';\n}",
"function shop_preprocess_comment(&$vars) {\n $vars['submitted'] = $vars['created'] . ' — ' . $vars['author'];\n}",
"function CIR_writeClientID($clientParams)\n{\nif ($_SESSION['m23Shared'])\n\t$clientID = m23SHARED_getCompleteClientName();\nelse\n\t$clientID = $clientParams['id'];\n\necho(\"\nrm /m23clientID 2> /dev/null\ncat >> /m23clientID << \\\"m23clientIDEOF\\\"\n$clientID\nm23clientIDEOF\n\");\n}",
"public function setComment($newPurchase_comment)\n {\n //if($newPurchase_comment == \"\")\n //{\n // return \"Please enter the purchase comment. It can not be empty.\";\n //}\n //else\n //{\n //Checking if product description has more than the maximum predefined length\n if(mb_strlen($newPurchase_comment) > COMMENT_MAX_LENGTH)\n {\n return \"The purchase comment can not have more than \" . PRODUCT_DESCRIPTION_MAX_LENGTH . \" characters.\";\n }\n else\n {\n $this->purchase_comment = $newPurchase_comment;\n return \"\";\n }\n //} \n }",
"function getDescription() {\r\n\t\treturn 'Lets you determine how many comments to show on item page, what order to show them in and provides pagination of results';\r\n\t}",
"protected function get_formatted_comment(): string\n\t{\n\t\treturn $this->comment ? \"`$this->comment`\" : '';\n\t}",
"public function commentEdit() {\n\t\t$id = $_POST['id'];\n\t\t$c = Comment::find($id);\n\t\techo json_encode($c);\n\t}",
"function comment_connection($comment) {\nglobal $wpdb;\n\n//replace new lines \\n with line breaks <br /> in order to detect comment reference\n$comment = nl2br($comment);\n\n//replace extra spaces after @\n$r = \"@\";\n$s = \"@ \";\n$i = 1;\n$blank = substr_count($comment, $s);\nif ($blank > 0) \n\t$comment = str_replace($s, $r, $comment, $i);\n\n\t//determine if someone is referencing a comment\n\t$count = substr_count($comment, \"@\");\n\n\tif ($count > 0) {\n\n\t\t//find the post ID without printing to screen\n\t\t$pid = get_the_ID();\n\n\t\t//find the comment ID without printing to screen\n\t\t$cid = get_comment_ID();\n\t\n\t\t//this is the big change\n\t\t//determine all occurances of @ and their following authors\n\t\t//then loads into array\n\t\tpreg_match_all(\"/@(.*)(:|\\<br \\/\\>|,|-)/\", $comment, $out);\n\n\t\tforeach ($out[1] as $ref) {\n\t\t\t//solves little problem with colon usage\n\t\t\tif (substr_count($ref, ':') > 0) \n\t\t\t\t$ref = substr($ref, 0, strpos($ref, ':'));\n\t\t\t//solves other little problem with extra spaces\n\t\t\tif (substr_count($ref, ' ') <= 2)\n\t\t\t\t$array[$x] = $ref;\n\n\t\t\t//retrieve comment info from database\n\t\t\t$d = db_query($pid, $cid, $array[$x]);\n\n\t\t\t//replace the authors with their comment IDs\n\t\t\t//don't worry, that extra i there isn't a spelling mistake\n\t\t\t//it simply means that references with the wrong case are still replaced\n\t\t\tif ($d != NULL) {\n\t\t\t\t$replacement = preg_replace('/\\s$/', '', $array[$x]);\n\t\t\t\t$comment = str_ireplace('@' . $replacement, '@<a href=#comment-' . $d . '>' . $replacement . '</a>', $comment);\n\t\t}\n\t}\n}\nreturn $comment; //print the modified comments\n}",
"function get_edit_comment_link($comment_id = 0)\n {\n }",
"function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}",
"function wap8_trackbacks( $comment ) {\n$GLOBALS['comment'] = $comment; ?>\n<li><?php printf( __( '%s', 'designcrumbs' ), get_comment_author_link() ) ?> <?php edit_comment_link( __( 'Edit', 'designcrumbs' ), '<span>', '</span>' ); ?>\n<?php\n}",
"function add_comment( $pid, $uname, $cdetail, $uemail) {\n\t$client = new soapclient ( $GLOBALS['baseurl'].'/db/nusoapService.php' );\n\t$client->soap_defencoding = 'UTF-8';\n\t$client->decode_utf8 = false;\n\t$client->xml_encoding = 'UTF-8';\n\t$result = $client->call('add_comment', array('pid'=>\"$pid\", 'uname'=>\"$uemail\", 'uemail'=>\"$uemail\"));\n\tif (! $err = $client->getError ()) {\n\t\treturn $result;\n\t} else {\n\t\techo \"调用出错:\", $err;\n\t}\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 }",
"function the_comment()\n {\n }",
"public function renderCommentView($ucid) {\n global $lexicon;\n global $roles;\n\n $members = new Members();\n\n $comment_data = $this->comments['ucid-'.$ucid];\n $this->html_output .= ('<div class=\"commentia-comment\"'.' data-ucid=\"'.$comment_data['ucid'].'\">'.\"\\n\");\n $this->html_output .= ('<div class=\"commentia-comment-info\">'.\"\\n\");\n $this->html_output .= ('<img src='.$members->getMemberData($comment_data['creator_username'], 'avatar_file').' class=\"commentia-comment-info__member-avatar\">'.\"\\n\");\n $this->html_output .= ('<p class=\"commentia-comment-info__by\">'.COMMENT_INFO_COMMENT_BY.' '.($comment_data['creator_username']).', </p>'.\"\\n\");\n date_default_timezone_set(COMMENTIA_TIMEZONE);\n $this->html_output .= ('<p class=\"commentia-comment-info__timestamp\">'.COMMENT_INFO_POSTED_AT.' '.date(DATETIME_LOCALIZED,strtotime($comment_data['timestamp'])).'</p>'.\"\\n\");\n date_default_timezone_set('UTC');\n $this->html_output .= ('</div>'.\"\\n\");\n $this->html_output .= ('<div class=\"commentia-comment__content\">'.$comment_data['content'].'</div>'.\"\\n\");\n $this->html_output .= ('<div class=\"commentia-comment__edit-area\"></div>'.\"\\n\");\n\n if (!$comment_data['is_deleted']) {\n if ($_SESSION['__COMMENTIA__']['member_is_logged_in']) {\n $this->html_output .= ('<p class=\"commentia-comment-controls\">');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"showReplyArea(this)\">'.COMMENT_CONTROLS_REPLY.'</a>');\n if ($roles->memberHasUsername($comment_data['creator_username']) || $roles->memberIsAdmin()) {\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"showEditArea(this)\">'.COMMENT_CONTROLS_EDIT.'</a>');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"deleteComment(this)\">'.COMMENT_CONTROLS_DELETE.'</a>');\n }\n $this->html_output .= ('</p>'.\"\\n\");\n }\n $this->html_output .= ('<div class=\"commentia-rating-controls\">');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"updateRating(this, \\'up\\')\" class=\"commentia-rating-controls__arrow commentia-rating-controls__arrow--up\"></a>');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"updateRating(this, \\'down\\')\" class=\"commentia-rating-controls__arrow commentia-rating-controls__arrow--down\"></a>');\n $this->html_output .= ('</div>');\n $this->html_output .= ('<span class=\"commentia-rating-indicator\">'.(int) $comment_data['rating'].'</span>');\n }\n\n $this->html_output .= ('<div class=\"commentia-comment__reply-area\"></div>'.\"\\n\");\n\n if ($comment_data['children']) {\n foreach($comment_data['children'] as $child) {\n if (isset($this->comments['ucid-'.$child])) {\n $this->renderCommentView($child);\n unset($this->comments['ucid-'.$child]);\n }\n }\n }\n\n $this->html_output .= ('</div>'.\"\\n\");\n\n }",
"function modifyCommentByCID($cid, $comment)\n{\n\t$sql = \"UPDATE `\".DB_NAME.\"`.`comments` SET `comment` = '\".sanitize($comment).\"', `timemodified` = \".time().\"\n WHERE `cid` = \".$cid;\n\n\t$result = mysql_query($sql);\n\t\n\treturn $result;\n}",
"public function getDescription()\n {\n \tthrow new Lib_Exception(\"Comments cannot be asked for their description\");\n }",
"public function show($id,$comment)\n {\n //\n return \"这里是show:\".$id.\" comment:\".$comment;\n }",
"public function printComments($taskid) {\r\n\t\t$db = new DB();\r\n\t\t$db->connect();\r\n\t\t\r\n\t\t$taskid = $db->esc($taskid);\r\n\t\t\r\n\t\t$sql = \"SELECT * FROM comment\r\n\t\t\t\tINNER JOIN `user` ON `user`.id = comment.user_id\r\n\t\t\t\tWHERE comment.task_id = \" . $taskid;\r\n\t\t$query = $db->query($sql);\r\n\r\n\t\twhile ($oneRow = $query->fetch_assoc()) {\r\n\t\t\t//build gravatar url form mail\r\n\t\t\t$gravatar_url = \"http://www.gravatar.com/avatar/\" . md5( strtolower( trim( $oneRow[\"email\"] ) ) ) . \"?s=80&d=mm\";\r\n\t\t\t\r\n\t\t\techo '\r\n\t\t\t\t<div class=\"media\">\r\n\t\t\t\t\t<a class=\"pull-left\" href=\"#\">\r\n\t\t\t\t\t\t<img class=\"media-object img-circle\" src=\"' . $gravatar_url . '\" alt=\"person\" height=\"64\" width=\"64\">\r\n\t\t\t\t\t</a>\r\n\t\t\t\t\t<div class=\"media-body\">\r\n\t\t\t\t\t\t<h4 class=\"media-heading\">'.$oneRow[\"prename\"].' '.$oneRow[\"surname\"].'</h4>\r\n\t\t\t\t\t\t'.nl2br($oneRow[\"value\"]).'\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>';\r\n\t\t}\r\n\t}",
"function gk_comment_form( $fields ) {\n ob_start();\n wp_editor( '', 'comment', array( 'teeny' => true ));\n $fields['comment_field'] = ob_get_clean();\n return $fields;\n}",
"function netfunktheme_author_desc_shortcode( $atts ){\n\t\n\textract( shortcode_atts( array(\n\t\t'user_id' => '0'\n\t), $atts ) );\n\t\n\t$author_description = '';\n\t\n\tif ($atts['user_id'] != 0) {\n\n\t\t$author_description = get_the_author_meta('lb_about',$atts['user_id']);\n\n\t}\n\t\n\t$author_description = str_replace('/n','<br />',$author_description);\n\t$author_description = str_replace('/r','<br />',$author_description);\n\t\n\treturn '<p class=\"lb-shortcode-meta lb_author_description\">' . $author_description . '</p>';\n\t\n}",
"function comment_author_IP($comment_id = 0)\n {\n }",
"function setup_question($question,$answer){\n $htmlStr = '<p class=\"question\">'.$question.'</p>';\n $htmlStr .= '<p class=\"answer\">'.nl2br($answer).'</p>';\n return $htmlStr;\n}",
"function update_description (string &$description) {\n //Performs the rot13 transform of the current description\n $description = str_rot13($description);\n\n //Appends a string to the current description\n $description .= \"\\n\\nWazzzzzzzzzzzzzzzzaaaaaaaaaaaaaaaaaaaaaa\";\n }",
"function tempera_number_comments() { ?>\n\t\t\t<h3 id=\"comments-title\"><i class=\"icon-replies\" ></i>\n\t\t\t\t<?php printf( _n( 'One Comment:', '%1$s Comments:', get_comments_number(), 'tempera' ),\n\t\t\t\tnumber_format_i18n( get_comments_number() )); ?>\n\t\t\t</h3>\n<?php }",
"public function the_comment()\n {\n }",
"protected function _emitComment($ast) {\n echo \"/{$ast['value']}/\\n\";\n }",
"protected function _emitComment($ast) {\n echo \"/{$ast['value']}/\\n\";\n }",
"function pl_get_comments_link( $post_id ){\n\t\n\t$num_comments = get_comments_number($post_id);\n\t if ( comments_open() ){\n\t \t if($num_comments == 0){\n\t \t \t $comments = __('Add Comment', 'pagelines');\n\t \t }\n\t \t elseif($num_comments > 1){\n\t \t \t $comments = $num_comments.' '. __( 'Comments', 'pagelines' );\n\t \t }\n\t \t else{\n\t \t \t $comments =\"1 Comment\";\n\t \t }\n\t $write_comments = '<a href=\"' . get_comments_link($post_id) .'\">'. $comments.'</a>';\n\t }\n\telse{$write_comments = '';}\n\t\n\treturn $write_comments;\n\n}",
"function get_comment_data($comment_id) {\n $comment = get_comment( $comment_id );\n $post = get_post( $comment->comment_post_ID );\n $author = get_userdata( $post->post_author );\n\n $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);\n\n // The blogname option is escaped with esc_html on the way into the database in sanitize_option\n // we want to reverse this for the plain text arena of emails.\n $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);\n\n if ( empty( $comment_type ) ) $comment_type = 'comment';\n \n return compact('comment', 'post', 'author', 'comment_author_domain', 'blogname', 'comment_type');\n }",
"protected function getComment() {\n\t\t$comment_body = elgg_view('output/longtext', array(\n\t\t\t'value' => $this->comment->description,\n\t\t));\n//\t\tif (elgg_view_exists('output/linkify')) {\n//\t\t\t$comment_body = elgg_view('output/linkify', array(\n//\t\t\t\t'value' => $comment_body\n//\t\t\t));\n//\t\t}\n\t\t$comment_body .= elgg_view('output/attached', array(\n\t\t\t'entity' => $this->comment,\n\t\t));\n\n\t\t$attachments = $this->comment->getAttachments(array('limit' => 0));\n\t\tif ($attachments && count($attachments)) {\n\t\t\t$attachments = array_map(function(\\ElggEntity $entity) {\n\t\t\t\treturn elgg_view('output/url', [\n\t\t\t\t\t'href' => $entity->getURL(),\n\t\t\t\t\t'text' => $entity->getDisplayName(),\n\t\t\t\t]);\n\t\t\t}, $attachments);\n\n\t\t\t$attachments_text = implode(', ', array_filter($attachments));\n\t\t\tif ($attachments_text) {\n\t\t\t\t$comment_body .= elgg_echo('interactions:attachments:labelled', array($attachments_text));\n\t\t\t}\n\t\t}\n\n\t\treturn strip_tags($comment_body, '<p><strong><em><span><ul><li><ol><blockquote><img><a>');\n\t}",
"function ubc_collab_comment_meta() {\n\techo apply_atomic_shortcode( 'comment_meta', '<div class=\"comment-meta comment-meta-data\"><cite>[comment-author]</cite> [comment-published] <span class=\"comment-action\">[comment-permalink before=\"\"] [comment-edit-link before=\"| \"] [comment-reply-link before=\"| \"]<span></div>' );\n}",
"function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}",
"function newUnderComment();",
"function wpsites_modify_comment_form_text_area($arg) {\n $arg['comment_field'] = '<p class=\"comment-form-comment\"><label for=\"comment\">' . _x( 'Takk for din tilbakemelding!', 'noun' ) . '</label><textarea id=\"comment\" name=\"comment\" cols=\"55\" rows=\"7\" aria-required=\"true\"></textarea></p>';\n return $arg;\n}",
"function dsq_comments_number($comment_text) {\n\tglobal $post;\n\n\tif ( dsq_can_replace() ) {\n\t\treturn '<span class=\"dsq-postid\" rel=\"'.htmlspecialchars(dsq_identifier_for_post($post)).'\">View Comments</span>';\n\t} else {\n\t\treturn $comment_text;\n\t}\n}",
"public function loadComment(){\n\n if($this->id == -1 || empty($this->databasePath))\n return \"\";\n\n $sqlQuery = 'SELECT text FROM comments WHERE book='.$this->id;\n\n $comment = \"\";\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $comment .= $row['text'];\n \n return $comment;\n }",
"function printEditLink($params)\n{\n extract($params);\n return \"\n <input type=hidden name='hDataID$counter' id='hDataID$counter' value='\" . $record['id'] . \"' />\n <input type=hidden name='hDataEmployeeID$counter' id='hDataEmployeeID$counter' value='\" . $record['employeeID'] . \"' />\n <input type=hidden name='hDataEmployeeName$counter' id='hDataEmployeeName$counter' value='\" . $record['employeeName'] . \"' />\n <input type='hidden' name='hDataAddress$counter' id='hDataAddress$counter' value='\" . $record['primaryAddress'] . \"' />\n <input type='hidden' name='hDataDepartment$counter' id='hDataDepartment$counter' value='\" . $record['departmentCode'] . \"' />\n <a href=\\\"javascript:myClient.editData($counter)\\\">Edit</a>\";\n}",
"private function lstComChap($idchap){\n\t\t\t$commentaires = $this->com->getLastCom($idchap);\n\t\t\t\t\n\t\t\techo $commentaires;\n\t\t}",
"public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }",
"public function getComment(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->message = $row['message'];\n\n }",
"function get_comment_author_IP($comment_id = 0)\n {\n }",
"function tz_list_pings($comment, $args, $depth) {\n $GLOBALS['comment'] = $comment; ?>\n<li id=\"comment-<?php comment_ID(); ?>\"><?php comment_author_link(); ?>\n<?php }",
"public function updateComment($commentID){\n\t\t try{\n\t\t\t $conn=DBConnection::getConnection();\n\t\t\t $updateQuery=\"UPDATE comment SET comment_description=:comment_description WHERE comment_id='\".$commentID.\"'\";\n\t\t\t $cmd=$conn->prepare($updateQuery);\n\t\t\t $cmd->bindValue(':comment_description',$this->getCommentDescription(),PDO::PARAM_STR);\n\t\t\t \n\t\t\t return $cmd->execute();\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }",
"function comment_excerpt($comment_id = 0)\n {\n }",
"function getComments()\n {\n\t//Check for 'pid' parameter in URL\n\tif(array_key_exists(\"pid\", $_GET))\n\t{\n\t\t$ideaID = $_GET[\"pid\"];\n\t\t$comments = mysql_query(\"SELECT * FROM comments WHERE ideaID =\" . $ideaID . \" ORDER BY upVotes DESC\");\n\t\techo '<div class=\"allComments\">';\n\t\twhile(($commentArray = mysql_fetch_array($comments)) != null)\n \t{\n\t\t\t$user = mysql_query(\"SELECT * FROM user WHERE username ='\" . $commentArray['username'] . \"'\");\n\t\t\t$userArray = mysql_fetch_array($user);\n \n\t\t\techo '<div class=\"commentContainer\" id=\"'.$commentArray[\"commentID\"].'\">';\n echo '<div id=\"voteContainer\">';\n echo '<div class=\"buttonContainer\"><input type=\"button\" id=\"upvoteOn\" class=\"';\n \n if(userHasVotedOnComment($commentArray, $_SESSION['usr']))\n {\n \techo 'commentVote voted';\n }\n else\n {\n \techo 'commentVote';\n }\n \n echo '\" onclick=\"upvoteCommentFunction('.$commentArray['commentID'].')\" ';\n \n if(!isset($_SESSION['usr']))\n {\n \techo 'disabled';\n }\n \n echo '></div><div class=\"voteamount\">'.$commentArray['upVotes'].'</div></div>';\n \t\techo '<div class=\"commentAvatar\"><img src=\"' . $userArray['avatarLocation'] . '\"/></div>';\n \n \t\techo '<div class=\"commentText\"><h3><a href=\"./profile.php?user=' . $commentArray['username'] . '\">' . $commentArray['username'] . '</a></h3>';\n \t\techo $commentArray['content'] . '</div>';\n \t\techo '<br>';\n \t\techo '</div>';\n\t\t}\n echo' </div>';\n\t}\n}",
"function ipal_display_student_interface(){\r\n\tglobal $DB;\r\n\tipal_java_questionUpdate();\r\n\t$priorresponse = '';\r\n\tif(isset($_POST['answer_id'])){\r\n\t if($_POST['answer_id'] == '-1'){\r\n\t \t$priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($_POST['a_text']);\r\n\t }\r\n\t else\r\n\t {\r\n\t $answer_id = $_POST['answer_id'];\r\n\t\t $answer = $DB->get_record('question_answers', array('id'=>$answer_id));\r\n\t\t //$answer = $DB\r\n\t\t $priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($answer->answer);\r\n\t }\r\n\t ipal_save_student_response($_POST['question_id'],$_POST['answer_id'],$_POST['active_question_id'],$_POST['a_text']);\r\n\t}\r\n echo $priorresponse;\r\n ipal_make_student_form();\t\r\n}",
"function pnUserGetCommentOptions()\r\n{\r\n if (pnUserLoggedIn()) {\r\n $mode = pnUserGetVar('umode');\r\n $order = pnUserGetVar('uorder');\r\n $thold = pnUserGetVar('thold');\r\n }\r\n\r\n if (empty($mode)) {\r\n $mode = 'thread';\r\n }\r\n\r\n if (empty($order)) {\r\n $order = 0;\r\n }\r\n\r\n if (empty($thold)) {\r\n $thold = 0;\r\n }\r\n\r\n return(\"mode=$mode&order=$order&thold=$thold\");\r\n}",
"function get_comment_text($comment_id = 0, $args = array())\n {\n }",
"function get_comment_excerpt($comment_id = 0)\n {\n }",
"public function getComment() {}",
"function getCommentData($comid)\n{\n\t$sql = \"SELECT * FROM comments WHERE commentID =\".$comid;\n\t$result = mysql_query($sql);\n \t$comment = mysql_fetch_array($result);\n \treturn $comment;\n}",
"private function print_comment($comment, $context) {\n global $DB, $CFG, $COURSE;\n\n $output = '';\n\n $user = $DB->get_record('user', array('id' => $comment->userid));\n\n $deleteurl = new moodle_url('/mod/wavefront/comment.php', array('id' => $comment->wavefrontid, 'delete' => $comment->id));\n\n $output .= '<table cellspacing=\"0\" width=\"50%\" class=\"boxaligncenter datacomment forumpost\">'.\n '<tr class=\"header\"><td class=\"picture left\">'.\n $this->output->user_picture($user, array('courseid' => $COURSE->id)).'</td>'.\n '<td class=\"topic starter\" align=\"left\"><a name=\"c'.$comment->id.'\"></a><div class=\"author\">'.\n '<a href=\"'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$COURSE->id.'\">'.\n fullname($user, has_capability('moodle/site:viewfullnames', $context)).'</a> - '.userdate($comment->timemodified).\n '</div></td></tr>'.\n '<tr><td class=\"left side\">'.\n // TODO: user_group picture?\n '</td><td class=\"content\" align=\"left\">'.\n format_text($comment->commenttext, FORMAT_MOODLE).\n '<div class=\"commands\">'.\n (has_capability('mod/wavefront:edit', $context) ? html_writer::link($deleteurl, get_string('delete')) : '').\n '</div>'.\n '</td></tr></table>';\n\n return $output;\n }",
"public function getCommentText()\n {\n return $this->commentText;\n }",
"static function pretty_comments_number() {\n\t\tglobal $post;\n\t\tprintf(\n\t\t\t/* translators: %s represents a number */\n\t\t\t_n( '%s Comment', '%s Comments', get_comments_number(), 'cargopress-pt' ), number_format_i18n( get_comments_number() )\n\t\t);\n\t}",
"function formattedDesc()\n {\n $lines = explode(\"\\n\", $this->desc);\n\n $result = \"\";\n foreach ($lines as $line)\n $result .= \"<p>\".$line.\"</p>\";\n\n return $result;\n }",
"function save_comment($comment_id)\n {\n }",
"function writeIssueCommentItems(){\n if( $this->id == 0 ) return;\n \n $aTrackFields = array( \n \"issue_status_id\",\n \"issue_type_id\",\n \"related_issue_id\",\n \"user_id\",\n \"summary\",\n );\n \n $str = \"\";\n foreach( $aTrackFields as $f ){\n if( !isset( $this->aFields[$f] ) ) die( \"Don't know field \".$f );\n if( $this->aFields[$f]->haschanged ){\n $field = $this->aFields[$f];\n $val = $field->value;\n $field->value = $field->originalvalue;\n $oldstr = $field->toString();\n $field->value = $val;\n if( $field->toString() == $oldstr ) continue;\n $str .= trim( $field->displayname.\": \".$oldstr.\" -> \".$field->toString() ).\".\\n\\n\";\n }\n }\n if( $str != \"\" ){\n require_once( \"models/issue_comment.model.class.php\" );\n\n $ic = Cache::getModel( \"IssueComment\" );\n $ic->aFields[\"comment\"]->set( $str );\n $ic->aFields[\"issue_id\"]->editable = true;\n $ic->aFields[\"issue_id\"]->set( $this->id );\n if( SessionUser::isLoggedIn() ){\n $ic->aFields[\"user_id\"]->set( SessionUser::getId() );\n }\n $ic->save();\n }\n return true;\n }",
"function set_commentid($new_commentid)\n {\n $this->commentid = $new_commentid;\n }",
"function sendComment($input) { // Takes an array of sanitized input. Submits comment to database and returns ID.\n\t$input = dbEscapeArray($input);\n\t$linkid = intval($_GET[linkid]);\n\t$_SESSION[id] = intval($_SESSION[id]);\t\n\tif(intval($input[edit]) == 1) { \n\t\t$owner = dbFirstResult(\"SELECT userid FROM comments WHERE id=$input[parent]\"); \n\t\t\n\t\tif($owner == $_SESSION[id]) { // Check that the user owns the comment they are editing\n\t\t\tdbQuery(\"UPDATE comments SET text='$input[comment]' WHERE id=$input[parent]\");\n\t\t\treturn($input[parent]);\n\t\t}\t\n\t\telse { return false; }\n\t}\n\t\n\telse {\n\t\tif(intval($input[parent] == 0)) { $input[parent] = \"NULL\"; }\n\t\t$queryid = dbQueryId(\"INSERT INTO comments (userid,linkid,parent,text) VALUES ($_SESSION[id],$linkid,$input[parent],'$input[comment]')\");\n\t\tvote($_SESSION[id],$queryid,\"comment\",1); // Auto-upvote own comment\n\t\treturn($queryid);\n\t}\n}"
] | [
"0.6307052",
"0.60484123",
"0.58101135",
"0.5808664",
"0.5762372",
"0.573787",
"0.5729067",
"0.5718034",
"0.5692187",
"0.5667434",
"0.5600812",
"0.5598895",
"0.55894434",
"0.55816674",
"0.5576942",
"0.5563469",
"0.5555039",
"0.55300665",
"0.55117494",
"0.5495308",
"0.5487944",
"0.5469472",
"0.5454212",
"0.54293835",
"0.54170567",
"0.5411312",
"0.54003924",
"0.5388259",
"0.5381649",
"0.5369075",
"0.5366631",
"0.5365632",
"0.5342808",
"0.53342664",
"0.5296031",
"0.5283364",
"0.5283345",
"0.5263332",
"0.52543014",
"0.5247739",
"0.5247739",
"0.5237548",
"0.5231949",
"0.52303076",
"0.52225155",
"0.52194786",
"0.5212038",
"0.52013934",
"0.51864344",
"0.5183018",
"0.5176174",
"0.516696",
"0.51666373",
"0.516659",
"0.5160144",
"0.5156838",
"0.515348",
"0.51512",
"0.5147142",
"0.51443607",
"0.5142838",
"0.513721",
"0.5136644",
"0.5130656",
"0.5117794",
"0.5114819",
"0.5112808",
"0.5112808",
"0.51020926",
"0.51015997",
"0.5098309",
"0.50914013",
"0.5077294",
"0.50735736",
"0.50700337",
"0.50694376",
"0.5064738",
"0.5045745",
"0.5044436",
"0.50439143",
"0.5042007",
"0.50419825",
"0.503928",
"0.50317025",
"0.502762",
"0.50262254",
"0.50260055",
"0.5016776",
"0.50165707",
"0.50156474",
"0.50080645",
"0.50065976",
"0.5004927",
"0.50025415",
"0.49973345",
"0.49968284",
"0.49967816",
"0.49947312",
"0.49930716",
"0.49926355"
] | 0.59546244 | 2 |
Buscar roles por nombre y ordenados por nombre. | public static function buscarPorNombre($nombreRol): array {
$expresion = "/^[a-z_ ]{0,15}$/";
if (preg_match($expresion, mb_strtolower($nombreRol))) {
$consulta = "SELECT * FROM vw_rol WHERE nombre LIKE '%{$nombreRol}%' ORDER BY nombre";
return Conexion::getInstancia()->seleccionar($consulta);
}
return array(0, "El nombre no cumple con el formato requerido");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function findRoles() {\n\t\t\n\t}",
"public function rolesForUser();",
"public static function listarRoles(): array {\n $consulta = \"SELECT * FROM rol ORDER BY nombre\";\n return Conexion::getInstancia()->seleccionar($consulta);\n }",
"abstract protected function getRoles();",
"public function getRolesNames ();",
"public function & GetRoles ();",
"public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function usuarioRoles($usuario);",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function findAll() {\n\n // Récupération des différents type d'utilisateur\n $result = $this->getDb()->fetchAll(\"select * from roles order by nom asc\");\n \n $roles = array();\n foreach ($result as $row) {\n $roles[$row['id']] = $this->buildDomainObject($row);\n }\n return $roles;\n }",
"function getAllRoles() {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT DISTINCT role FROM users');\n // exécution\n $query -> execute();\n // renvoie un tableau associatif\n return $query -> fetchAll();\n}",
"public function list_roles(){\n $roles=$this->roles->pluck('name')->toArray();\n //el primer parametro es el separador, y el segundo para es el arreglo a seprar\n // es lo opuesto al explode que retorna una arreglo\n $string=implode(', ',$roles);\n return $string;\n\n }",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }",
"public function getRoles(){\n\n $roles = $this->visiteur_roles->map(function($role){\n return $role->getTitle();\n })->ToArray();\n\n $roles[]= 'ROLE_USER';\n \n return $roles;\n }",
"public function getAllRoles(): array;",
"public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}",
"function getRoles () {\n return array(\"user.image.edit\",\"user.image.view\");\n }",
"public function getRoles(): array;",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"private function get_all_roles(){\n return Role::all();\n }",
"function getRoles()\n\t{\n $query = $this->db->query(\"select\n\t\t\t\t\t\t\t\t\t\troles.id as id,\n\t\t\t\t\t\t\t\t\t\troles.nombre as nombre,\n\t\t\t\t\t\t\t\t\t\troles.id_superior as id_superior\n\t\t\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\t\t\troles\n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\troles.estado = 0\n\t\t\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\t\t\t\troles.id asc\");\n\t\treturn $query->result();\n }",
"public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}",
"public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = ' <a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"private function load_roles() {\n $query = $this->PDO->prepare(\"SELECT * FROM rol\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"protected function get_roles_disponibles()\n\t{\n\t\t$roles_existentes = array();\n\t\t$datos = $this->db->listar_roles();\n\t\tforeach($datos as $valor) {\n\t\t\t$roles_existentes[] = strtolower($valor['rolname']);\n\t\t}\n\t\treturn $roles_existentes;\n\t}",
"public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"public function roles()\n {\n\n $roles = get_editable_roles();\n $output = array();\n foreach ($roles as $key => $val) {\n $output[$key] = $val['name'];\n }\n return $output;\n }",
"public function roles()\n {\n $this->roles = $this->Role->list($_SESSION['guild_id']);\n }",
"public function getUsuarioRolesAttribute()\n {\n $roles=$this->roles;\n foreach ($roles as $role)\n {\n echo $role->nombre.\"<br>\";\n }\n }",
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function getAvailableRoles() ;",
"public function setRoles()\n {\n if (!array_key_exists(User::ROLE_ADMINISTRATOR, Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()))) {\n $array = Yii::$app->authManager->getRoles();\n unset($array[self::ADMINISTRATOR]);\n } else {\n $array = Yii::$app->authManager->getRoles();\n }\n\n $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name');\n\n $now = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId());\n\n //unset($roles[array_search('super_administrator', $roles)]);\n unset($roles[array_search('user', $roles)]);\n\n foreach ($roles as $key => $role) {\n $roles[$key] = Yii::t('backend', $role);\n }\n\n if (array_key_exists(User::ROLE_CUSTOMER, Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()))) {\n $key = array_search(User::ROLE_CUSTOMER, $roles);\n $roles = array_intersect_key($roles, [$key => $roles[$key]]);\n }\n\n return $roles;\n }",
"public function ObtenerRolesUsuario($idUsuario)\r\n {\r\n return Rol_Por_Usuario::where('user_id','=',$idUsuario)->get();\r\n }",
"public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }",
"public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }",
"public function listarRoles()\n {\n //return AutorizadorRol::all();\n\n $roles = AutorizadorRolAccion::join('autorizador_roles', 'autorizador_rol_acciones.rol_id', '=', 'autorizador_roles.id')\n ->selectRaw('autorizador_rol_acciones.id as accion_id,\n autorizador_rol_acciones.accion as controlador,\n autorizador_roles.id as rol_id,\n autorizador_roles.rol as rol,\n autorizador_roles.descripcion as descripcion'\n )->orderBy('rol')->get(); \n return response()->json($roles);\n }",
"function get_roles( ) {\n\n\n global $wp_roles;\n $default_roles = array();\n //$default_roles = array('administrator','editor', 'author', 'contributor', 'subscriber', 'pending');\n\n\n $roles = $wp_roles->get_names();\n // dump($roles);\n\n $roless['Bez ograniczeń'] = '';\nforeach($roles as $role => $name){\n if(!in_array( $role, $default_roles)){\n $roless[$name] = $role;\n }\n}\n\n //dump($roless);\nreturn $roless;\n /*\n $categories = get_categories( $args );\n $cat[__('Wybierz kategorię')] = '';\n foreach( $categories as $category ) {\n\t$cat[$category->name] = $category->term_id;\n }\n return $cat;\n */\n}",
"public function fillRoles(){\n $query = Rol::select('id_rol','nombre')->where('estado','=','true')->get();\n return $query;\n }",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"function getRoles () {\n return array(\"user.friendRequest.edit\",\"user.friendRequest.view\");\n }",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"static public function get_all_roles() {\n\t\tif ( ! function_exists( 'get_editable_roles' ) ) {\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/user.php' );\n\t\t}\n\n\t\t$editable_roles = get_editable_roles();\n\t\t$roles = array();\n\t\t$caps = apply_filters( 'fl_builder_user_access_capabilities', array( 'edit_posts' ) );\n\n\t\tforeach ( $editable_roles as $role => $data ) {\n\t\t\tforeach ( $caps as $cap ) {\n\t\t\t\tif ( isset( $data['capabilities'][ $cap ] ) && 1 == $data['capabilities'][ $cap ] ) {\n\t\t\t\t\t$roles[ $role ] = $data['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $roles;\n\t}",
"function get_editable_roles()\n {\n }",
"public function getRoles(){\n //write the query to select all roles except super admin\n $sql = \"SELECT * FROM roles WHERE role_title != 'Super Admin'\";\n\n //check if the query() runs the sql statement\n if ($result = $this->dbobj->dbcon->query($sql)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }",
"public function getUsersRoles()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ur' => 'users_roles'),\n\t\t\t\t'ur.user_id = u.user_id', array('role_id'));\n\t\treturn $db->fetchAll($select);\t\n\t}",
"public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}",
"public function roles(): MorphToMany;",
"protected abstract function getAllowedRoles();",
"public function getRoles()\n {\n $roles = Yii::$app->authManager->getRolesByUser($this->getId());\n return ArrayHelper::getColumn($roles, 'name', false);\n }",
"public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}",
"function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}",
"public function getRoles()\n {\n return array('1');\n }",
"public function getRoles()\n {\n $roles = $this->roles;\n if ($roles != NULL) {\n\n return explode(\" \", $roles);\n } else {\n return $this->roles;\n }\n // return ['ROLE_USER'];\n }",
"public function getAllMoviesAndRoles() {\n \t$stmt = $this->DB->prepare (\"SELECT actors.first_name,actors.last_name,roles.role,movies.name FROM roles JOIN actors ON actors.id = roles.actor_id JOIN movies ON movies.id = roles.movie_id\");\n \t$stmt->execute();\n\n \treturn $stmt->fetchAll ( PDO::FETCH_ASSOC);\n }",
"public function getRoles()\n\t{\n\t\t$roles = array_map(function($value)\n\t\t{\n\t\t\treturn Html::a($value, $value->links['self']);\n\t\t}, $this->entity->roles);\n\n\t\treturn join('<br>', $roles);\n\t}",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"function getChangeableRoles(): array {\n $statement = 'SELECT * FROM role_lov WHERE role = (?) OR role = (?)';\n $query = $this->prepare($statement);\n $query->execute(['author', 'reviewer']);\n return $query->fetchAll();\n }",
"function get_roles () {\r\n //if (!check_admin()) return false;\r\n $conn = db_connect();\r\n $query = \"select * from roles\";\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n }\r\n if ($result->num_rows == 0) {\r\n // throw new Exception(\"No records in roles table!\");\r\n }\r\n\r\n $result = db_result_to_array($result);\r\n return $result;\r\n }",
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"function getRoles()\n {\n $roles = array();\n\n foreach ($this->grupos as $grupo) {\n $roles[] = $grupo->getRole();\n }\n return $roles;\n }",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public function getRoleUsuario()\n {\n\t\n\t return $this->roles;\n\t\n }",
"public function index()\n {\n return Roles::all();\n }",
"public function roles()\n {\n\n return Role::all();\n }",
"public static function roles(){\n self::init();\n\n return array_keys(AUTH_USER_ROLES);\n }",
"public function getRoles(): iterable\n {\n return [];\n }",
"public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }",
"public static function getRolesNames()\n {\n return ArrayHelper::getColumn(static::getNotDefaultRoles(), 'name');\n }",
"public static function getRoles ()\n {\n // Pulls column string from DB\n $enumStr = DB::select(DB::raw('SHOW COLUMNS FROM `user` WHERE FIELD = \"role\"'))[0]->Type;\n\n // Parse string\n preg_match_all(\"/'([^']+)'/\", $enumStr, $matches);\n\n // Return matches\n return isset($matches[1]) ? $matches[1] : [];\n }",
"public function roles()\n {\n return [\n 'traveller', 'sender'\n ];\n }",
"public function getRoles()\n {\n return array(\"ROLE_\".$this->getUserGroup());\n }",
"public function getRoles()\n {\n $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name');\n\n $now = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId());\n\n unset($roles[array_search('super_administrator', $roles)]);\n unset($roles[array_search('user', $roles)]);\n\n foreach ($roles as $key => $role) {\n $roles[$key] = Yii::t('backend', $role);\n }\n\n return $roles;\n }",
"public static function getRoles(){\n $conn = DBConnection::getInstance();\n $query = \"CALL getRoles();\";\n $result = $conn->performQueryFetchAll($query);\n if (!$result)\n return false;\n foreach ($result as $value) {\n $result_array[] = $value['name'];\n }\n return $result_array;\n }",
"public function getRoles()\n {\n\n \ttry {\n return $query = Role::get();\n } catch(\\Exception $err){\n Log::error('message error in getRoles on RoleRepository :'. $err->getMessage());\n return back()->with('error', $err->getMessage());\n }\n }",
"public function showRoles(Request $request) {\n\n $roles = Roles::paginate(10);\n \n return $roles;\n \n }",
"function ListaRol() {\n\t\n\t\t\t$sql = \"SELECT * FROM rol\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}",
"function testGetRoles() {\n $u1 = User::getOneFromDb(['user_id' => 101], $this->DB);\n $u2 = User::getOneFromDb(['user_id' => 110], $this->DB);\n $u3 = new User(['user_id' => 50, 'username' => 'fjones', 'screen_name' => 'jones, fred', 'DB' => $this->DB]);\n $u4 = User::getOneFromDb(['user_id' => 109], $this->DB);\n\n $r1 = $u1->getRoles();\n $this->assertEqual(1,count($r1));\n $this->assertEqual('field user',$r1[0]->name);\n\n $r2 = $u2->getRoles();\n $this->assertEqual(1,count($r2));\n $this->assertEqual('manager',$r2[0]->name);\n\n $r3 = $u3->getRoles();\n $this->assertEqual(1,count($r3));\n $this->assertEqual('public',$r3[0]->name);\n\n $r4 = $u4->getRoles();\n $this->assertEqual(1,count($r4));\n $this->assertEqual('public',$r4[0]->name);\n }",
"public function getRole();",
"public function getRole();",
"function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }",
"public function getRoles(): array\n {\n $roles = $this->userRoles->map(function($role){\n return $role->getTitle();\n })->toArray();\n\n $roles[] = 'ROLE_USER';\n // guarantee every user at least has ROLE_USER\n //$roles[] = 'ROLE_USER';\n\n return $roles;\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function get_all_roles($params = array())\n {\n $this->db->order_by('roles_id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('roles')->result_array();\n }",
"public function getRoles()\n {\n\n $rolesReturn = [];\n $roles = $this->roles()->with(['role'])->get();\n\n $rolesReturn = $roles->pluck('role.name');\n\n // Add Standard role to the user roles\n\n if($rolesReturn->contains(config('user.standardRole')) === false)\n {\n $rolesReturn->push(config('user.standardRole'));\n }\n\n return $rolesReturn;\n\n }"
] | [
"0.7423154",
"0.7423154",
"0.7423154",
"0.7423154",
"0.740639",
"0.7295359",
"0.70970446",
"0.7069162",
"0.70189154",
"0.6864678",
"0.68530214",
"0.68354887",
"0.68214023",
"0.67871666",
"0.67227626",
"0.6659902",
"0.6659902",
"0.6659902",
"0.6650611",
"0.6620221",
"0.65897185",
"0.65891016",
"0.6571692",
"0.6571112",
"0.65612596",
"0.6549156",
"0.6536158",
"0.65122825",
"0.6506609",
"0.6483713",
"0.6468955",
"0.6466537",
"0.6457731",
"0.6415055",
"0.6394222",
"0.639344",
"0.63926816",
"0.6368733",
"0.6333208",
"0.6319335",
"0.6311374",
"0.6288466",
"0.62772137",
"0.62612224",
"0.624812",
"0.62473345",
"0.6227417",
"0.62218183",
"0.62148815",
"0.62145156",
"0.621221",
"0.6209287",
"0.6165896",
"0.615558",
"0.61506945",
"0.6140052",
"0.61399275",
"0.61330533",
"0.61289",
"0.61275923",
"0.61183536",
"0.6117769",
"0.61060244",
"0.6102657",
"0.6095235",
"0.6092965",
"0.6090721",
"0.6083566",
"0.607967",
"0.6076041",
"0.6054256",
"0.6051017",
"0.6046733",
"0.60451734",
"0.6042108",
"0.60276616",
"0.6014973",
"0.6010505",
"0.60096747",
"0.6007418",
"0.60059726",
"0.5996923",
"0.59848446",
"0.59780294",
"0.5977814",
"0.59760356",
"0.59730756",
"0.59707785",
"0.59606797",
"0.5947282",
"0.5945987",
"0.59339",
"0.5915151",
"0.5900218",
"0.5900218",
"0.5896574",
"0.5891609",
"0.58908916",
"0.58908916",
"0.5890186",
"0.58821195"
] | 0.0 | -1 |
Listar todos los roles ordernados por nombre. Selecciona el id y nombre de cada uno de los roles guardados. | public static function listarRoles(): array {
$consulta = "SELECT * FROM rol ORDER BY nombre";
return Conexion::getInstancia()->seleccionar($consulta);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function listarRoles()\n {\n //return AutorizadorRol::all();\n\n $roles = AutorizadorRolAccion::join('autorizador_roles', 'autorizador_rol_acciones.rol_id', '=', 'autorizador_roles.id')\n ->selectRaw('autorizador_rol_acciones.id as accion_id,\n autorizador_rol_acciones.accion as controlador,\n autorizador_roles.id as rol_id,\n autorizador_roles.rol as rol,\n autorizador_roles.descripcion as descripcion'\n )->orderBy('rol')->get(); \n return response()->json($roles);\n }",
"public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}",
"public function roles()\n {\n $this->roles = $this->Role->list($_SESSION['guild_id']);\n }",
"public function list_roles(){\n $roles=$this->roles->pluck('name')->toArray();\n //el primer parametro es el separador, y el segundo para es el arreglo a seprar\n // es lo opuesto al explode que retorna una arreglo\n $string=implode(', ',$roles);\n return $string;\n\n }",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"public function listAll()\n {\n $roles = $this->model->lists('name', 'id');\n\n return $roles;\n }",
"public function roles()\n {\n\n $roles = get_editable_roles();\n $output = array();\n foreach ($roles as $key => $val) {\n $output[$key] = $val['name'];\n }\n return $output;\n }",
"public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = ' <a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }",
"public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}",
"public static function todos()\n\t{\n\t\t// Arreglo que va a contener todos los roles\n\t\t$lista_medios = [];\n\n\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Consulta para la base de datos y despues lo guarda en la variable\n\t\t$resultado = $conexion->conn->query(\"SELECT * FROM \". static::$tablaConsulta );\n\n\n\t\t// Recorrer todos los roles que llegaron de la bd\n\t\twhile ( $medio = $resultado->fetch_assoc() ) {\n\n\t\t\t// Crear un reporte temporal en cada vuelta\n\t\t\t$medioTemporal = new MedioPago;\n\n\t\t\t// Añadir los campos al rol\n\t\t\t$medioTemporal->id \t = $medio['id'];\n\t\t\t$medioTemporal->medio \t = $medio['medio'];\n\n\t\t\t// Guarda el objeto rol en el arreglo\n\t\t\t$lista_medios[] = $medioTemporal;\n\t\t}\n\n\t\t// Devolver todos los roles\n\t\treturn $lista_medios;\n\n\t}",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }",
"public function findAll() {\n\n // Récupération des différents type d'utilisateur\n $result = $this->getDb()->fetchAll(\"select * from roles order by nom asc\");\n \n $roles = array();\n foreach ($result as $row) {\n $roles[$row['id']] = $this->buildDomainObject($row);\n }\n return $roles;\n }",
"function getAll()\n\t{\n\t\t$this->db->order_by(\"roleName\",\"ASC\");\n\t\t$query = $this->db->get('roles');\n\t\treturn $query;\n\t}",
"public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }",
"function get_all_roles()\n {\n $this->db->order_by('role', 'asc');\n return $this->db->get('tbl_roles')->result_array();\n }",
"protected function get_roles_disponibles()\n\t{\n\t\t$roles_existentes = array();\n\t\t$datos = $this->db->listar_roles();\n\t\tforeach($datos as $valor) {\n\t\t\t$roles_existentes[] = strtolower($valor['rolname']);\n\t\t}\n\t\treturn $roles_existentes;\n\t}",
"private function get_all_roles(){\n return Role::all();\n }",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"public function roleList()\n {\n $roleList = '<ul>';\n foreach ($this->roles as $role) {\n $roleList .= '<li>'.$role->name.'</li>';\n }\n $roleList .= '</ul>';\n\n return $roleList;\n }",
"public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}",
"private function load_roles() {\n $query = $this->PDO->prepare(\"SELECT * FROM rol\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"function getAllRoles() {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT DISTINCT role FROM users');\n // exécution\n $query -> execute();\n // renvoie un tableau associatif\n return $query -> fetchAll();\n}",
"public function getRolesNames ();",
"function ListaRol() {\n\t\n\t\t\t$sql = \"SELECT * FROM rol\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function getRoleList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_role');\n\t\t$this->db->where('role_status', '1');\n\t\t$this->db->where('role_id !=', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}",
"public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }",
"public function getRoleList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_role');\r\n\t\t$this->db->where('role_status', '1');\r\n\t\t$this->db->where('role_id !=', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function getAllRoles(): array;",
"public function loadRoles($order='name')\n\t{\n\t\t$this->roleObjects = array();\n\t\t$this->roles = array();\n\t\t$this->roleNames = array();\n\t\t$tbl = new Model_Table_Roles();\n\t\t$select = $tbl->select()->order($order);\n\t\t$roleObjects = $this->findManyToManyRowset('Model_Table_Roles','Model_Table_UserRole',null,null,$select);\n\t\tforeach($roleObjects as $object)\n\t\t{\n\t\t\t$this->roleObjects[] = $object;\n\t\t\t$this->roleNames[] = $object->name;\n\t\t\t$this->roles[] = $object->id;\n\t\t}\n\t}",
"public function index()\n {\n return Roles::all();\n }",
"public function fillRoles(){\n $query = Rol::select('id_rol','nombre')->where('estado','=','true')->get();\n return $query;\n }",
"public function getRoles(){\n\n $roles = $this->visiteur_roles->map(function($role){\n return $role->getTitle();\n })->ToArray();\n\n $roles[]= 'ROLE_USER';\n \n return $roles;\n }",
"public function getList() {\n $data['data'] = $this->role->get();\n return view('roles.list_role',$data);\n }",
"function getRoles()\n\t{\n $query = $this->db->query(\"select\n\t\t\t\t\t\t\t\t\t\troles.id as id,\n\t\t\t\t\t\t\t\t\t\troles.nombre as nombre,\n\t\t\t\t\t\t\t\t\t\troles.id_superior as id_superior\n\t\t\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\t\t\troles\n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\troles.estado = 0\n\t\t\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\t\t\t\troles.id asc\");\n\t\treturn $query->result();\n }",
"public function roles()\n\t{\n\t\treturn $this->belongsToMany('Regulus\\Identify\\Models\\Role', Auth::getTableName('user_roles'))\n\t\t\t->withTimestamps()\n\t\t\t->orderBy('display_order')\n\t\t\t->orderBy('name');\n\t}",
"public function roles()\n {\n\n return Role::all();\n }",
"public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }",
"function get_all_roles($params = array())\n {\n $this->db->order_by('roles_id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('roles')->result_array();\n }",
"public function mostrar(){ \n $role = DB::table('roles as r')\n //->join('roles as r','m.idMiembro','=','r.idRole') \n ->select('r.idrole', 'r.descripcionrole')\n ->get();\n return $role;\n }",
"public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public static function getRolesNames()\n {\n return ArrayHelper::getColumn(static::getNotDefaultRoles(), 'name');\n }",
"public function ObtenerRolesUsuario($idUsuario)\r\n {\r\n return Rol_Por_Usuario::where('user_id','=',$idUsuario)->get();\r\n }",
"public function rolesForUser();",
"function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}",
"public function getVacancyRoleSelect()\n {\n $roles = new \\Object\\VacancyRole\\Listing();\n $roles->setOrderKey(\"name\");\n $list = $roles->load();\n\n $roles = [];\n\n foreach ($list as $vacancyRole) {\n $roles[$vacancyRole->getId()] = $vacancyRole->getName();\n }\n\n return $roles;\n }",
"public function findRoles() {\n\t\t\n\t}",
"function roleListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $type = $this->login_id;\n $data['userRecords'] = $this->user_model->roleListing($type);\n\n $this->global['pageTitle'] = '角色管理';\n\n $this->loadViews(\"systemrolemanage\", $this->global, $data, NULL);\n }\n }",
"public function executeList()\n {\n return $this->renderComponent('roles', 'list');\n }",
"public static function GetAllRoles()\n {\n global $wp_roles;\n\n $rls = [];\n foreach ($wp_roles->roles as $key => $rl){\n array_push($rls,[\n 'slug' => $key,\n 'name' => $rl['name'],\n ]);\n }\n\n return $rls;\n }",
"public function getRoles()\n {\n $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name');\n\n $now = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId());\n\n unset($roles[array_search('super_administrator', $roles)]);\n unset($roles[array_search('user', $roles)]);\n\n foreach ($roles as $key => $role) {\n $roles[$key] = Yii::t('backend', $role);\n }\n\n return $roles;\n }",
"public function showAll(){\n\t\t\t$sql = \"SELECT r.CodRole,r.Nombre,r.Estado,r.updated_by,r.updated_at,u.CodUsuario,u.NombreUsuario FROM role r INNER JOIN usuario u ON r.updated_by=u.CodUsuario\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n $roles = Yii::$app->authManager->getRolesByUser($this->getId());\n return ArrayHelper::getColumn($roles, 'name', false);\n }",
"public function getRoles()\n\t{\n\t\t$roles = [];\n\n\t\tif (!$this->roles)\n\t\t\treturn $roles;\n\n\t\tforeach ($this->roles as $role)\n\t\t{\n\t\t\t$roles[$role->role] = $role->name;\n\t\t}\n\n\t\treturn $roles;\n\t}",
"public static function getRoleList()\n {\n return Rights::getAuthItemSelectOptions(CAuthItem::TYPE_ROLE, array(\n 'authenticated', 'guest'\n ));\n }",
"public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}",
"function ListaOpciones($rol_id) {\n\t\n\t\t\t$sql = \"SELECT * FROM modulo\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos_modulo = [];\n\t\t\t$respuesta->datos_opcion = [];\n\t\t\t$respuesta->datos_opcionxrol = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos_modulo[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\n\t\t\t\t$sql = \"SELECT * FROM opcion\";\n\t\t\t\t$db = new conexion();\n\t\t\t\t$result = $db->consulta($sql);\n\t\t\t\t$num = $db->encontradas($result);\n\t\n\t\t\t\tif ($num != 0) {\n\t\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t\t$respuesta->datos_opcion[] = mysql_fetch_array($result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$sql = \"SELECT * FROM opcionxrol WHERE rol_id = $rol_id\";\n\t\t\t\t$db = new conexion();\n\t\t\t\t$result = $db->consulta($sql);\n\t\t\t\t$num = $db->encontradas($result);\n\t\n\t\t\t\tif ($num != 0) {\n\t\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t\t$respuesta->datos_opcionxrol[] = mysql_fetch_array($result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}",
"public function getAllMoviesAndRoles() {\n \t$stmt = $this->DB->prepare (\"SELECT actors.first_name,actors.last_name,roles.role,movies.name FROM roles JOIN actors ON actors.id = roles.actor_id JOIN movies ON movies.id = roles.movie_id\");\n \t$stmt->execute();\n\n \treturn $stmt->fetchAll ( PDO::FETCH_ASSOC);\n }",
"public function showRoles(Request $request) {\n\n $roles = Roles::paginate(10);\n \n return $roles;\n \n }",
"function fantacalcio_admin_players_list() {\n $out = l(\"Aggiorna lista\", \"admin/fantacalcio/players/list\") . \"<br/>\";\n \n $players = Player::all();\n \n if ($players) {\n \n $header = array(\"Id\", \"Nome\", \"Ruolo\");\n \n foreach ($players as $pl_id => $player) {\n $names[] = $player->name;\n $roles[] = $player->role;\n }\n \n array_multisort($names, SORT_ASC, $roles, SORT_ASC, $players);\n \n foreach ($players as $pl_id => $player) {\n $rows[] = array(\n \"data\" => array(\n $player->id, \n l($player->name, \"admin/fantacalcio/players/\" . $player->id), \n Player::convertRole($player->role)));\n }\n \n $out .= theme(\"table\", array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table\", \"table-responsive\"))));\n }\n return $out;\n}",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"public function roleList()\n {\n $data['role_list'] = Role::Orderby('title', 'asc')->paginate(PAGINATE_SMALL, ['*'], 'p');\n// dd($data);\n return view('role.list', $data);\n }",
"public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }",
"function allroles()\n\t{\n\t\t// take the last role id\n\t\t$offset = $this->input->get('offset') ? $this->input->get('offset') : 0;\n\t\t// fetch 10 role from server\n\t\t$perpage = 10;\n\t\t// take search parameters\n\t\t$query['search'] = $this->input->get('search');\n\n\t\t// response object\n\t\t$jsonData = array('success' => false, 'data' => array(), 'links' => '');\n\n\t\t// total rows in roles table according to search query\n\t\t$total_rows = $this->role_model->fetch_total_role_rows($query);\n\t\t// fetch 10 roles start from 'offset' where query\n\t\t$roles = $this->role_model->fetch_all_roles($perpage, $offset, $query);\n\t\t// config data to create pagination\n\t\t$obj = array(\n\t\t\t'base_url' => base_url().'role/allroles/',\n\t\t\t'per_page' => $perpage,\n\t\t\t'uri_segment' => 2,\n\t\t\t'total_rows' => $total_rows\n\t\t);\n\t\t/**\n\t\t * if roles is not empty\n\t\t * @response object\n\t\t * \t success => everything all right\n\t\t * data => rolelist\n\t\t * \t links => pagination links\n\t\t */\n\t\tif (count($roles) > 0) {\n\t\t\t$jsonData['success'] = true;\n\t\t\t$jsonData['data'] = $roles;\n\t\t\t$jsonData['links'] = $this->custom->paginate($obj);\n\t\t}\n\t\t// responde send\n\t\techo json_encode($jsonData);\n\t}",
"public function getRoleList(): array\n\t{\n\t\tif (!empty(static::$roles))\n\t\t{\n\t\t\treturn static::$roles;\n\t\t}\n\t\t\n\t\t$roles = [];\n\t\t$roleListResult = CCrmRole::GetList(\n\t\t\t['ID' => 'ASC', ],\n\t\t\t['=GROUP_CODE' => self::ROLE_GROUP_CODE,]\n\t\t);\n\t\t\n\t\twhile ($role = $roleListResult->Fetch())\n\t\t{\n\t\t\t$roles[] = $role;\n\t\t}\n\t\tstatic::$roles = $roles;\n\t\t\n\t\treturn $roles;\n\t}",
"function displayRolesAll()\n {\n $conn = connect();\n $sql = \"SELECT ID, Name FROM Role\";\n\n $result = $conn->query($sql);\n while($val = $result->fetch_assoc())\n addRoleCard( $val[\"ID\"], $val[\"Name\"] );\n }",
"protected function getRoles(): array\n {\n $output = [];\n $options = [];\n $options['unlimited'] = true;\n $options['where'] = [\n 'userrole_priority' => '< 10000',\n ];\n $options['sortOrders'] = [['sort' => 'userrole_priority', 'order' => 'ASC']];\n $UserRolesDb = new \\Rdb\\Modules\\RdbAdmin\\Models\\UserRolesDb($this->Container);\n $output['listRoles'] = $UserRolesDb->listItems($options);\n\n unset($options, $UserRolesDb);\n return $output;\n }",
"public function index()\n {\n return Role::all();\n }",
"public function index()\n {\n return Role::all();\n }",
"private function roles($id){\n $role = Rol::find($id);\n return $role->users;\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"static public function get_all_roles() {\n\t\tif ( ! function_exists( 'get_editable_roles' ) ) {\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/user.php' );\n\t\t}\n\n\t\t$editable_roles = get_editable_roles();\n\t\t$roles = array();\n\t\t$caps = apply_filters( 'fl_builder_user_access_capabilities', array( 'edit_posts' ) );\n\n\t\tforeach ( $editable_roles as $role => $data ) {\n\t\t\tforeach ( $caps as $cap ) {\n\t\t\t\tif ( isset( $data['capabilities'][ $cap ] ) && 1 == $data['capabilities'][ $cap ] ) {\n\t\t\t\t\t$roles[ $role ] = $data['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $roles;\n\t}",
"public function getRoles(): array;",
"public function index()\n {\n $roles=Role::orderBy('sort')->get();\n return view('admin.role.role',compact('roles'));\n }",
"public function getRoles()\n {\n $id = Auth::id();\n $roles = \\App\\Models\\User::find($id)->roles;\n\n return $roles;\n }",
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }",
"function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }",
"public function getAllRoles()\n {\n return $this->repository->getAllRoles();\n }",
"public function roles()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.role'), config('bootstrap-menu.relations.permission_role'))->withTimestamps();\r\n }",
"public function listAjax(){\n $roles = Roles::select(['id','name','description']);\n return Datatables::of($roles)\n ->addColumn('action', function ($roles) {\n\n $a = '<a href=\"/#!/roles/edit/'.$roles->id.'\" class=\"btn btn-sm btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i> Edit</a>';\n if($roles->id>1){\n $a .= '<a href=\"javascript:void()\" data-id=\"'.$roles->id.'\" data-name=\"'.$roles->name.'\" class=\"btn btn-sm btn-danger rm-role\" style=\"margin-left:10px;\"><i class=\"icon-trash-b\"></i></a>';\n }\n return $a;\n })\n ->escapeColumns(['action'])\n ->make(false);\n }"
] | [
"0.7626586",
"0.68903637",
"0.6789378",
"0.67386603",
"0.67336816",
"0.66068685",
"0.65842694",
"0.65399075",
"0.6528065",
"0.6501007",
"0.64997554",
"0.64497507",
"0.64450026",
"0.64397794",
"0.643844",
"0.643844",
"0.643844",
"0.643844",
"0.6404932",
"0.639373",
"0.63833874",
"0.63757026",
"0.6363379",
"0.635468",
"0.6340617",
"0.6338522",
"0.6331011",
"0.631887",
"0.63126093",
"0.631107",
"0.6308749",
"0.6298722",
"0.62796855",
"0.6268927",
"0.62668043",
"0.62661403",
"0.62448037",
"0.62358195",
"0.6231005",
"0.6201468",
"0.62004685",
"0.6196893",
"0.6191017",
"0.6184001",
"0.61717826",
"0.6147559",
"0.6132048",
"0.61291397",
"0.6119862",
"0.61057615",
"0.6095912",
"0.6084298",
"0.6082051",
"0.60766953",
"0.60662204",
"0.6048985",
"0.60472256",
"0.6030054",
"0.6019592",
"0.6015819",
"0.60104674",
"0.5995233",
"0.59729975",
"0.59711957",
"0.5962962",
"0.5956255",
"0.59528774",
"0.593432",
"0.5930513",
"0.593022",
"0.593022",
"0.593022",
"0.5926581",
"0.5922538",
"0.59138775",
"0.5901177",
"0.59000576",
"0.5895555",
"0.5895457",
"0.58932316",
"0.58879346",
"0.5886796",
"0.5873737",
"0.58712333",
"0.58683366",
"0.5867982",
"0.5863127",
"0.5857205",
"0.5857205",
"0.5850392",
"0.5840248",
"0.5836685",
"0.58305806",
"0.5827595",
"0.58241916",
"0.581725",
"0.5814276",
"0.5806596",
"0.57830703",
"0.5767942"
] | 0.73717165 | 1 |
Listar un resumen limitado de roles. Selecciona el id, nombre, cantidad de usuarios asociados y cantidad de permisos asociados para uno de los roles segun el limite establecido. | public static function listarResumenRoles($limite): array {
if ($limite > 0) {
$consulta = "SELECT * FROM vw_rol ORDER BY id DESC LIMIT {$limite}";
return Conexion::getInstancia()->seleccionar($consulta);
}
return array(0, "No se estableció un limite válido");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}",
"public function roles()\n {\n $this->roles = $this->Role->list($_SESSION['guild_id']);\n }",
"public function indexRoles()\n {\n\n $users = User::with('roles')\n ->whereNotIn('id', [1, auth()->user()->id])\n ->orderBy('created_at', 'asc')\n ->paginate(10);\n\n $roles = Role::all();\n\n return view('admin.roles.assign', compact('users', 'roles'));\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }",
"public static function listarRoles(): array {\n $consulta = \"SELECT * FROM rol ORDER BY nombre\";\n return Conexion::getInstancia()->seleccionar($consulta);\n }",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = ' <a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }",
"public function listarRoles()\n {\n //return AutorizadorRol::all();\n\n $roles = AutorizadorRolAccion::join('autorizador_roles', 'autorizador_rol_acciones.rol_id', '=', 'autorizador_roles.id')\n ->selectRaw('autorizador_rol_acciones.id as accion_id,\n autorizador_rol_acciones.accion as controlador,\n autorizador_roles.id as rol_id,\n autorizador_roles.rol as rol,\n autorizador_roles.descripcion as descripcion'\n )->orderBy('rol')->get(); \n return response()->json($roles);\n }",
"public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}",
"public function showRoles(Request $request) {\n\n $roles = Roles::paginate(10);\n \n return $roles;\n \n }",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function index()\n {\n return Roles::all();\n }",
"public function mattRolesAction() {\n $opciones = $this->getRequest()->getSession()->get('opciones');\n\n $rolDao = new RolDao($this->getDoctrine());\n $roles = $rolDao->getRoles();\n return $this->render('MinSalSCAAdminBundle:Roles:manttRolesSystemForm.html.twig', array('roles' => $roles, 'opciones' => $opciones,));\n }",
"public function index()\n {\n $roles = Role::paginate(15);\n\n $permissions = array();\n $user_roles = Auth::user()->roles;\n foreach ($user_roles as $key => $val) {\n foreach ($val->permissions as $permission) {\n $permissions[$permission->id] = $permission->name;\n }\n }\n\n return view('roles.index')->withRoles($roles)->withPermissions($permissions);\n }",
"public function getAllRoles(): array;",
"private function get_all_roles(){\n return Role::all();\n }",
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}",
"public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }",
"public function rolesForUser();",
"public function getList() {\n $data['data'] = $this->role->get();\n return view('roles.list_role',$data);\n }",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }",
"public function index()\n {\n return Role::all();\n }",
"public function index()\n {\n return Role::all();\n }",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function list_roles(){\n $roles=$this->roles->pluck('name')->toArray();\n //el primer parametro es el separador, y el segundo para es el arreglo a seprar\n // es lo opuesto al explode que retorna una arreglo\n $string=implode(', ',$roles);\n return $string;\n\n }",
"public function indexRolesAction(){\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findAllRoles';\n $viewvar = 'roles';\n \n $repository = $this->em->getRepository($entity)->$repositoryFunction();\n $this->view->$viewvar = $repository;\n }",
"public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}",
"public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"public function show_roles(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/all_role';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\t\n\t\t\n\t}",
"public function findRoles() {\n\t\t\n\t}",
"public function displayRoles()\n { \n\n $user_data = $this->UserOrganisation_model->getAllByGet();\n foreach($user_data as $data){\n $email = $data->email;\n $roles = $this->UserOrganisation_model->findRole($data->id);\n if(count($roles)){\n foreach($roles as $role){\n $data = $role->name;\n $roleId = $role->pivot->role_id;\n $userId = $role->pivot->user_id;\n $arr_data = array('id'=>$roleId,'userId'=>$userId,'role'=>$data,'email'=>$email);\n $datas[]=$arr_data;\n }\n }else{\n $datas=$roles;\n }\n }\n return view('acl\\revoke_role', ['users' => $datas]);\n }",
"function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}",
"public function index()\n {\n $roles = Role::orderBy('created_at', 'desc')->paginate(AppHelper::DEFAULT_ITEMS_PER_PAGE); // 2 items per page\n $query = new QueryStringBuilder([\n 'page' => $roles->currentPage()\n ], localizedAdminURL('roles'));\n return view($this->themePage('role.list'), [\n 'roles' => $roles,\n 'query' => $query,\n 'page_helper' => new PaginationHelper($roles->lastPage(), $roles->currentPage(), $roles->perPage())\n ]);\n }",
"function allroles()\n\t{\n\t\t// take the last role id\n\t\t$offset = $this->input->get('offset') ? $this->input->get('offset') : 0;\n\t\t// fetch 10 role from server\n\t\t$perpage = 10;\n\t\t// take search parameters\n\t\t$query['search'] = $this->input->get('search');\n\n\t\t// response object\n\t\t$jsonData = array('success' => false, 'data' => array(), 'links' => '');\n\n\t\t// total rows in roles table according to search query\n\t\t$total_rows = $this->role_model->fetch_total_role_rows($query);\n\t\t// fetch 10 roles start from 'offset' where query\n\t\t$roles = $this->role_model->fetch_all_roles($perpage, $offset, $query);\n\t\t// config data to create pagination\n\t\t$obj = array(\n\t\t\t'base_url' => base_url().'role/allroles/',\n\t\t\t'per_page' => $perpage,\n\t\t\t'uri_segment' => 2,\n\t\t\t'total_rows' => $total_rows\n\t\t);\n\t\t/**\n\t\t * if roles is not empty\n\t\t * @response object\n\t\t * \t success => everything all right\n\t\t * data => rolelist\n\t\t * \t links => pagination links\n\t\t */\n\t\tif (count($roles) > 0) {\n\t\t\t$jsonData['success'] = true;\n\t\t\t$jsonData['data'] = $roles;\n\t\t\t$jsonData['links'] = $this->custom->paginate($obj);\n\t\t}\n\t\t// responde send\n\t\techo json_encode($jsonData);\n\t}",
"public function list()\n {\n $roles = Role::query()->select(['*'])\n ->withCount(['users', 'permissions']);\n\n return $this->apiListingResponse($roles, [\n ...$this->fieldsToExpose,\n 'permissions_count',\n 'users_count',\n ]);\n }",
"function roleListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $type = $this->login_id;\n $data['userRecords'] = $this->user_model->roleListing($type);\n\n $this->global['pageTitle'] = '角色管理';\n\n $this->loadViews(\"systemrolemanage\", $this->global, $data, NULL);\n }\n }",
"public function roleList()\n {\n $roleList = '<ul>';\n foreach ($this->roles as $role) {\n $roleList .= '<li>'.$role->name.'</li>';\n }\n $roleList .= '</ul>';\n\n return $roleList;\n }",
"public function getRoles()\n\t{\n\t\t$roles = $this->role_gestion->all();\n\n\t\treturn view('back.users.roles', compact('roles'));\n\t}",
"public function getManageRoles()\n {\n $roles = Role::orderBy('id', 'asc')->paginate(10);\n return view('adminlte.pages.admin.manage-roles', compact('roles'));\n }",
"public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }",
"public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }",
"public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"public function roleList()\n {\n $data['role_list'] = Role::Orderby('title', 'asc')->paginate(PAGINATE_SMALL, ['*'], 'p');\n// dd($data);\n return view('role.list', $data);\n }",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }",
"public function index()\n\t{\n\t\treturn inertia('Admin/roles/roles', [\n\t\t\t'roles' => Role::withCount('permissions', 'users')->get()\n\t\t]);\n\t}",
"public function index()\n {\n $order = [\n 'column' => 'name',\n 'direction' => 'asc'\n ];\n if (auth()->user()->can('super')) {\n $data = Role::orderBy($order['column'], $order['direction'])->paginate(env('APP_RESULTS_PER_PAGE'));\n } else {\n $data = Role::where('visible', 1)->orderBy($order['column'], $order['direction'])->paginate(env('APP_RESULTS_PER_PAGE'));\n }\n\n return view('admin.role.index', compact('data', 'order'));\n }",
"public function index()\n {\n $roles = Role::paginate(100);\n return view(\"admin.roles.index\", compact(\"roles\"));\n }",
"public function roles()\n {\n return response()->json(['roles' => UserRole::getRoleList()]);\n }",
"public function getRoles(){\n\n $roles = $this->visiteur_roles->map(function($role){\n return $role->getTitle();\n })->ToArray();\n\n $roles[]= 'ROLE_USER';\n \n return $roles;\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"public function index()\n {\n return Role::orderBy('type', 'asc')->get();\n }",
"function get_all_roles($params = array())\n {\n $this->db->order_by('roles_id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('roles')->result_array();\n }",
"public function index()\n {\n // return collection of all roles\n return RoleIndexResource::collection(Role::info()->get());\n }",
"public function listView()\r\n {\r\n $data['roles'] = $this->AdminRoleModel->getAll();\r\n $firstRoleId = isset($data['roles'][0]['role_id']) ? $data['roles'][0]['role_id'] : '';\r\n $data['permissions'] = $this->AdminRoleModel->getPermissions($firstRoleId);\r\n echo $this->load->view('admin/roles/list', $data, TRUE);\r\n }",
"public function index()\n {\n return view('roles.index')->withRoles(Role::paginate(15));\n }",
"public function roles()\n {\n\n return Role::all();\n }",
"public function index()\n {\n $paginator = $this->roleRepository->getAllWithPaginate(10);\n\n return view('admin.roles.index', compact('paginator'));\n }",
"public function & GetRoles ();",
"public function index() {\n\t\tCache::store()->clear();\n\n\t\t$this->syncPermissions();\n\n\t\t$Roles = Role::query()->latest()->paginate( 20 );\n\n\t\treturn view( 'admin.roles.index', compact( 'Roles' ) );\n\t}",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"private function getRoles()\n\t{\n\t\tif (!isset($this->roles)) {\n\t\t\t$this->roles = $this->roles()\n\t\t\t\t->with('permissions')\n\t\t\t\t->withCount('users')\n\t\t\t\t->get();\n\t\t}\n\t\treturn $this->roles;\n\t}",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"public function listPermissionByRole()\n {\n $roles = $this->roleRepository->all();\n $permissions = $this->permissionRepository->all();\n return view('admin.permission.permission_role', compact('roles', 'permissions'));\n }",
"public function roles()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.role'), config('bootstrap-menu.relations.permission_role'))->withTimestamps();\r\n }",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"protected function get_roles_disponibles()\n\t{\n\t\t$roles_existentes = array();\n\t\t$datos = $this->db->listar_roles();\n\t\tforeach($datos as $valor) {\n\t\t\t$roles_existentes[] = strtolower($valor['rolname']);\n\t\t}\n\t\treturn $roles_existentes;\n\t}",
"public function roles()\n\t{\n\t\treturn $this->belongsToMany('Regulus\\Identify\\Models\\Role', Auth::getTableName('user_roles'))\n\t\t\t->withTimestamps()\n\t\t\t->orderBy('display_order')\n\t\t\t->orderBy('name');\n\t}",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public function listAll()\n {\n $roles = $this->model->lists('name', 'id');\n\n return $roles;\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function index()\n {\n $roles = Role::orderBy('name')->get();\n\n\t\treturn view('roles.list', compact('roles'));\n }",
"public function index()\n {\n $per_page = 20;\n return view('admin.role.index')\n ->withRoles($this->role->getRolePaginated($per_page));\n }",
"public function getRoles(): array;",
"public function index()\n {\n $this->authorize('viewAny', Role::class);\n return Role::all();\n }",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function index()\n {\n $roles = Role::orderBy('id','DESC')->paginate(10);\n return view('admin::roles.index',compact('roles'));\n }",
"public function getVacancyRoleSelect()\n {\n $roles = new \\Object\\VacancyRole\\Listing();\n $roles->setOrderKey(\"name\");\n $list = $roles->load();\n\n $roles = [];\n\n foreach ($list as $vacancyRole) {\n $roles[$vacancyRole->getId()] = $vacancyRole->getName();\n }\n\n return $roles;\n }",
"public function index()\n {\n $roles = Role::paginate(30);\n $table = RolePresenter::table($roles);\n\n Site::set('title', trans('orchestra/control::title.roles.list'));\n\n return View::make('orchestra/control::roles.index', array(\n 'roles' => $roles,\n 'table' => $table,\n ));\n }",
"public function getRoles()\r\n {\r\n return $this->roles;\r\n }",
"public function index()\n {\n if (\\Gate::allows('isAdmin') || \\Gate::allows('isSKAdmin')) {\n return Role::latest()->paginate(5);\n }\n }",
"public function getRoleList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_role');\r\n\t\t$this->db->where('role_status', '1');\r\n\t\t$this->db->where('role_id !=', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}",
"public function roles()\n {\n return $this->belongsToMany(Config::get('laracancan.role_model', 'Hamedmehryar\\Laracancan\\Models\\Role'), 'lcc_role_user', 'user_id', 'role_id');\n }",
"public function getRoleList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_role');\n\t\t$this->db->where('role_status', '1');\n\t\t$this->db->where('role_id !=', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}",
"public function index()\r\n {\r\n $roles = AdminRole::all();\r\n return view('admin.role.list')->with('roles', $roles);\r\n }",
"public function index()\n\t{\n\t\t$roles = Role::orderBy('id', 'DESC')->paginate(10);\n\n\t\treturn view('roles.index', compact('roles'))->with('i');\n\t}",
"public function index()\n {\n if(Auth::user()->can('list-roles')){\n $roles = Role::orderBy('id', 'DESC')->get();\n return view(\"roles.index\", compact('roles'));\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }"
] | [
"0.7244106",
"0.717365",
"0.7018752",
"0.70109254",
"0.6955933",
"0.693262",
"0.693262",
"0.693262",
"0.693262",
"0.69078493",
"0.68993795",
"0.6840279",
"0.6819489",
"0.67942625",
"0.67924464",
"0.678074",
"0.6780577",
"0.6772386",
"0.6747796",
"0.6741106",
"0.67353255",
"0.6731232",
"0.6718539",
"0.67181027",
"0.6714696",
"0.6702557",
"0.66994226",
"0.6687078",
"0.66831446",
"0.66442335",
"0.66442335",
"0.6637387",
"0.66340286",
"0.66312057",
"0.66172296",
"0.66168505",
"0.6612666",
"0.66121584",
"0.66098505",
"0.65849835",
"0.65822166",
"0.6577802",
"0.6570618",
"0.65657675",
"0.65654105",
"0.6550175",
"0.65382177",
"0.6527847",
"0.6525868",
"0.6525713",
"0.65253496",
"0.65120274",
"0.651076",
"0.64866006",
"0.64830875",
"0.6468478",
"0.6454117",
"0.64477974",
"0.644455",
"0.6435301",
"0.64286464",
"0.64279157",
"0.6423571",
"0.6420952",
"0.6419109",
"0.6409785",
"0.6409765",
"0.64075613",
"0.63986427",
"0.639182",
"0.63897264",
"0.6387597",
"0.6387597",
"0.6387597",
"0.63842857",
"0.6379692",
"0.6370039",
"0.63680196",
"0.6355278",
"0.6353044",
"0.6351017",
"0.6348168",
"0.6343414",
"0.63423675",
"0.63417125",
"0.63308895",
"0.63212204",
"0.6321195",
"0.6312084",
"0.63041526",
"0.6302921",
"0.6302452",
"0.6301367",
"0.6300718",
"0.62980187",
"0.6294905",
"0.62931556",
"0.629311",
"0.6286905",
"0.628606"
] | 0.7205636 | 1 |
Returns the principal ID. | public function getId(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPrincipalId()\n {\n if (array_key_exists(\"principalId\", $this->_propDict)) {\n return $this->_propDict[\"principalId\"];\n } else {\n return null;\n }\n }",
"public function getPrincipal() {\n return $this->principal;\n }",
"public function id()\n {\n if ($this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n return null;\n }",
"protected function getPrincipal() {\n\t\t$webSession = WebSession::getInstance();\n\t\treturn $webSession->getPrincipal();\n\t}",
"public function id()\n {\n return $this->_getAuthId();\n }",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->id;\n\t}",
"public function getAuthIdentifier()\n {\n \treturn $this->id;\n }",
"public function getAuthIdentifier()\n {\n return $this->id;\n }",
"public function getAuthIdentifier()\n {\n return $this->id;\n }",
"public function getAuthIdentifier()\n {\n return $this->id;\n }",
"public static function resolveId()\n {\n return Auth::check() ? Auth::user()->getAuthIdentifier() : null;\n }",
"public function GetId() {\n\t\t\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['id'];\n\t}",
"public function getAuthIdentifier()\n {\n // TODO: Implement getAuthIdentifier() method.\n return $this->{$this->getAuthIdentifierName()};\n }",
"public function getResourceOwnerId() {\n\t\treturn $this->getClaims()['sub'];\n\t}",
"public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }",
"public function getId()\n {\n return $this->resourceOwnerId;\n }",
"public static function id ()\n {\n return self::user()->getId();\n }",
"public function getAuthIdentifier()\n {\n $name = $this->getAuthIdentifierName();\n\n return $this->{$name};\n }",
"public function getAuthIdentifier() {\n return $this->id_user;\n }",
"public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }",
"public function getPrimaryId()\n {\n return $this->primary_id;\n }",
"public function getAuthIdentifier(){\n return $this->id;\n }",
"function GetId ()\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $data = $this->mongo->dataFindOne( array( \"username\" => $this->username ) );\n return isset( $data[ \"_id\" ] ) ? $data[ \"_id\" ] : 0;\n }",
"public function getAuthIdentifier()\n {\n return $this->{self::getAuthIdentifierName()};\n }",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }",
"public function getAuthIdentifier()\n {\n\t\treturn $this->getKey();\n\t}",
"public function getRolePrimaryKeyName() {\n\n $forcedPkName = Configure::read('acl.aro.role.primary_key');\n if (! empty($forcedPkName)) {\n return $forcedPkName;\n } else {\n /* Return the primary key's name that follows the CakePHP\n * conventions */\n return 'id';\n }\n }",
"public function getAuthIdentifier()\n\t{\n\t return $this->getKey();\n\t}",
"public function authID() {\n\tif (!$this->activecontainer) {return false;}\n\treturn $this->activecontainer->getID();\n}",
"public function getAuthIdentifier(){\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n {\n return $this->attributes[$this->primaryKey];\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getPrincipalId(): ?string {\n $val = $this->getBackingStore()->get('principalId');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'principalId'\");\n }",
"public function getAuthIdentifier() {\n\t\treturn $this -> getKey();\n\t}",
"public function getUserId() {\n\t\treturn $this->Session->read('UserAuth.User.id');\n\t}",
"public function getPrincipal(): Principal\n {\n if ($this->principal === null && !$this->resume()) {\n $this->principal = Principal::getAnonymous();\n }\n return $this->principal;\n }",
"public function getAuthIdentifier() {\n return $this->getKey();\n }",
"public function getAuthIdentifier() {\n return $this->getKey();\n }",
"public function getId()\n {\n return $this->authorize();\n }",
"public function getPrincipal()\n {\n if (array_key_exists(\"principal\", $this->_propDict)) {\n if (is_a($this->_propDict[\"principal\"], \"\\Microsoft\\Graph\\Model\\DirectoryObject\") || is_null($this->_propDict[\"principal\"])) {\n return $this->_propDict[\"principal\"];\n } else {\n $this->_propDict[\"principal\"] = new DirectoryObject($this->_propDict[\"principal\"]);\n return $this->_propDict[\"principal\"];\n }\n }\n return null;\n }",
"public function _getID()\n {\n $this->selftest();\n return $this->objectUser->ID;\n }",
"private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier() {\n return $this->getKey();\n }",
"public function getId(): int\n {\n return $this->getIdentityData('id');\n }",
"public function getId() {\n foreach ($this->generateCarsInfo() as $prop) {\n $id_user = $prop->getId_user() . \"\\n\";\n }\n return $id_user;\n }",
"public function getAuthIdentifier()\n {\n return $this->token->getClaim('sub');\n }",
"public static function resolveId()\n\t{\n\t\treturn auth()->guard('api')->check() ? auth()->guard('api')->user()->getAuthIdentifier() : null;\n\t}",
"public function setPrincipalId($val)\n {\n $this->_propDict[\"principalId\"] = $val;\n return $this;\n }",
"public function principal()\n {\n return $this->belongsTo(Principal::class);\n }",
"public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}",
"public function get_personal_tutor_id() {\n global $remotedb;\n $sql = \"SELECT id FROM {role} WHERE shortname = ?\";\n $params = array('personal_tutor');\n $tutor = $remotedb->get_record_sql($sql, $params);\n return $tutor ? $tutor->id : 0;\n }",
"public function getID(): int\n {\n $session = new Session();\n $idEncryption = new IDEncryption();\n\n return $idEncryption->decrypt($session->get('userID'));\n }",
"public function obtenerID();",
"public function getAuthIdentifier() {\r\n return $this -> getKey();\r\n }",
"public function getId()\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n return $session->idaccount;\n }",
"function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}",
"public function getID() {\n return $this->user_id;\n }",
"public function getPrimaryUid() {\n return $this->get(self::PRIMARY_UID);\n }",
"public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }",
"public function getId()\n {\n return $this->getProperty('account_id', 'int');\n }",
"public function getPId();",
"public function getAuthIdentifierName()\n {\n return \"id\";\n }",
"function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }",
"public function getID()\n {\n // this only works for web users!\n return $this->session->userdata('ID');\n }"
] | [
"0.8723103",
"0.71026117",
"0.7037248",
"0.6959003",
"0.69472176",
"0.6811821",
"0.6706177",
"0.66861",
"0.66861",
"0.66861",
"0.6676584",
"0.6620191",
"0.6615845",
"0.6604509",
"0.6588969",
"0.658857",
"0.6548947",
"0.6541387",
"0.6536758",
"0.6523039",
"0.65201414",
"0.651827",
"0.651581",
"0.6491915",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.6476796",
"0.64669853",
"0.6466281",
"0.6449677",
"0.643921",
"0.6438784",
"0.63974893",
"0.63561404",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63373774",
"0.63296515",
"0.63293105",
"0.6324763",
"0.6323518",
"0.631325",
"0.631325",
"0.6301996",
"0.6279858",
"0.6274178",
"0.626296",
"0.6239486",
"0.62130183",
"0.620697",
"0.61988807",
"0.6185969",
"0.618397",
"0.61811286",
"0.6167891",
"0.6167384",
"0.615741",
"0.61531353",
"0.61526406",
"0.61511976",
"0.61439896",
"0.6131711",
"0.6129809",
"0.6129535",
"0.61210686",
"0.6119628",
"0.6118267",
"0.61167413",
"0.61152506",
"0.61101156"
] | 0.0 | -1 |
Sets the principal ID | public function setId($id); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPrincipalId($val)\n {\n $this->_propDict[\"principalId\"] = $val;\n return $this;\n }",
"public function setPrincipalId(?string $value): void {\n $this->getBackingStore()->set('principalId', $value);\n }",
"public function getPrincipalId()\n {\n if (array_key_exists(\"principalId\", $this->_propDict)) {\n return $this->_propDict[\"principalId\"];\n } else {\n return null;\n }\n }",
"public function setPrincipal($val)\n {\n $this->_propDict[\"principal\"] = $val;\n return $this;\n }",
"function SetId($value) { $this->id=$value; }",
"public function setPrincipalId($principalId)\n {\n $this->principalId = $principalId;\n return $this;\n }",
"public function changePrincipal($id, Request $request)\n {\n $producto = Producto::find($id);\n $producto->imgPrincipal = $request->input('0');\n $producto->update();\n }",
"public function setIdRole($value)\n {\n $this->_id_role = $value;\n }",
"public function set_id($setid){\n $this->id = $setid;\n }",
"protected function setPrimaryIdentifier($id)\n {\n $this->parameters[$this->primaryIdentifier] = $id;\n }",
"private function _setIdentity(){\n $this->_setUserData($this->getClassUser()->getIdentity());\n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"protected function _setId($value)\n\t{\n\t\tvar_dump($value);\n\t\tif (empty($value) || ($value < 0)) {\n\t\t\ttrigger_error('Invalid value used to set the member id', E_USER_ERROR);\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\t$this->_id = $value;\n\t\t\t$_SESSION['user_id']=$value;\n\t\t\t\n\n\t\t}\n\t}",
"public function testGettingId()\n {\n $this->assertEquals('bar', $this->principal->getId());\n }",
"public function setIdentifier($id)\n {\n $this->uid = (int)$id;\n }",
"private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}",
"function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}",
"public function setIduser($value)\n {\n $this->iduser = $value;\n }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"private function setId($id)\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n $session->idaccount = $id;\n }",
"public function setIdusuario($value){\n $this->idusuario = $value;\n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"public static function setCurrentID($id) {\n Session::put(Privilege::SESSION_NAME_ID, $id);\n }",
"function setCertId($value)\n {\n $this->_props['CertId'] = $value;\n }",
"public function setID($id) {\n $this->id = $id; \n }",
"public function setId()\n {\n $apiKey = new ApiKey;\n $apiKey->setId();\n $this->id = $apiKey->getId();\n }",
"public function setID($id){\n $this->ID = $id;\n }",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"function set_id($id)\n {\n $this->id = $id;\n }",
"function setId($id) {\n\t\t$this->_id = $id;\n\t}",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function setID($aID) {\n $this->id = $aID;\n }",
"public function setID($id){\n $this->id = $id;\n }",
"public function setUserId() {\n $this->user_id = $user_id;\n }",
"public function setId($id) {\n $this->set('id', $id, 'user');\n }",
"function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"public function setId($id){\n $this->_id = $id;\n }",
"public function set_current_user_id($id)\n {\n $this->current_user_id = $id;\n }",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"function setId($id){\r\n\t\t$this->id = $id;\r\n\t}",
"public function set_id($id){\n $this->id = $id;\n }",
"public function setID($id){\n $this->id=$id;\n }",
"function set_id($id)\n {\n $this->set_default_property(self :: PROPERTY_ID, $id);\n }",
"function setId($id)\n {\n $this->id = $id;\n }",
"public function setLoginId(): void\n {\n }",
"public function setIdPROVEEDORES($idPROVEEDORES){\n $this->idPROVEEDORES = $idPROVEEDORES;\n }",
"public function setUserid($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_90'));\n\t\tif(!Validator::AccountId($value)) throw new Exception(lang('error_90'));\n\t\t\n\t\t$this->_userid = $value;\n\t}",
"public function setId(string $id) : void\n {\n $this->set('id', $id, 'roles');\n }",
"public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}",
"function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }",
"function setAccount($id)\n\t{\n\t\t$this->accountId = $id;\n\t}",
"public function setId($id) { $this->id = $id; }",
"public function set_owner_id($owner)\n {\n $this->set_default_property(self::PROPERTY_OWNER_ID, $owner);\n }",
"public function setID($id)\n {\n $this->ID = $id;\n }",
"public function set_user_id( $value ) {\n\t\t$this->set_prop( 'user_id', absint( $value ) ) ;\n\t}",
"public function setInitiatedByUserPrincipalName($val)\n {\n $this->_propDict[\"initiatedByUserPrincipalName\"] = $val;\n return $this;\n }",
"public function setID($id);",
"public function setId(int $userId)\n {\n $this->_id = (int) $userId;\n }",
"public function setId($pId) {\n\t\t$this->Id = $pId;\n\t}",
"public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}",
"function setAmocrmIntegreationId(string $id): void {\n\t}",
"public function updateId() {\n $this->Id = session_id();\n }",
"public function setID($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n $this->datosprop->setId_prop_carac($id);\n }",
"public function setId($id){\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = $id;\n }",
"public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}",
"public function setId($id)\n {\n $this->id = $id;\n\n \n }",
"public function setId($id) \n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->setIdExpert($id);\n }",
"function setReviewerId($reviewerId) {\n\t\t$this->setData('reviewerId', $reviewerId);\n\t}",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\r\n $this->_id = $id;\r\n }",
"function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}",
"public function set($new_id);",
"private function setId($id)\n {\n $this->id = $id;\n }",
"public function SetIdUser($id_user)\n {\n $this->id_user = $id_user;\n return;\n\n }",
"public function SetId ($id);",
"public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}",
"public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}",
"public function setId($value) {\r\n\t\t$this->_id = $value;\r\n\t\treturn $this;\r\n\t}",
"public function setIdentity($value);",
"public function setID($id)\n {\n $this->id = $id;\n }",
"public function principal()\n {\n return $this->belongsTo(Principal::class);\n }",
"public function edit(Principal $principal)\n {\n //\n }",
"public function setId_user($id_user)\n {\n $id_user = (int) $id_user;\n $this->_id_user = $id_user;\n }",
"public function setId_user($id_user)\n {\n $id_user = (int) $id_user;\n $this->_id_user = $id_user;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId( $id )\n {\n $this->id = $id;\n }",
"public function setId($x) { $this->id = $x; }",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setIdp($idp)\n {\n $this->idp = $idp;\n }",
"public function setPrimaryId($value) {\n if (empty($value))\n throw new InvalidArgumentException('An primaryId must have a value');\n $this->primaryId = $value;\n return $this;\n }"
] | [
"0.7764722",
"0.74994487",
"0.64850694",
"0.63510585",
"0.62395316",
"0.615987",
"0.6138809",
"0.5984786",
"0.58468956",
"0.5838161",
"0.58157444",
"0.5782137",
"0.5778441",
"0.5761704",
"0.57538056",
"0.57513374",
"0.57077646",
"0.56931454",
"0.56845754",
"0.56813616",
"0.56744874",
"0.56604743",
"0.5649793",
"0.5636126",
"0.56329054",
"0.5632471",
"0.5630328",
"0.56004435",
"0.5593372",
"0.55842525",
"0.55766666",
"0.5576394",
"0.55597526",
"0.5555837",
"0.5540625",
"0.5528899",
"0.551994",
"0.551994",
"0.5518895",
"0.5516687",
"0.5515156",
"0.55067366",
"0.5496766",
"0.5494299",
"0.5490942",
"0.54894096",
"0.5485639",
"0.5485342",
"0.54764473",
"0.54695946",
"0.5465344",
"0.54591936",
"0.5458016",
"0.5454339",
"0.54523015",
"0.5446831",
"0.54458463",
"0.5428131",
"0.5417224",
"0.54140604",
"0.5413985",
"0.5403017",
"0.54017377",
"0.5398922",
"0.5397514",
"0.5396823",
"0.5394369",
"0.5394369",
"0.5394369",
"0.5394347",
"0.5392923",
"0.5386517",
"0.5374677",
"0.53725684",
"0.5370795",
"0.5368496",
"0.5366986",
"0.5359761",
"0.5355141",
"0.53544694",
"0.5352542",
"0.5351905",
"0.5347694",
"0.53473866",
"0.534721",
"0.5345783",
"0.53390664",
"0.53371143",
"0.53338623",
"0.5330639",
"0.53277814",
"0.53277814",
"0.53250706",
"0.5323882",
"0.5317369",
"0.531478",
"0.531478",
"0.5312104",
"0.5312104",
"0.5311569",
"0.5309154"
] | 0.0 | -1 |
Create a new command instance. | public function __construct()
{
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }",
"public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}",
"public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}",
"protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }",
"static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }",
"public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;",
"public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }",
"public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }",
"public function command(Command $command);",
"public function __construct($command)\n {\n $this->command = $command;\n }",
"public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }",
"protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }",
"public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }",
"public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }",
"public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }",
"public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;",
"private function _getCommandByClassName($className)\n {\n return new $className;\n }",
"public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }",
"public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }",
"private function __construct($command = null)\n {\n $this->command = $command;\n }",
"public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }",
"public function getCommand() {}",
"protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }",
"public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }",
"public function getCommand();",
"protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }",
"public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }",
"public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }",
"public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }",
"public function getCommand()\n {\n }",
"public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }",
"protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }",
"public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}",
"public function addCommand($command);",
"public function add(Command $command);",
"abstract protected function getCommand();",
"public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}",
"protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }",
"public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }",
"protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}",
"public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }",
"private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }",
"public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }",
"public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }",
"public function create() {}",
"protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }",
"public function create(){}",
"protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }",
"public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }",
"protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}",
"public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }",
"public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }",
"public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }",
"public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }",
"public function createCommand(?string $sql = null, array $params = []): Command;",
"public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }",
"public function generateCommands();",
"protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }",
"protected function buildCommand()\n {\n return $this->command;\n }",
"public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }",
"public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }",
"public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }",
"protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }",
"protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }",
"public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }",
"protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}",
"public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }",
"public function buildCommand()\n {\n return parent::buildCommand();\n }",
"private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }",
"public function getCommand(string $command);",
"protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}",
"public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }",
"public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }",
"protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }",
"public function generateCommand($singleCommandDefinition);",
"public function create() {\n }",
"public function create() {\n }",
"public function create() {\r\n }",
"public function create() {\n\n\t}",
"private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }",
"public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }",
"public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }",
"public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }",
"public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\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();"
] | [
"0.8010746",
"0.7333379",
"0.72606754",
"0.7164165",
"0.716004",
"0.7137585",
"0.6748632",
"0.67234164",
"0.67178184",
"0.6697025",
"0.6677973",
"0.66454077",
"0.65622073",
"0.65437883",
"0.64838654",
"0.64696646",
"0.64292693",
"0.6382209",
"0.6378306",
"0.63773245",
"0.6315901",
"0.6248427",
"0.6241929",
"0.6194334",
"0.6081284",
"0.6075819",
"0.6069913",
"0.60685146",
"0.6055616",
"0.6027874",
"0.60132784",
"0.60118896",
"0.6011778",
"0.5969603",
"0.59618074",
"0.5954538",
"0.59404427",
"0.59388787",
"0.5929363",
"0.5910562",
"0.590651",
"0.589658",
"0.589658",
"0.589658",
"0.58692765",
"0.58665586",
"0.5866528",
"0.58663124",
"0.5852474",
"0.5852405",
"0.58442044",
"0.58391577",
"0.58154446",
"0.58055794",
"0.5795853",
"0.5780188",
"0.57653266",
"0.57640004",
"0.57584697",
"0.575748",
"0.5742612",
"0.5739361",
"0.5732979",
"0.572247",
"0.5701043",
"0.5686879",
"0.5685233",
"0.56819254",
"0.5675983",
"0.56670785",
"0.56606543",
"0.5659307",
"0.56567776",
"0.56534046",
"0.56343585",
"0.56290466",
"0.5626615",
"0.56255764",
"0.5608852",
"0.5608026",
"0.56063116",
"0.56026554",
"0.5599553",
"0.5599351",
"0.55640906",
"0.55640906",
"0.5561977",
"0.5559745",
"0.5555084",
"0.5551485",
"0.5544597",
"0.55397296",
"0.5529626",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908"
] | 0.0 | -1 |
Create a new notification instance. | public function __construct($from)
{
$this->from = $from;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function create($notification){\n }",
"public static function createNotification($type, $eventid){\n\t\t$notification = new Notification; \n\t\t$notification->type = $type;\n\t\t$notification->eventid = $eventid;\n\t\t$notification->time = date('Y-m-d H:i:s');\n\t\t$notification->save();\n\t\treturn $notification;\n\t}",
"public function create($payload)\n {\n return $this->notification->create($payload);\n }",
"public static function create( array $info ) {\n\t\t$obj = new Notification();\n\t\tstatic $validFields = [ 'event', 'user' ];\n\n\t\tforeach ( $validFields as $field ) {\n\t\t\tif ( isset( $info[$field] ) ) {\n\t\t\t\t$obj->$field = $info[$field];\n\t\t\t} else {\n\t\t\t\tthrow new InvalidArgumentException( \"Field $field is required\" );\n\t\t\t}\n\t\t}\n\n\t\tif ( !$obj->user instanceof User ) {\n\t\t\tthrow new InvalidArgumentException( 'Invalid user parameter, expected: User object' );\n\t\t}\n\n\t\tif ( !$obj->event instanceof Event ) {\n\t\t\tthrow new InvalidArgumentException( 'Invalid event parameter, expected: Event object' );\n\t\t}\n\n\t\t// Notification timestamp should be the same as event timestamp\n\t\t$obj->timestamp = $obj->event->getTimestamp();\n\t\t// Safe fallback\n\t\tif ( !$obj->timestamp ) {\n\t\t\t$obj->timestamp = wfTimestampNow();\n\t\t}\n\n\t\t// @Todo - Database insert logic should not be inside the model\n\t\t$obj->insert();\n\n\t\treturn $obj;\n\t}",
"private function createNotification($id, $request)\n {\n $count = Notification::max('count');\n\n $notification = Notification::create([\n 'model_id' => $id,\n 'count' => intval($count) + 1,\n 'type' => $request->get('ntype'),\n 'subject' => $request->get('subject'),\n 'message' => $request->get('message'),\n 'sent_at' => Carbon::now(),\n ]);\n }",
"public function maybe_create_notification() {\n\t\tif ( ! $this->should_show_notification() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {\n\t\t\t$notification = $this->notification();\n\t\t\t$this->notification_helper->restore_notification( $notification );\n\t\t\t$this->notification_center->add_notification( $notification );\n\t\t}\n\t}",
"public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }",
"public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }",
"public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }",
"protected function createNotificationInstance($data)\n {\n if ($data === false) {\n return null;\n }\n\n /** @var Notification $model */\n $model = Instance::ensure($this->dataClass, Notification::class);\n\n if (!empty($data['id'])) {\n $model->setId($data['id']);\n }\n\n $model->setType($data['type']);\n $model->setData(is_string($data['data']) ? Json::decode($data['data']) : $data['data']);\n $model->setUserId($data['user_id']);\n $model->setTimestamp($data['created_at']);\n $model->setRead((bool)$data['is_read']);\n $model->setOwner($this->owner);\n\n return $model;\n }",
"public function create()\n\t{\n\t\tlog::info('inside create method of user-notifications controller');\n\t}",
"public function created(Notification $notification)\n {\n $this->sendBroadcast($notification);\n }",
"public function newNotification($event)\n {\n return new ExampleNotification($event);\n }",
"public function create()\n {\n $this->authorize('create', Notification::class);\n\n return view('rb28dett_notifications::create');\n }",
"public function actionCreate()\n {\n $model = new Notification();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->notification_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"private function createMessageObject(string $type, string $message): Notification\n {\n $msg = new Notification();\n\n $msg->setType($type);\n $msg->setMessage($message);\n\n $this->handler->add($msg);\n\n return $msg;\n }",
"public function create() {\n return View::make('notifications.create');\n }",
"protected function create_notification_email_object()\n\t{\n\t\t$category = $this->category();\n\n\t\t$email = new Charcoal_Email;\n\t\t$email->to = $this->get_notified_email_address();\n\t\t$email->reply_to = $this->get_lead_email_address();\n\n\t\tif ( $category ) {\n\t\t\t$email->subject = $category->p('confirmation_email_subject')->text();\n\t\t\t$email->from = $category->p('confirmation_email_from')->text();\n\t\t\t$email->cc = $category->v('confirmation_email_cc');\n\t\t\t$email->bcc = $category->v('confirmation_email_bcc');\n\t\t}\n\n\t\treturn $email;\n\t}",
"public function create()\n {\n return view ('notifications.create');\n }",
"protected function emitNotificationCreated(Notification $notification) {}",
"public function __construct($new_postNotification)\n {\n //\n $this->postNotification = $new_postNotification;\n\n }",
"public static function createFromArray($fields) \n\t{\n\t\t$notification = new Notification();\n\t\tself::populate($notification,$fields);\n\t\treturn $notification;\n\t}",
"public function create()\n {\n return view('admin.notifications.create');\n }",
"public function create()\n {\n return view('admin.notifications.create');\n }",
"function notify($user_id, $message)\n{\n return (new Notification([\n 'user_id' => $user_id,\n 'message' => $message\n ]))->save();\n}",
"public function actionCreate() {\n\t\t$model = new Notification();\n\t\t$model->created_by = Yii::$app->user->identity->id;\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\n\t\t\tif ($model->send_to != '') {\n\t\t\t\t$model->send_to = implode(',', $model['send_to']);\n\t\t\t}\n\t\t\t$model->sent_time = date('Y-m-d H:i:s');\n\t\t\t$model->save();\n\t\t\t/*if ($model->save()) {\n\t\t\t\t$send_to = explode(',', $model['send_to']);\n\t\t\t\tforeach ($send_to as $key => $value) {\n\t\t\t\t\tif ($value == 'all') {\n\t\t\t\t\t\t$userId = 'allUser';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$user = User::find()->where(['id' => $value])->one();\n\t\t\t\t\t\t$userId = $user['phone'];\n\t\t\t\t\t}\n\t\t\t\t\tYii::$app->Utility->pushNotification($userId, $model['notification_name'], $model['content']);\n\t\t\t\t}\n\t\t\t}*/\n\t\t\tYii::$app->getSession()->setFlash('successStatus', 'Data saved successfully!');\n\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t}\n\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}",
"public function notification(Notification $notification, array $parameters = []);",
"public function create()\n {\n return view('notifications.create');\n }",
"public function __construct($notification)\n {\n parent::__construct($notification);\n }",
"public function notification();",
"public function notification();",
"public function notificationsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $notification = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if ($notification['from'] instanceof Users) {\n $this->di->setShared('userData', $notification['from']);\n }\n\n if (!$notification['to'] instanceof Users) {\n echo 'Attribute TO has to be a User' . PHP_EOL;\n return;\n }\n\n if (!class_exists($notification['notification'])) {\n echo 'Attribute notification has to be a Notificatoin' . PHP_EOL;\n return;\n }\n $notificationClass = $notification['notification'];\n\n if (!$notification['entity'] instanceof Model) {\n echo 'Attribute entity has to be a Model' . PHP_EOL;\n return;\n }\n\n $user = $notification['to'];\n\n //instance notification and pass the entity\n $notification = new $notification['notification']($notification['entity']);\n //disable the queue so we process it now\n $notification->disableQueue();\n\n //run notify for the specifiy user\n $user->notify($notification);\n\n $this->log->info(\n \"Notification ({$notificationClass}) sent to {$user->email} - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::NOTIFICATIONS, $callback);\n }",
"public function create()\n {\n return view('Admin.Notification_Management.notifications');\n }",
"public static function fake()\n {\n static::swap($fake = new NotificationFake);\n\n return $fake;\n }",
"public function new_notification_is_created ($notification) {\n $user = $this->get_session_user();\n $eventdata = new \\core\\message\\message();\n $eventdata->courseid = 1;\n $eventdata->name = 'fake_notification';\n $eventdata->component = 'block_culactivity_stream';\n $eventdata->userfrom = $user;\n $eventdata->subject = $notification;\n $eventdata->fullmessage = $notification;\n $eventdata->fullmessageformat = FORMAT_PLAIN;\n $eventdata->fullmessagehtml = $notification;\n $eventdata->smallmessage = $notification;\n $eventdata->notification = 1;\n $eventdata->userto = $user;\n $messageid = message_send($eventdata);\n\n if (!$messageid) {\n throw new Exception(get_string('messageerror', 'block_culactivity_stream'));\n }\n }",
"public function push($notification, $notifiable);",
"public function __construct() {\r\n $this->setEntity('mst_notification');\r\n }",
"public function create($type, $data, $userId)\n {\n $data = [\n 'type' => $type,\n 'data' => Json::encode($data),\n 'user_id' => $userId,\n 'created_at' => time(),\n 'is_read' => 0\n ];\n\n $notification = $this->createNotificationInstance($data);\n $this->saveNotification($notification);\n return $notification;\n }",
"public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyInteger('InputTriggerID', 0);\n $this->RegisterPropertyString('NotificationLevels', '[]');\n $this->RegisterPropertyBoolean('TriggerOnChangeOnly', false);\n $this->RegisterPropertyBoolean('AdvancedResponse', false);\n $this->RegisterPropertyString('AdvancedResponseActions', '[]');\n\n //Profiles\n if (!IPS_VariableProfileExists('BN.Actions')) {\n IPS_CreateVariableProfile('BN.Actions', 1);\n IPS_SetVariableProfileIcon('BN.Actions', 'Information');\n IPS_SetVariableProfileValues('BN.Actions', 0, 0, 0);\n }\n\n //Variables\n $this->RegisterVariableInteger('NotificationLevel', $this->Translate('Notification Level'), '');\n $this->RegisterVariableBoolean('Active', $this->Translate('Notifications active'), '~Switch');\n $this->RegisterVariableInteger('ResponseAction', $this->Translate('Response Action'), 'BN.Actions');\n\n //Actions\n $this->EnableAction('ResponseAction');\n\n //Timer\n $this->RegisterTimer('IncreaseTimer', 0, 'BN_IncreaseLevel($_IPS[\\'TARGET\\']);');\n\n $this->EnableAction('Active');\n }",
"public function register_notifications();",
"public function create()\n {\n $notification = DB::table('notifications')\n ->get(); \n return view ('admin/assignBadgeToUser')->with('notification', $notification);\n }",
"public function __construct(protected NotificationRepository $notificationRepository)\n {\n }",
"protected function createNotification($responseData)\n {\n $socketMock = $this->getMock(\n 'RequestStream\\\\Stream\\\\Socket\\\\SocketClient',\n array('create', 'write', 'read', 'selectRead', 'setBlocking', 'is', 'close')\n );\n\n $socketMock->expects($this->once())\n ->method('selectRead')\n ->will($this->returnValue(true));\n\n $socketMock->expects($this->once())\n ->method('read')\n ->with(6)\n ->will($this->returnValue($responseData));\n\n $notification = new Notification;\n $payload = new PayloadFactory;\n $connection = new Connection(__FILE__);\n\n $notification->setConnection($connection);\n $notification->setPayloadFactory($payload);\n\n $ref = new \\ReflectionProperty($connection, 'socketConnection');\n $ref->setAccessible(true);\n $ref->setValue($connection, $socketMock);\n\n return $notification;\n }",
"protected function notification() {\n\t\t$reason = $this->indexing_helper->get_reason();\n\n\t\t$presenter = $this->get_presenter( $reason );\n\n\t\treturn new Yoast_Notification(\n\t\t\t$presenter,\n\t\t\t[\n\t\t\t\t'type' => Yoast_Notification::WARNING,\n\t\t\t\t'id' => self::NOTIFICATION_ID,\n\t\t\t\t'capabilities' => 'wpseo_manage_options',\n\t\t\t\t'priority' => 0.8,\n\t\t\t]\n\t\t);\n\t}",
"function custom_node_create_notification($uid, $title, $message) {\n $creator_uid = 1; // Admin user.\n $node = custom_new_node_create($creator_uid, 'notification', $title, 1);\n \n $node->set('field_user', $uid);\n $node->set('body', $message);\n $node->save();\n \n if (!$node->id()) {\n \\Drupal::logger('custom')->error(t('Notification FAILED to store.'));\n }\n \n return $node;\n}",
"public function store(Request $request)\n {\n return Notification::create($request->input());\n }",
"public static function createFromDiscriminatorValue(ParseNode $parseNode): TrainingReminderNotification {\n return new TrainingReminderNotification();\n }",
"public function __construct(NotificationTrigger $notification_trigger)\n {\n $this->notification_trigger = $notification_trigger;\n }",
"public function setResource($notification)\n {\n return new NotificationResource($notification);\n }",
"public function __construct($notification_id)\n {\n $this->notification_id = $notification_id;\n }",
"public function create()\n {\n return view('Notifications/create');\n }",
"public function getNotification(MessageInstanceInterface $message)\n {\n return new DefaultNotification($message, $this->formatterRegistry->get($message->getType()));\n }",
"public function sendPostCreateNewNotifications(ApiTester $I)\n {\n $data = [\n 'entityClass' => 'user',\n 'entityId' => 1,\n 'category' => 'info',\n 'message' => fake::create()->text(20),\n 'userId' => 1\n ];\n $I->saveNotifications([\n $data['entityClass'], ' ',\n $data['entityId'], ' ',\n $data['category'], ' ',\n $data['message'], ' ',\n $data['userId'], ' '\n ], 'notifications.txt');\n $I->sendPOST($this->route, $data);\n $this->userID = $I->grabDataFromResponseByJsonPath('$.id');\n $I->seeResponseCodeIs(201);\n }",
"public static function createFromArray($fields) \n\t{\n\t\t$notificationType = new NotificationType();\n\t\tself::populate($notificationType,$fields);\n\t\treturn $notificationType;\n\t}",
"public function create()\n\t{\n\t\t$searchTerm = Input::get('searchTerm');\n\n $createNotification = new CreateNotificationCommand($searchTerm);\n\n $result = $createNotification->execute();\n\n $result = $result ? \"You're Signed Up!\" : \"You're Already Signed Up for This Term!\";\n\n return $result;\n\t}",
"#[Route('/notification/create', name: 'create_notification')]\n public function create(NotifierInterface $notifier, EntityManagerInterface $entityManager, Request $request): Response\n {\n $notification = (new Notification('Notification from Duck Tales'))\n ->content('You got some contributions to review. Please look at the Quack #' . $request->get('warned_id'))\n ->importance(Notification::IMPORTANCE_HIGH);\n\n\n $admins = [];\n $admins = array_map(fn ($duck) => $duck->hasRoleAdmin() ? $duck->getEmail() : NULL, $entityManager->getRepository(Duck::class)->findAll());\n\n // foreach ($admins as $admin) {\n // $recipient = new Recipient(\n // $admin\n // );\n // $notifier->send($notification, $recipient);\n // }\n $recipient = new Recipient(\n '[email protected]'\n );\n $notifier->send($notification, $recipient);\n\n\n // Send the notification to the recipient\n\n\n return $this->redirectToRoute('quacks');\n }",
"function wd_notification() {\n return WeDevs_Notification::init();\n}",
"public function notificationsOnCreate(NotificationBuilder $builder)\n {\n $notification = new Notification();\n $notification\n ->setTitle('Nouvelle Reclamation')\n ->setDescription(' A été crée')\n ->setRoute('#')\n // ->setParameters(array('id' => $this->userToClaim))\n ;\n //$notification->setIcon($this->getUserr()->getUsername());\n $notification->setUser1($this->getUser()->getUsername());\n $notification->setUser2($this->getUserToClaim());\n $builder->addNotification($notification);\n\n return $builder;\n }",
"public function create()\n {\n\n $email_id = date('Y-m-d_H-i-s') . '.' . $this->template;\n $email_data = [\n 'title' => $this->template, \n 'data' => serialize($this->data), \n 'email' => $this->to,\n 'id' => $email_id,\n 'date' => date('Y-m-d H:i:s')\n ];\n\n Storage::putYAML('statamify/emails/' . $email_id, $email_data);\n\n }",
"public function create()\n {\n //\n $this->message->sendMessage();\n }",
"public function create()\n {}",
"public function create() {}",
"public function create() {\n\t\t\t//\n\t\t}",
"public static function invalidNotificationType()\n {\n return new static('Notification Type provided is invalid.');\n }",
"public function createNotification($type, $text, $destination)\r\n {\r\n \t$data = $this->call(array(\"notification\"=>array(\"type\"=>$type, \"text\"=>$text, \"destination\"=>$destination)), \"POST\", \"notifications.json\");\r\n \treturn $data;\r\n }",
"public function __construct($title, $sender, $notification)\n {\n $this->title = $title;\n $this->sender = $sender;\n $this->notification = $notification;\n }",
"public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }",
"public function create(){}",
"static function get_notificationById($id) {\r\n global $db;\r\n \r\n $id = $db->escape_string($id);\r\n \r\n $query = \"SELECT * FROM `notification` WHERE Notification_id = ?\";\r\n \r\n $statement = $db->prepare($query);\r\n\t\t\r\n\t\tif ($statement == FALSE) {\r\n\t\t\tdisplay_db_error($db->error);\r\n\t\t}\r\n \r\n $statement->bind_param(\"i\", $id);\r\n \r\n $statement->execute();\r\n \r\n $statement->bind_result($id, $message, $objectReference, $objectId, $seen, $timeStamp);\r\n \r\n $statement->fetch();\r\n \r\n $notification = new notification($id, $message, $objectReference, $objectId, $seen, $timeStamp);\r\n \r\n $statement->close();\r\n \r\n return $notification;\r\n }",
"public function __construct(PushNotification $push)\n {\n $this->push = $push;\n }",
"public function addNotification($id, $message, $type = 'status');",
"public function create( $arrayNotifikasi )\n {\n // return $arrayNotifikasi;\n $notif = new Notifikasi;\n $notif->id_pembuat = $arrayNotifikasi[0];\n $notif->id_penerima = $arrayNotifikasi[1];\n $notif->jenis = $arrayNotifikasi[2];\n $notif->msg = $arrayNotifikasi[3];\n $notif->icon = $arrayNotifikasi[4];\n $notif->bg = $arrayNotifikasi[5];\n $notif->tgl_dibuat = $arrayNotifikasi[6];\n $notif->link = $arrayNotifikasi [7];\n $notif->save();\n }",
"public static function createInstance()\n {\n return new MailMessage('[email protected]');\n }",
"public function testPushNotification(){\n $noti=new Notification();\n $data=' {\n\t \"to\": \"/topics/important\",\n\t \"notification\": {\n\t \t\"title\": \"Hola Mundo\",\n\t\t \"body\": \"Mensaje de prueba\",\n\t\t \"icon\":\"http://www.alabamapublica.com/wp-content/uploads/sites/43/2017/06/cntx170619019-150x150.jpg\"\n\t\t \"click_action\": \"https://critica-xarkamx.c9users.io\"\n\t }\n }';\n $this->assertArrayHasKey(\"message_id\",$noti->sendPushNotification($data));\n }",
"public static function notify($member) {\n $notification = Model_Notification::factory('notification');\n\n if(is_numeric($member)) {\n $notification->to = $member;\n } else if(is_object($member) && $member instanceof Model_Member) {\n $notification->to = $member->id;\n } else if(is_object($member) && $member instanceof Model_Blab) {\n\t\t\t$notification->to = $member->getCommentees();\n\t\t}\n\n\t\t$notification->from = Session::instance()->get('user_id');\n \n $notification->unread = 1;\n\n\t\t$notification->created = date('Y-m-d h:i:s');\n\n return $notification;\n }",
"public function insert(int $toUserID, string $subject, string $message, int $typeId, array $data = [])\n {\n return Notification::create([\n 'user_id' => $toUserID,\n 'subject' => $subject,\n 'message' => $message,\n 'notification_type_id' => $typeId,\n 'data' => $data,\n ]);\n }",
"public function create()\n {\n //TODO\n }",
"public function __construct($notifiable)\n {\n $this->notifiable = $notifiable;\n }",
"public function create()\n {\n //\n return view('admin/notifacation/create');\n }",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function __construct(AppNotification $notification, User $user)\n {\n $this->notification = $notification;\n $this->user = $user;\n }",
"public function create() {\r\n }",
"public function __construct($data)\n {\n \n\n $usuario_reserva = User::find($data->id_user);\n $coordinador = User::find($usuario_reserva->departamento->coordinador->id);\n\n $mensaje = new \\stdClass();\n $mensaje->user = $usuario_reserva->name.' '.$usuario_reserva->last_name;\n $mensaje->userid = $usuario_reserva->id;\n $mensaje->recipient = $coordinador->name.' '.$coordinador->last_name;\n $mensaje->recipientid = $coordinador->id;\n $mensaje->reservaid = $data->id;\n $mensaje->datereserva = date('Y-m-d H:i:s');\n $mensaje->text = 'ah generado una reserva';\n $notificacion = new Notificaciontest($mensaje);\n \n $coordinador->notify($notificacion);\n $this->notif = $mensaje;\n }",
"public function createDefaultNotificationRule();",
"protected function getNotification_Type_PostService()\n {\n $instance = new \\phpbb\\notification\\type\\post(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }",
"public function create()\n {\n }",
"public function create()\n {\n }",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}"
] | [
"0.8276063",
"0.72309536",
"0.7192113",
"0.71250874",
"0.7123231",
"0.70414555",
"0.6982398",
"0.6982398",
"0.6982398",
"0.69165224",
"0.6844303",
"0.68205667",
"0.6801263",
"0.6776018",
"0.6589725",
"0.6531073",
"0.6507233",
"0.65047646",
"0.6503655",
"0.64437956",
"0.6413495",
"0.63943607",
"0.63801765",
"0.63801765",
"0.63660526",
"0.6356052",
"0.63232195",
"0.6300968",
"0.6284887",
"0.6273382",
"0.6273382",
"0.6221624",
"0.62077844",
"0.619149",
"0.61460197",
"0.6113097",
"0.6109519",
"0.61056155",
"0.6096373",
"0.6080448",
"0.6076801",
"0.6062714",
"0.6056816",
"0.60528165",
"0.6042198",
"0.6041384",
"0.6038984",
"0.5998163",
"0.5980277",
"0.5966818",
"0.5965131",
"0.59510165",
"0.5944954",
"0.5924184",
"0.59172565",
"0.5905665",
"0.5863749",
"0.5857545",
"0.5847215",
"0.58452827",
"0.5823396",
"0.5817765",
"0.5809837",
"0.5806915",
"0.58051187",
"0.57956886",
"0.5786479",
"0.5761696",
"0.5759299",
"0.57588416",
"0.57455844",
"0.5729732",
"0.57241285",
"0.5722245",
"0.571779",
"0.57008874",
"0.56909657",
"0.5688866",
"0.56850773",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.5680636",
"0.56795263",
"0.567875",
"0.5671056",
"0.56691873",
"0.56688094",
"0.5668",
"0.5668",
"0.5666241",
"0.5666241",
"0.5666241"
] | 0.0 | -1 |
Get the notification's delivery channels. | public function via($notifiable)
{
return [TwilioChannel::class];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNotificationChannels()\n {\n if (array_key_exists(\"notificationChannels\", $this->_propDict)) {\n return $this->_propDict[\"notificationChannels\"];\n } else {\n return null;\n }\n }",
"public function getDistributionChannels();",
"public function getDeliveryChannel() {\n return $this->params[\"original\"][\"delivery_channel\"];\n }",
"public function getChannels()\n {\n return $this->channels;\n }",
"public function getChannels();",
"public function getDistributionChannels()\n {\n return $this->distributionChannels;\n }",
"public function getChannels()\n {\n return $this->Channels;\n }",
"public function getAllChannels()\n {\n return $this->_channel;\n }",
"public function via($notifiable)\n {\n $channels = [];\n if ($notifiable->setting->is_bid_cancelled_notification_enabled) {\n $channels = ['database']; // note: no Messenger yet like the other one's. App is still not approved, and there's the business registration requirement so..\n \n if ($notifiable->fcm_token) {\n $channels[] = FcmChannel::class;\n }\n }\n return $channels;\n }",
"public function viaNotificationChannels()\n {\n return UserNotificationChannel::with('notification_channel')->get()->filter(function ($item) {\n return $item->muted_at == null;\n })->pluck('notification_channel.name');\n }",
"public function channels()\n {\n return $this->send('channels');\n }",
"public function getOrderChannels()\n\t{\n\t\t$request = $this->request('order_channels');\n\n\t\tif (!$request) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$decoded = $request->asArray();\n\t\treturn $decoded['data'];\n\t}",
"public function channels()\n {\n $payloads = [\n 'code' => $this->channelCode,\n ];\n\n return $this->request('get', 'merchant/payment-channel', $payloads);\n }",
"public function all(): array\n {\n return $this->channels;\n }",
"public function getActiveNotificationChannelsOptions()\n {\n \treturn $this->getChannelOptions();\n }",
"public function getAllChannels()\n {\n return Channel::all();\n }",
"public function getSupplyChannels();",
"public function getChannels()\n\t{\n\t\t$channels = App::make('ChannelRepository')->getChannels();\n\t\t\n\t\treturn App::make('Apiv1\\Transformers\\ChannelTransformer')->transformCollection($channels, $this->user);\n\t}",
"public function via($notifiable)\n {\n $channel = ($this->channel == 'sms') ? 'nexmo' : $this->channel;\n return [$channel];\n }",
"public function get_channels()\n {\n }",
"public function getDeliveryChannel($i = 0)\n {\n if (isset($this->destinationList[$i]['DeliveryChannel'])) {\n return $this->destinationList[$i]['DeliveryChannel'];\n } else {\n return false;\n }\n }",
"public function getDeliveries()\n {\n return $this->deliveries;\n }",
"public function channels(){\n return $this->channelCollection->map(function ($item, $key) {\n return ['channel' => $item['channel']];\n });\n }",
"public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }",
"public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }",
"public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }",
"public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }",
"public function via($notifiable)\n\t{\n\t\tif (!isset($this->notifitable)) {\n\t\t\t$this->notifitable = $notifiable;\n\t\t}\n\t\t$channels = ['db'];\n\t\tif (in_array('esms', $this->data['types'])) {\n\t\t\t$channels[] = 'esms';\n\t\t}\n\t\tif (in_array('email', $this->data['types'])) {\n\t\t\t$channels[] = 'mail';\n\t\t}\n\n\t\treturn $channels;\n\t}",
"public function getChannel()\n {\n return $this->getData(self::CHANNEL);\n }",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function via($notifiable)\n {\n return [FcmChannel::class];\n }",
"public function broadcastOn() {\n return [\n new Channel('messages.' . $this->userReceiver->id . '.' . $this->currentUser->email),\n new Channel('messages.' . $this->currentUser->id . '.' . $this->userReceiver->email),\n ];\n }",
"public function broadcastOn()\n {\n return [config('messenger.redis_channel', 'notification')];\n }",
"public function via($notifiable): array\n {\n return [DiscordChannel::class];\n }",
"public function via($notifiable)\n {\n return [WhatsappChannel::class, SmsChannel::class];\n }",
"public function getSupplyChannels()\n {\n return $this->supplyChannels;\n }",
"public function getChannel();",
"public function getAllChannels()\n {\n return Channel::with('subChannel.display')->active()->alive()->get()->toArray();\n }",
"public function setNotificationChannels($val)\n {\n $this->_propDict[\"notificationChannels\"] = $val;\n return $this;\n }",
"public function getIncludeChannels()\n {\n return $this->include_channels;\n }",
"public function getDelivery()\n {\n return $this->delivery;\n }",
"public static function getChannels($aspect)\n {\n return self::getMetaProperty($aspect, 'channel');\n }",
"public function broadcastOn()\n {\n return new Channel('notifications');\n }",
"public function getAll(){\n\t\t$Channels = \\Channel::all();\n\t\treturn $Channels;\n\t}",
"public function via( $notifiable )\n\t{\n\t\treturn [ OneSignalChannel::class ];\n\t}",
"public function via($notifiable)\n {\n return [PushNotificationChannel::class];\n }",
"public function channels(): ChannelsService;",
"public function getNotificationTypes()\n {\n return $this->notifications;\n }",
"public function getChannelList()\n {\n return Channel::with('subChannel.display')->get();\n }",
"public function list_channels($exclude_archived=true) {\n\n $method=\"channels.list\";\n $payload['exclude_archived'] = $exclude_archived;\n\n $result = $this->apicall($method, $payload);\n if (isset($result['channels'])) {\n return $result['channels'];\n } else {\n return false;\n }\n }",
"public function getChannel()\n {\n \treturn $this->_channel;\n }",
"public function getChannel()\n {\n return $this->channel;\n }",
"public function getChannel()\n {\n return $this->channel;\n }",
"function channelInfo()\n\t{\n\t\treturn $this->_channel;\n\t}",
"public function broadcastOn()\n {\n return ['my-channel'];\n }",
"public function via($notifiable)\n {\n return [SendGridChannel::class];\n }",
"public function getChannel()\n {\n return $this->Channel;\n }",
"public function getChannel()\n {\n return $this->Channel;\n }",
"public function getChannel()\n {\n if (! $this->channel) {\n $this->set();\n }\n\n return $this->channel;\n }",
"public function broadcastOn()\n {\n return ['channel-status'];\n }",
"public function broadcastOn()\n {\n return [\n new Channel('sanityDeployment.' . $this->sanityDeployment->id),\n new Channel('sanityMainRepo.' . $this->sanityDeployment->sanityMainRepo->id),\n ];\n }",
"public function via($notifiable)\n {\n return [DiscordChannel::class];\n }",
"public static function getChannels() {\n\t\t$channels = [];\n\t\ttry {\n\t\t\t$mapper = new ObjectMapper();\n\t\t\t$response = self::getResponse();\n\t\t\t$data = json_decode( $response, true );\n\t\t\tif ( count( $data['Channels'] ) > 0 ) {\n\t\t\t\tforeach ( $data['Channels'] as $dataProject ) {\n $channels[] = $mapper->mapJson( json_encode( $dataProject ), Channel::class );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\treturn $channels;\n\t}",
"public function getListDeliveryStatus()\n {\n return $this->client->makeRequest('deliverystatus', 'GET');\n }",
"public function onChannels(): ?array\n {\n return null;\n }",
"public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}",
"public function via($notifiable): array\n {\n return [TelegramChannel::class];\n }",
"public function getChannel() {\n return $this->channel;\n }",
"public function getChannels()\n {\n return Channel::with('subChannel.category', 'subChannel.display')->whereNull('parent_channel')->active()->get()->toArray();\n }",
"public function getDestinationChannel();",
"public function getJoinDefaultChannels()\n {\n return $this->joinDefaultChannels;\n }",
"function hpm_channels( $mutations ) {\n $mutation = $mutations[0];\n $object = $mutation->action == 'create' ?\n $mutation->property_value :\n hpm_object( $mutation->object_type, $mutation->object_id );\n $channels = [];\n switch ($mutation->object_type) {\n case 'message':\n case 'resource':\n if ( $object->project_id === NULL ) {\n $channels = ['members'];\n } else {\n $channels[] = 'private-managers';\n $project = hpm_object( 'project', $object->project_id );\n if ( $project->contractor_id !== NULL ) {\n $channels[] = 'private-contractor-' . $project->contractor_id;\n }\n }\n break;\n case 'package':\n $channels = ['private-managers'];\n break;\n case 'person':\n case 'project':\n $channels = ['members'];\n break;\n case 'time':\n $channels = ['private-managers'];\n $worker = hpm_object( 'person', $object->worker_id );\n if ( $worker->role == 'contractor' ) {\n $channels[] = 'private-contractor-' . $object->worker_id;\n }\n break;\n default: break;\n }\n return $channels;\n}",
"public function getDistributionChannel()\n {\n return $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel;\n }",
"private function getChannels()\r\n {\r\n static $channels;\r\n\r\n if (empty($channels)) {\r\n // Store the cache forever.\r\n $cache_key = 'categoryFirst';\r\n $channels = \\SCache::sear($cache_key, function () {\r\n $categories = $this->all();\r\n $channels = [];\r\n foreach ($categories as $category) {\r\n if ($category['bclassid'] == 0) {\r\n $channels[] = $category;\r\n }\r\n }\r\n return $channels;\r\n });\r\n }\r\n\r\n return $channels;\r\n }",
"public function via($notifiable)\n {\n return [NetgsmChannel::class];\n }",
"public function getChannels()\n {\n $size = $this->getImageSize();\n\n return $size['channels'];\n }",
"public function get($name, $optParams = [])\n {\n $params = ['name' => $name];\n $params = array_merge($params, $optParams);\n return $this->call('get', [$params], NotificationChannel::class);\n }",
"public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }",
"public function via($notifiable)\n {\n return [WebPushChannel::class];\n }",
"public function via($notifiable)\n {\n return [WebPushChannel::class];\n }",
"public function getActiveChannels(string $format = 'xml'): array\n {\n $response = $this->prepareHttpClient('/mailer/channel/list', ['format' => $format])\n ->send();\n\n if ($format === 'csv') {\n return $this->parseResponse($response);\n }\n\n $xml = new SimpleXMLElement($this->parseResponse($response));\n\n $channels = [];\n foreach ($xml->children() as $channel) {\n $channels[] = [\n 'date' => new DateTime((string) $channel->attributes()->date),\n 'name' => (string) $channel->attributes()->name,\n 'info' => (string) $channel->attributes()->info,\n ];\n }\n\n return $channels;\n }",
"public function via($notifiable)\n {\n $array = ['database', 'fcm'];\n\n if (setting('twilio_disabled') != true &&\n !blank(setting('twilio_from')) &&\n !blank(setting('twilio_account_sid')) &&\n !blank(setting('twilio_account_sid'))\n ) {\n array_push($array, TwilioChannel::class);\n }\n\n if (setting('mail_disabled') != true &&\n !blank(setting('mail_host')) &&\n !blank(setting('mail_username')) &&\n !blank(setting('mail_password')) &&\n !blank(setting('mail_port')) &&\n !blank(setting('mail_from_name')) &&\n !blank(setting('mail_from_address'))\n ) {\n array_push($array, 'mail');\n }\n\n return $array;\n }",
"public function getChannel(): Channel\n {\n return $this->channel;\n }",
"public function via($notifiable) {\n return [OneSignalChannel::class];\n }",
"public function getChannelNames()\n {\n $array = [];\n\n foreach ($this->channels as $channel) {\n $array[$channel->name] = $channel->name;\n }\n\n return $array;\n }",
"public function getNotifications()\n {\n return $this->_notifications;\n }",
"public function getChannels(){\n\t\t//TODO: Change query\n\t\t$query = sprintf(\"SELECT idChannel FROM Channels limit 1\");\n\n\t\t$this->dbObj->Query($query);\n\n\t\tif ($this->dbObj->numErr) {\n\t\t\t$this->parent->SetError(5);\n\t\t}\n\n\t\t$out = NULL;\n\t\twhile (!$this->dbObj->EOF) {\n\t \t\t$out[] = $this->dbObj->GetValue(\"idChannel\");\n\t\t\t$this->dbObj->Next();\n\t\t}\n\n\t \treturn $out;\n\t}",
"public function via($notifiable)\n {\n $via = [];\n\n foreach ($this->sendibleTraits() as $trait) {\n $viaNameFromTrait = $this->getViaNameFromTrait($trait);\n\n if ($this->shouldBeSentVia($viaNameFromTrait, $notifiable)) {\n $via[] = $this->{$viaNameFromTrait . 'Channel'}();\n }\n }\n\n return $via;\n }",
"public function via($notifiable)\n {\n return [CustomDbChannel::class, 'mail'];\n }",
"public function via($notifiable)\n {\n return [FacebookChannel::class];\n }",
"public function getChannels()\n {\n $channels = $this->channels->getAll();\n $channelList = [];\n\n // Cycle through all of the channels and setup data for them\n foreach ($channels as $channel) {\n $message = $this->chat->getLatestByChannel($channel->id);\n\n $channelList[] = [\n 'name' => $channel->name_trim,\n 'messages' => $channel->messages,\n 'last_message' => strtotime($message['created_at']),\n ];\n }\n\n return json_encode(array_reverse($channelList));\n }",
"public function getChannel()\n {\n return $this->_access->getChannel();\n }",
"public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}",
"public function getChannel($storeId = null);",
"public function channels()\n {\n return $this->belongsToMany('App\\Channel');\n }",
"public function broadcastOn()\n {\n return ['whatcanido-channel'];\n }",
"public function getNotificationgroups()\n {\n return isset($this->notificationgroups) ? $this->notificationgroups : null;\n }",
"public function via($notifiable)\n {\n $now = Carbon::now();\n $createdAt = Carbon::parse($notifiable->created_at);\n $dayFive = $createdAt->copy()->addDays(5)->startOfDay();\n $daySix = $createdAt->copy()->addDays(6)->endOfDay();\n if ($now->between($dayFive, $daySix)) {\n $this->isDayFive = $now->between($dayFive, $dayFive->copy()->endOfDay()) ? true : false;\n return [LineBotNotificationChannel::class];\n }\n\n return [];\n }",
"public function broadcastOn()\n {\n return new Channel('doctor-notification');\n }",
"public function via($notifiable)\n {\n return [OneSignalChannel::class];\n }"
] | [
"0.78077316",
"0.7333707",
"0.7127785",
"0.7089724",
"0.7087921",
"0.70300424",
"0.69931364",
"0.6973003",
"0.6951073",
"0.6927183",
"0.68472975",
"0.67785895",
"0.6697527",
"0.6530563",
"0.65100604",
"0.6496754",
"0.6474866",
"0.6446399",
"0.643471",
"0.6423392",
"0.64229727",
"0.63781494",
"0.63726985",
"0.6277284",
"0.6276724",
"0.6276724",
"0.6276724",
"0.6234952",
"0.6203739",
"0.6179071",
"0.6179071",
"0.61232203",
"0.61158967",
"0.61088634",
"0.6020671",
"0.5995534",
"0.5985168",
"0.59301424",
"0.5916712",
"0.5912588",
"0.5911691",
"0.5896299",
"0.5893216",
"0.5889689",
"0.5887195",
"0.5878091",
"0.586549",
"0.58512723",
"0.5812232",
"0.5805207",
"0.5800807",
"0.57906127",
"0.5786768",
"0.5786768",
"0.57807684",
"0.5779888",
"0.57715005",
"0.57678837",
"0.57678837",
"0.5766476",
"0.5754385",
"0.57491064",
"0.5742647",
"0.5735341",
"0.5732727",
"0.57325697",
"0.5728877",
"0.57221526",
"0.57207775",
"0.57169145",
"0.5712525",
"0.5694798",
"0.5688528",
"0.5683845",
"0.5683054",
"0.5682042",
"0.567513",
"0.5663718",
"0.5659599",
"0.5652422",
"0.5652422",
"0.5630605",
"0.5630334",
"0.56298393",
"0.5625376",
"0.5625225",
"0.56192815",
"0.56115615",
"0.5607237",
"0.5602894",
"0.5584222",
"0.55823225",
"0.55728054",
"0.5566249",
"0.5554496",
"0.555214",
"0.5549145",
"0.55454457",
"0.5544404",
"0.55443466",
"0.5544159"
] | 0.0 | -1 |
Returns LocalizedException[] array to be compatible with current Implementation in Web API which relies on this behavior | public function getErrors(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExceptions();",
"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 }",
"public function getErrors(): array\n {\n return Logger::getErrorMessages();\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 getError(): array\n {\n return $this->errorMessages;\n }",
"public function getErrorMessages() {}",
"public function getExceptionDataProvider()\n {\n $data = [];\n\n for ($i = 0; $i < 1000; $i += 100) {\n $data[] = [\n 'message-' . $i,\n $i,\n ];\n }\n\n return $data;\n }",
"private function err_to_array() {\n return array(\n 'code' => $this->code,\n 'reason' => $this->http_status_code_string($this->code),\n 'message' => $this->message,\n );\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"public function provider_load_exception() {\n return array(\n array(\n 'text',// Field.\n array(// Post.\n \n ),\n ),\n array(\n 'text',// Field.\n array(// Post.\n 'text1',\n 'text2',\n NULL,\n FALSE,\n ),\n ),\n );\n }",
"public function getViolations(): array\n {\n $messages = [];\n foreach ($this->violations as $violation) {\n $param = preg_replace('/[^0-9a-zA-Z_\\-\\s]/', '', $violation->getPropertyPath());\n $messages[] = [$param => $violation->getMessage()];\n }\n\n return $messages;\n }",
"public function getAllMessage()\n {\n $messages = [];\n foreach (array_keys($this->errors) as $key) {\n $messages[$key] = $this->getMessage($key);\n }\n return $messages;\n }",
"protected function getErrors()\n {\n return [\n 0 => 'پرداخت تکمیل و با موفقیت انجام شده است',\n -1 => 'منتظر ارسال تراکنش و ادامه پرداخت',\n -2 => 'پرداخت رد شده توسط کاربر یا بانک',\n -3 => 'پرداخت در حال انتظار جواب بانک',\n -4 => 'پرداخت لغو شده است',\n -20 => 'کد api_key ارسال نشده است',\n -21 => 'کد trans_id ارسال نشده است',\n -22 => 'مبلغ ارسال نشده',\n -23 => 'لینک ارسال نشده',\n -24 => 'مبلغ صحیح نیست',\n -25 => 'تراکنش قبلا انجام و قابل ارسال نیست',\n -26 => 'مقدار توکن ارسال نشده است',\n -27 => 'شماره سفارش صحیح نیست',\n -28 => 'مقدار فیلد سفارشی [custom_json_fields] از نوع json نیست',\n -29 => 'کد بازگشت مبلغ صحیح نیست',\n -30 => 'مبلغ کمتر از حداقل پرداختی است',\n -31 => 'صندوق کاربری موجود نیست',\n -32 => 'مسیر بازگشت صحیح نیست',\n -33 => 'کلید مجوز دهی صحیح نیست',\n -34 => 'کد تراکنش صحیح نیست',\n -35 => 'ساختار کلید مجوز دهی صحیح نیست',\n -36 => 'شماره سفارش ارسال نشد است',\n -37 => 'شماره تراکنش یافت نشد',\n -38 => 'توکن ارسالی موجود نیست',\n -39 => 'کلید مجوز دهی موجود نیست',\n -40 => 'کلید مجوزدهی مسدود شده است',\n -41 => 'خطا در دریافت پارامتر، شماره شناسایی صحت اعتبار که از بانک ارسال شده موجود نیست',\n -42 => 'سیستم پرداخت دچار مشکل شده است',\n -43 => 'درگاه پرداختی برای انجام درخواست یافت نشد',\n -44 => 'پاسخ دریاف شده از بانک نامعتبر است',\n -45 => 'سیستم پرداخت غیر فعال است',\n -46 => 'درخواست نامعتبر',\n -47 => 'کلید مجوز دهی یافت نشد [حذف شده]',\n -48 => 'نرخ کمیسیون تعیین نشده است',\n -49 => 'تراکنش مورد نظر تکراریست',\n -50 => 'حساب کاربری برای صندوق مالی یافت نشد',\n -51 => 'شناسه کاربری یافت نشد',\n -52 => 'حساب کاربری تایید نشده است',\n -60 => 'ایمیل صحیح نیست',\n -61 => 'کد ملی صحیح نیست',\n -62 => 'کد پستی صحیح نیست',\n -63 => 'آدرس پستی صحیح نیست و یا بیش از ۱۵۰ کارکتر است',\n -64 => 'توضیحات صحیح نیست و یا بیش از ۱۵۰ کارکتر است',\n -65 => 'نام و نام خانوادگی صحیح نیست و یا بیش از ۳۵ کاکتر است',\n -66 => 'تلفن صحیح نیست',\n -67 => 'نام کاربری صحیح نیست یا بیش از ۳۰ کارکتر است',\n -68 => 'نام محصول صحیح نیست و یا بیش از ۳۰ کارکتر است',\n -69 => 'آدرس ارسالی برای بازگشت موفق صحیح نیست و یا بیش از ۱۰۰ کارکتر است',\n -70 => 'آدرس ارسالی برای بازگشت ناموفق صحیح نیست و یا بیش از ۱۰۰ کارکتر است',\n -71 => 'موبایل صحیح نیست',\n -72 => 'بانک پاسخگو نبوده است لطفا با نکست پی تماس بگیرید',\n -73 => 'مسیر بازگشت دارای خطا میباشد یا بسیار طولانیست',\n -90 => 'بازگشت مبلغ بدرستی انجام شد',\n -91 => 'عملیات ناموفق در بازگشت مبلغ',\n -92 => 'در عملیات بازگشت مبلغ خطا رخ داده است',\n -93 => 'موجودی صندوق کاربری برای بازگشت مبلغ کافی نیست',\n -94 => 'کلید بازگشت مبلغ یافت نشد',\n\n -1000 => 'خطای تعریف نشده',\n ];\n }",
"public function getServerErrors()\r\n {\r\n $srvErrors = array();\r\n $errMessages = $this->getMessages();\r\n \r\n foreach ($errMessages as $name => $err) {\r\n if (is_array($err)) {\r\n foreach ($err as $errName => $errMessage) {\r\n $label = $this->getElement($name)->getLabel();\r\n $srvErrors[$label] = $errMessage;\r\n }\r\n }\r\n else {\r\n if (preg_match('/:/', $err) > 0) {\r\n $err = explode(':', $err);\r\n $srvErrors[$err[0]] = $err[1];\r\n } else {\r\n if (preg_match('/Date/', $err) > 0) {\r\n $srvErrors['Start/End Date'] = $err;\r\n }\r\n else {\r\n $srvErrors['Other'] = $err;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return $srvErrors;\r\n }",
"public function error()\n\t{\n\t\treturn [];\n\t}",
"public function providerRefreshException(): array\n {\n return static::getKeyedArray([\n [\n '4.root.json',\n ['signed', 'newkey'],\n 'new value',\n new SignatureThresholdExpception('Signature threshold not met on root'),\n [\n 'root' => 3,\n 'timestamp' => 3,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n [\n '5.root.json',\n ['signed', 'newkey'],\n 'new value',\n new SignatureThresholdExpception('Signature threshold not met on root'),\n [\n 'root' => 4,\n 'timestamp' => 3,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n [\n 'timestamp.json',\n ['signed', 'newkey'],\n 'new value',\n new SignatureThresholdExpception('Signature threshold not met on timestamp'),\n [\n 'root' => 5,\n 'timestamp' => null,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n [\n '5.snapshot.json',\n ['signed', 'newkey'],\n 'new value',\n new MetadataException(\"The 'snapshot' contents does not match hash 'sha256' specified in the 'timestamp' metadata.\"),\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => null,\n 'targets' => 3,\n ],\n ],\n [\n '5.snapshot.json',\n ['signed', 'version'],\n 6,\n new MetadataException(\"Expected snapshot version 5 does not match actual version 6.\"),\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => null,\n 'targets' => 3,\n ],\n ],\n [\n '5.targets.json',\n ['signed', 'version'],\n 6,\n new MetadataException(\"Expected targets version 5 does not match actual version 6.\"),\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => 5,\n 'targets' => 3,\n ],\n ],\n ]);\n }",
"public function provideSdkExceptions()\n {\n $invalidPayload = '\\eBayEnterprise\\RetailOrderManagement\\Payload\\Exception\\InvalidPayload';\n $networkError = '\\eBayEnterprise\\RetailOrderManagement\\Api\\Exception\\NetworkError';\n $unsupportedOperation = '\\eBayEnterprise\\RetailOrderManagement\\Api\\Exception\\UnsupportedOperation';\n $unsupportedHttpAction = '\\eBayEnterprise\\RetailOrderManagement\\Api\\Exception\\UnsupportedHttpAction';\n $baseException = 'Exception';\n $creditCardException = 'Radial_CreditCard_Exception';\n return [\n [$invalidPayload, $creditCardException],\n [$networkError, $creditCardException],\n [$unsupportedOperation, $unsupportedOperation],\n [$unsupportedHttpAction, $unsupportedHttpAction],\n [$baseException, $baseException],\n ];\n }",
"protected function renderException(\\Throwable $e): array\n {\n return [\n 'exception' => exceptionToArray($e),\n 'errorMessage' => $e->getMessage(),\n 'errorType' => get_class($e),\n ];\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 translationMessages()\n {\n return [];\n }",
"public static function error()\n {\n return [\n 'code' => JsonResponse::HTTP_INTERNAL_SERVER_ERROR,\n 'status' => 'error',\n 'message' => 'Oops, something went wrong.'\n ];\n }",
"public function testErrorMessageArray()\n {\n $errorResponse = json_decode('{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": [\"Bad format\", \"Bad format 2\"],\n \"errors\": []\n }\n }', true);\n\n try {\n Requestor::handleApiError(null, 404, $errorResponse);\n } catch (EasyPostException $error) {\n $this->assertEquals('Bad format, Bad format 2', $error->getMessage());\n }\n }",
"protected function validationMessages(): array\n {\n return [];\n }",
"public function getErrors(): array;",
"public function getErrors(): array;",
"public function getErrors(): array;",
"public function all(): array\n {\n $messages = [];\n foreach ($this->stack as $error) {\n $messages[] = $error->getMessage();\n }\n\n return $messages;\n }",
"public function getErrorResponse()\n {\n $errorResponse = array();\n\n foreach ($this->getErrors() as $error) {\n $errorResponse[] = $error->getPropertyPath().' '.$error->getMessage().\"\\n\";\n }\n\n return $errorResponse;\n }",
"public function getErrors(): array\n {\n $error = [];\n\n foreach ($this->list as $r) {\n $error[$r->getPropertyPath()] = $r->getMessage();\n }\n\n return $error;\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 }",
"protected function getBackTrace(){\n\t\treturn array('Inicio', 'Facturación');\n\t}",
"public function getErrors(): array\n {\n $errors = [];\n\n /** @var string $name @var HashSet $messages */\n foreach ($this->errors as $name => $messages) {\n $errors[$name] = [];\n foreach ($messages as $message) {\n $errors[$name][] = $message;\n }\n }\n\n return $errors;\n }",
"protected function importValidationMessages()\n {\n return [];\n }",
"public function getErrors() : array;",
"#[ArrayShape(['request' => \"array\", 'debugBackTrace' => \"array|mixed\"])]\n private static function getExtraStaticExceptionSupplement() : array\n {\n return [\n 'request' => [\n request()->method() => static::getRequest(),\n 'queryParams' => request()->query->all()\n ],\n 'debugBackTrace' => AppContainer::has(Constants::debugBackTrace)\n ? AppContainer::get(Constants::debugBackTrace)\n : debug_backtrace()\n ];\n }",
"public function getErrorMessages() : array\n {\n return $this->errors_messages;\n }",
"public function getError() {\n\t\t$error = array();\n\t\t$error['message'] = $this->err_message;\n\t\t$error['code'] = $this->err_code;\n\t\treturn $error;\n\t}",
"function getErrors()\n {\n ksort($this->errors);\n $e = array();\n foreach ($this->errors as $v) foreach ($v as $e[]) {}\n return $e;\n }",
"public function translatableMessages()\n {\n return [];\n }",
"public function get_error_messages();",
"public function getExceptionMessages()\n {\n return $this->exceptionMessages;\n }",
"public function getErrorList() {\n\t\treturn array();\n\n\t}",
"public function messages()\n {\n $serviceId = trans('company.lbl_service_name');\n $startDate = trans('company.lbl_contract_start_date');\n $endDate = trans('company.lbl_contract_end_date');\n\n return [\n 'service-id.required' => trans('error.e003_required', ['field' => $serviceId]),\n 'service-id.numeric' => trans('error.e008_numeric', ['field' => $serviceId]),\n 'start-date.required' => trans('error.e003_required', ['field' => $startDate]),\n 'start-date.date_format' => trans('error.e005_format_date', ['field' => $startDate, 'format' => 'Y/m/d']),\n 'start-date.after_or_equal' => trans('error.e020_greater_than_or_equal', ['field' => $startDate]),\n 'end-date.required' => trans('error.e003_required', ['field' => $endDate]),\n 'end-date.date_format' => trans('error.e005_format_date', ['field' => $endDate, 'format' => 'Y/m/d']),\n 'end-date.after' => trans('error.e012_start_date_less_than_end_date'),\n ];\n }",
"private function errorMessages()\n {\n return [\n 'name.unique' => 'A category with the same name exists',\n ];\n }",
"public function getLastError(): array\n {\n return $this->LastError;\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;",
"private function _getErrorsMessages() : array\n\t{\n\t\t$messages = [\n\t __\\UploadedFilesHandler::ERROR_MOVE_UPLOADED_FILE => 'Przenoszenie pliku z folderu tymczasowego nie powiodło się.',\n\t __\\UploadedFilesHandler::ERROR_FILE_STILL_EXISTS => 'Plik o tej samej nazwie już istnieje pomimo próby zmiany nazwy.',\n\t __\\UploadedFilesHandler::ERROR_FILE_TOO_BIG => 'Przesłany plik jest zbyt duży.',\n\n\t \\UPLOAD_ERR_INI_SIZE => 'Przesłany plik jest zbyt duży (rozmiar określa konfiguracja PHP).',\n\t \\UPLOAD_ERR_FORM_SIZE => 'Przesłany plik jest zbyt duży.',\n\t \\UPLOAD_ERR_PARTIAL => 'Plik został przesłany tylko częściowo.',\n\t \\UPLOAD_ERR_NO_FILE => 'Nie przesłano żadnego pliku.',\n\t \\UPLOAD_ERR_NO_TMP_DIR => 'Nie określono folderu tymczasowego do przesyłania plików.',\n\t \\UPLOAD_ERR_CANT_WRITE => 'Zapis przesyłanego pliku do folderu tymczasowego jest niemożliwy.',\n\t \\UPLOAD_ERR_EXTENSION => 'Przesyłanie pliku nie powiodło się z powodu rozszerzenia PHP.',\n\n\t 'unknown' => 'Wystąpił błąd PHP podczas przesyłania pliku.',\n\t\t];\n\n\t\t$errors = $this->_handler->getErrors();\n\n\t\tforeach ($errors as $fileName => $errorCode) {\n\t\t\t$errors[$fileName] = $messages[$errorCode] ?? $messages['unknown'];\n\t\t}\n\n\t\treturn $errors;\n\t}",
"public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }",
"public function getValidationErrorMessages() {}",
"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 getParameterExceptions(): array\n {\n return $this->parameterExceptions;\n }",
"protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED,\n 'password.required' => HttpAttributeInvalidCode::PASSWORD_REQUIRED,\n 'password.same' => HttpAttributeInvalidCode::CONFIRM_PASSWORD_NOT_SAME,\n 'display_name.required' => HttpAttributeInvalidCode::DISPLAY_NAME_REQUIRED,\n 'role_id.required' => HttpAttributeInvalidCode::ROLE_REQUIRED,\n 'status.required' => HttpAttributeInvalidCode::STATUS_REQUIRE\n ];\n }",
"public function getFutureExceptions()\n {\n $futureExceptions = array();\n $currentDate = new \\DateTime('today');\n /** @var \\JWeiland\\Events2\\Domain\\Model\\Exception $exception */\n foreach ($this->exceptions as $exception) {\n if ($exception->getExceptionDate() > $currentDate) {\n $futureExceptions[$exception->getExceptionDate()->format('U')] = $exception;\n }\n }\n if (count($futureExceptions) === 1 && current($futureExceptions)->getExceptionDate() == $this->day->getDay()) {\n $futureExceptions = array();\n } else {\n ksort($futureExceptions, SORT_NUMERIC);\n }\n\n return $futureExceptions;\n }",
"public function getErrorLines()\n {\n return array('Something went wrong... ಠ_ಠ');\n }",
"public function providerAttackRepoException(): array\n {\n return [\n [\n 'TUFTestFixtureAttackRollback',\n new RollbackAttackException('Remote timestamp metadata version \"$2\" is less than previously seen timestamp version \"$3\"'),\n [\n 'root' => 3,\n 'timestamp' => 3,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n ];\n }",
"public function provideInvalidConfig()\n {\n return array(\n array('\\GSOcr\\Exception\\RuntimeException', array()),\n array('\\GSOcr\\Exception\\RuntimeException', array('ocr' => array())),\n array('\\GSOcr\\Exception\\RuntimeException', array('ocr' => array('service' => 'test'))),\n );\n }",
"public function getExceptions()\r\r\n {\r\r\n return $this->exceptions;\r\r\n }",
"public function violations(): array;",
"function getErrors()\n\t{\n\t\treturn [];\n\t}",
"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 getWarnings(): array;",
"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 }",
"private function getErrorMessage(Throwable $exception, Response $response): array\n {\n // Set base of error message\n $error = [\n 'message' => $this->getExceptionMessage($exception),\n 'code' => $exception->getCode(),\n 'status' => $response->getStatusCode(),\n ];\n\n // Attach more info to error response in dev environment\n if ($this->environment === 'dev') {\n $error += [\n 'debug' => [\n 'exception' => $exception::class,\n 'file' => $exception->getFile(),\n 'line' => $exception->getLine(),\n 'message' => $exception->getMessage(),\n 'trace' => $exception->getTrace(),\n 'traceString' => $exception->getTraceAsString(),\n ],\n ];\n }\n\n return $error;\n }",
"private function returnErrors() {\n\n return array(\n 'Settings' => array(\n 'type' => 'Client Side Errors',\n 'message' => $this->errors\n )\n );\n }",
"public function providerChainExceptionOnInvalidReturnValue() {\n return [\n [FALSE],\n [0],\n [1],\n [TRUE],\n [[1, 2, 3]],\n [new \\stdClass()],\n ];\n }",
"public function getMessage(): array\n {\n return [\n self::RULE_REQUIRED => 'This Field is required',\n self::RULE_EMAIL => 'Please input valid email address',\n self::RULE_MATCH => 'The Passwords must match',\n self::RULE_UNIQUE => 'This record exists in the database',\n self::RULE_VALID_START_DATE => 'Project start date cannot be before today',\n self::RULE_VALID_END_DATE => 'Project end date cannot be before start date'\n\n ];\n }",
"public function get_errors() {\n $res = array();\n foreach($this->errors as $error) {\n $res[] = $error->errormsg;\n }\n return $res;\n }",
"public function formatReport()\n {\n $messages = array();\n $report = $this->getReport();\n\n switch(true){\n\n case $report instanceof ConstraintViolationListInterface:\n foreach ($report as $constraintViolation){\n $messages[] = $constraintViolation->getMessage();\n }\n break;\n\n case $report instanceof FormErrorIterator:\n foreach ($report as $formError) {\n $messages[] = $formError->getMessage();\n }\n break;\n\n default:\n $messages[] = $this->getMessage();\n\n }\n\n return $messages;\n }",
"protected function getErrorData()\n {\n $error = [\n 'message' => $this->getErrorMessage(),\n ];\n\n if ($this->debug && \\is_object($this->error)) {\n $error['exception'] = \\get_class($this->error);\n $error['file'] = $this->error->getFile();\n $error['line'] = $this->error->getLine();\n $error['trace'] = \\collect($this->error->getTrace())->map(function ($trace) {\n return Arr::except($trace, ['args']);\n })->all();\n }\n\n if ($this->error instanceof ValidationException && $this->error->validator) {\n if ($this->error->validator) {\n $error['errors'] = $this->error->validator->errors();\n } else {\n $error['errors'] = [];\n }\n } elseif ($this->error instanceof MessageBag) {\n $error['errors'] = $this->error->getMessages();\n }\n\n return $error;\n }",
"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 invalidRequests()\n {\n return [\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/status/404',\n '',\n [],\n HttpClientErrorException::class\n ],\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/status/500',\n '',\n [],\n HttpServerErrorException::class\n ],\n ];\n }",
"public static function assertionFailureMessagesProvider(): array\n {\n $templateDir = TEST_APP . 'templates' . DS;\n\n return [\n 'assertContentType' => ['assertContentType', 'Failed asserting that \\'test\\' is set as the Content-Type (`text/html`).', '/posts/index', 'test'],\n 'assertContentTypeVerbose' => ['assertContentType', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'test'],\n 'assertCookie' => ['assertCookie', 'Failed asserting that \\'test\\' is in cookie \\'remember_me\\'.', '/posts/index', 'test', 'remember_me'],\n 'assertCookieVerbose' => ['assertCookie', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'test', 'remember_me'],\n 'assertCookieEncrypted' => ['assertCookieEncrypted', 'Failed asserting that \\'test\\' is encrypted in cookie \\'secrets\\'.', '/posts/secretCookie', 'test', 'secrets'],\n 'assertCookieEncryptedVerbose' => ['assertCookieEncrypted', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'test', 'NameOfCookie'],\n 'assertCookieNotSet' => ['assertCookieNotSet', 'Failed asserting that \\'remember_me\\' cookie is not set.', '/posts/index', 'remember_me'],\n 'assertFileResponse' => ['assertFileResponse', 'Failed asserting that \\'test\\' file was sent.', '/posts/file', 'test'],\n 'assertFileResponseVerbose' => ['assertFileResponse', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'test'],\n 'assertHeader' => ['assertHeader', 'Failed asserting that \\'test\\' equals content in header \\'X-Cake\\' (`custom header`).', '/posts/header', 'X-Cake', 'test'],\n 'assertHeaderContains' => ['assertHeaderContains', 'Failed asserting that \\'test\\' is in header \\'X-Cake\\' (`custom header`)', '/posts/header', 'X-Cake', 'test'],\n 'assertHeaderNotContains' => ['assertHeaderNotContains', 'Failed asserting that \\'custom header\\' is not in header \\'X-Cake\\' (`custom header`)', '/posts/header', 'X-Cake', 'custom header'],\n 'assertHeaderContainsVerbose' => ['assertHeaderContains', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'X-Cake', 'test'],\n 'assertHeaderNotContainsVerbose' => ['assertHeaderNotContains', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'X-Cake', 'test'],\n 'assertLayout' => ['assertLayout', 'Failed asserting that \\'custom_layout\\' equals layout file `' . $templateDir . 'layout' . DS . 'default.php`.', '/posts/index', 'custom_layout'],\n 'assertLayoutVerbose' => ['assertLayout', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'custom_layout'],\n 'assertRedirect' => ['assertRedirect', 'Failed asserting that \\'http://localhost/\\' equals content in header \\'Location\\' (`http://localhost/posts`).', '/posts/flashNoRender', '/'],\n 'assertRedirectVerbose' => ['assertRedirect', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', '/'],\n 'assertRedirectContains' => ['assertRedirectContains', 'Failed asserting that \\'/posts/somewhere-else\\' is in header \\'Location\\' (`http://localhost/posts`).', '/posts/flashNoRender', '/posts/somewhere-else'],\n 'assertRedirectContainsVerbose' => ['assertRedirectContains', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', '/posts/somewhere-else'],\n 'assertRedirectNotContainsVerbose' => ['assertRedirectNotContains', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', '/posts/somewhere-else'],\n 'assertResponseCode' => ['assertResponseCode', 'Failed asserting that `302` matches response status code `200`.', '/posts/index', 302],\n 'assertResponseContains' => ['assertResponseContains', 'Failed asserting that \\'test\\' is in response body.', '/posts/index', 'test'],\n 'assertResponseEmpty' => ['assertResponseEmpty', 'Failed asserting that response body is empty.', '/posts/index'],\n 'assertResponseEquals' => ['assertResponseEquals', 'Failed asserting that \\'test\\' matches response body.', '/posts/index', 'test'],\n 'assertResponseEqualsVerbose' => ['assertResponseEquals', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'test'],\n 'assertResponseError' => ['assertResponseError', 'Failed asserting that 200 is between 400 and 429.', '/posts/index'],\n 'assertResponseFailure' => ['assertResponseFailure', 'Failed asserting that 200 is between 500 and 505.', '/posts/index'],\n 'assertResponseNotContains' => ['assertResponseNotContains', 'Failed asserting that \\'index\\' is not in response body.', '/posts/index', 'index'],\n 'assertResponseNotEmpty' => ['assertResponseNotEmpty', 'Failed asserting that response body is not empty.', '/posts/empty_response'],\n 'assertResponseNotEquals' => ['assertResponseNotEquals', 'Failed asserting that \\'posts index\\' does not match response body.', '/posts/index/error', 'posts index'],\n 'assertResponseNotRegExp' => ['assertResponseNotRegExp', 'Failed asserting that `/index/` PCRE pattern not found in response body.', '/posts/index/error', '/index/'],\n 'assertResponseNotRegExpVerbose' => ['assertResponseNotRegExp', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', '/index/'],\n 'assertResponseOk' => ['assertResponseOk', 'Failed asserting that 404 is between 200 and 204.', '/posts/missing', '/index/'],\n 'assertResponseRegExp' => ['assertResponseRegExp', 'Failed asserting that `/test/` PCRE pattern found in response body.', '/posts/index/error', '/test/'],\n 'assertResponseSuccess' => ['assertResponseSuccess', 'Failed asserting that 404 is between 200 and 308.', '/posts/missing'],\n 'assertResponseSuccessVerbose' => ['assertResponseSuccess', 'Possibly related to `Cake\\Controller\\Exception\\MissingActionException`: \"Action `PostsController::missing()` could not be found, or is not accessible.\"', '/posts/missing'],\n\n 'assertSession' => ['assertSession', 'Failed asserting that \\'test\\' is in session path \\'Missing.path\\'.', '/posts/index', 'test', 'Missing.path'],\n 'assertSessionHasKey' => ['assertSessionHasKey', 'Failed asserting that \\'Missing.path\\' is a path present in the session.', '/posts/index', 'Missing.path'],\n 'assertSessionNotHasKey' => ['assertSessionNotHasKey', 'Failed asserting that \\'Flash.flash\\' is not a path present in the session.', '/posts/index', 'Flash.flash'],\n\n 'assertTemplate' => ['assertTemplate', 'Failed asserting that \\'custom_template\\' equals template file `' . $templateDir . 'Posts' . DS . 'index.php`.', '/posts/index', 'custom_template'],\n 'assertTemplateVerbose' => ['assertTemplate', 'Possibly related to `Cake\\Routing\\Exception\\MissingRouteException`: \"A route matching `/notfound` could not be found.\"', '/notfound', 'custom_template'],\n 'assertFlashMessage' => ['assertFlashMessage', 'Failed asserting that \\'missing\\' is in \\'flash\\' message.', '/posts/index', 'missing'],\n 'assertFlashMessageWithKey' => ['assertFlashMessage', 'Failed asserting that \\'missing\\' is in \\'auth\\' message.', '/posts/index', 'missing', 'auth'],\n 'assertFlashMessageAt' => ['assertFlashMessageAt', 'Failed asserting that \\'missing\\' is in \\'flash\\' message #0.', '/posts/index', 0, 'missing'],\n 'assertFlashMessageAtWithKey' => ['assertFlashMessageAt', 'Failed asserting that \\'missing\\' is in \\'auth\\' message #0.', '/posts/index', 0, 'missing', 'auth'],\n 'assertFlashElement' => ['assertFlashElement', 'Failed asserting that \\'missing\\' is in \\'flash\\' element.', '/posts/index', 'missing'],\n 'assertFlashElementWithKey' => ['assertFlashElement', 'Failed asserting that \\'missing\\' is in \\'auth\\' element.', '/posts/index', 'missing', 'auth'],\n 'assertFlashElementAt' => ['assertFlashElementAt', 'Failed asserting that \\'missing\\' is in \\'flash\\' element #0.', '/posts/index', 0, 'missing'],\n 'assertFlashElementAtWithKey' => ['assertFlashElementAt', 'Failed asserting that \\'missing\\' is in \\'auth\\' element #0.', '/posts/index', 0, 'missing', 'auth'],\n ];\n }",
"public function messages()\n {\n $messages = [];\n\n foreach (TransHelper::getAllLanguages() as $language) {\n $messages['translations.' . $language->iso_code . '.name.required'] = 'Name (' . $language->title_localized . ') is required';\n }\n\n return $messages;\n }",
"public function getExceptions()\n {\n return array(\n array($this->getMock('\\Exception')),\n array($this->getMock('\\RuntimeException')),\n );\n }",
"public function messages(): array\n {\n $messages = [\n 'products.required' => 'Please add product min 1',\n 'products.array' => 'Products must be an array',\n 'products.min' => 'Please add product min 1',\n ];\n\n foreach ($this->products as $key => $product) {\n $messages[\"products.$key.id.required\"] = 'Please choise a product';\n $messages[\"products.$key.id.exists\"] = 'Product not available';\n $messages[\"products.$key.qty.min\"] = 'Please add stock min 1';\n $messages[\"products.$key.qty.max\"] = 'Sory, the stock is not enough';\n }\n\n return $messages;\n }",
"public static function appAuthFailure(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $authStorage = AuthenticationStorageProvider::appAuthFailure();\n $shipmentOrders = ShipmentRequestProvider::createSingleShipmentSuccess();\n $soapFault = new \\SoapFault('HTTP', 'Unauthorized');\n\n return [\n 'application auth error' => [$wsdl, $authStorage, $shipmentOrders, $soapFault],\n ];\n }",
"public function getErrorMessage()\n {\n return [\n 'error' => [\n 'message' => 'Nonce token is invalid or missing.',\n ],\n ];\n }",
"protected function getDefaultExceptionMessages(Exception $ex): array\n {\n return [\"<fatal>{$ex->getMessage()}\" . \\PHP_EOL . \"{$ex->getTraceAsString()}</fatal>\"];\n }",
"public function errors()\n {\n // return new \\ArrayList($this->errorList.values());\n }",
"public function messages(): array\n {\n return [\n 'required' => config('constants.RESET_PASSWORD.LINK_ERROR'),\n 'exists' => config('constants.RESET_PASSWORD.LINK_ERROR'),\n 'email' => config('constants.RESET_PASSWORD.LINK_ERROR'),\n 'confirmed' => config('constants.RESET_PASSWORD.RE_PASSWORD_ERROR')\n ];\n }",
"public function getWarnings() : array;",
"public function messages()\n {\n return [\n 'contractor_account_id.exists' => 'Invalid data.',\n 'truck_id.exists' => 'Invalid data.',\n 'source_id.exists' => 'Invalid data.',\n 'destination_id.exists' => 'Invalid data.',\n 'driver_id.exists' => 'Invalid data.',\n 'material_id.exists' => 'Invalid data.',\n ];\n }",
"public function getFault()\n {\n if ($this->fault) {\n $org = $this->fault->getTrace()[1];\n return [\n 'fault' => [\n 'message' => $this->fault->getMessage(),\n 'caller' => $org['file'] .':' .$org['line'],\n ],\n ];\n }\n }",
"public function messages()\n {\n return [\n 'name.required' => __('The name field is required'),\n 'locale.required' => __('The code field is required'),\n 'locale.min' => __('The code must be at least :max characters', ['min' => 1]),\n 'locale.max' => __('The code may not be greater than :max characters', ['max' => 5]),\n 'locale.unique' => __('The code has already been taken'),\n ];\n }",
"final public function getError():array\n {\n return $this->errors;\n }",
"public function getErrorMessages(){\n return $this->arr_msg; \n }",
"public static function createShipmentsError(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $singleResponse = __DIR__ . '/../../_files/createshipment/singleShipmentError.xml';\n $multiResponse = __DIR__ . '/../../_files/createshipment/multiShipmentError.xml';\n\n $authStorage = AuthenticationStorageProvider::authSuccess();\n\n $singleLabelRequest = ShipmentRequestProvider::createSingleShipmentError();\n $singleLabelResponse = \\file_get_contents($singleResponse);\n\n $multiLabelRequest = ShipmentRequestProvider::createMultiShipmentError();\n $multiLabelResponse = \\file_get_contents($multiResponse);\n\n return [\n 'single label validation error' => [$wsdl, $authStorage, $singleLabelRequest, $singleLabelResponse],\n 'multi label validation error' => [$wsdl, $authStorage, $multiLabelRequest, $multiLabelResponse],\n ];\n }",
"public function messages(): array\n {\n return [\n 'required' => 'O campo :attribute é obrigatório.',\n 'integer' => 'O campo :attribute não é um número válido.',\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 getErrorList()\n {\n return [\n 9 => 1,\n 14 => 1,\n 20 => 1,\n 22 => 1,\n 32 => 1,\n 36 => 1,\n 44 => 1,\n 48 => 1,\n 56 => 1,\n 60 => 1,\n 68 => 1,\n 72 => 1,\n 84 => 1,\n 88 => 2,\n 100 => 1,\n 104 => 2,\n 122 => 2,\n 128 => 1,\n 132 => 3,\n 133 => 2,\n 147 => 1,\n 157 => 1,\n 165 => 1,\n ];\n\n }",
"public function getErrorList() : 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\t7 => 1,\n\t\t\t\t\t14 => 1,\n\t\t\t\t\t27 => 1,\n\t\t\t\t\t37 => 1,\n\t\t\t\t\t47 => 1,\n\t\t\t\t\t59 => 1,\n\t\t\t\t\t78 => 1,\n\t\t\t\t\t94 => 1,\n\t\t\t\t\t98 => 1,\n\t\t\t\t\t105 => 1,\n\t\t\t\t];\n\t\t}\n\t\treturn [];\n\t}",
"public function messages()\n {\n return [\n 'title.required' => 'Заглавие цвета не может быть пустым',\n 'title.min' => 'Минимальная длина заглавия 3 символов',\n 'title.max' => 'Максимальная длина заглавия 100 символов',\n 'title.unique' => 'Цвет с таким заглавием уже существует',\n 'code.required' => 'Код цвета не может быть пустым',\n 'code.min' => 'Минимальная длина кода цвета 3 символов',\n 'code.max' => 'Максимальная длина кода цвета 100 символов',\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 messages(): array\n {\n return [\n 'media.exists' => trans('validation.exists'),\n ];\n }",
"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 getError()\n {\n if (empty($this->error) != true){\n end($this->error); //Pointer to the end\n $key = key($this->error); //Get the key of last element\n $ret = array( \"code\" => $key, \"description\" => $this->error[$key] );\n reset($this->error);\n }else{\n $ret = array( \"code\" => \"get_error\", \"description\" => \"No are errors to show\" );\n }\n \n return $ret;\n }",
"private function getDefaultExceptions($controller) {\n return array(\n array(\"OperationConflictException\", $controller->responser->Conflict()),\n array(\"DataAccessResultException\", $controller->responser->InternalServerError()),\n array(\"DbOperationException\", $controller->responser->InternalServerError()),\n array(\"InvalidAccessParamsException\", $controller->responser->BadRequest()),\n array(\"AuthorizationException\", $controller->responser->Forbidden()),\n array(\"Exception\", $controller->responser->InternalServerError()),\n );\n }",
"public function getMandatoryExceptions()\n {\n if ($this->_mandatoryExceptions === null) {\n $this->_mandatoryExceptions = [];\n\n $exceptions = $this->_config->get('dataprocessing/mandatory/exceptions');\n\n if (!empty($exceptions)) {\n if (is_array($exceptions['exception']) && is_int(key($exceptions['exception']))) {\n foreach ($exceptions['exception'] as $exception) {\n $this->_mandatoryExceptions[] = Cemes::loadModule('Helper/Exception', [$exception], 'Fci');\n }\n } else {\n $this->_mandatoryExceptions[] = Cemes::loadModule(\n 'Helper/Exception',\n [$exceptions['exception']],\n 'Fci'\n );\n }\n }\n }\n\n return $this->_mandatoryExceptions;\n }",
"public function getJson()\n {\n $response = [];\n\n $response['type'] = config('phpvms.error_root').'/'.$this->getErrorType();\n $response['title'] = $this->getMessage();\n $response['details'] = $this->getErrorDetails();\n $response['status'] = $this->getStatusCode();\n\n // For backwards compatibility\n $response['error'] = [\n 'status' => $this->getStatusCode(),\n 'message' => $this->getErrorDetails(),\n ];\n\n return array_merge($response, $this->getErrorMetadata());\n }"
] | [
"0.67616457",
"0.6750641",
"0.67473006",
"0.65946",
"0.6576876",
"0.6571398",
"0.6569079",
"0.6530341",
"0.65291256",
"0.65291256",
"0.6427181",
"0.64034414",
"0.6400445",
"0.6387168",
"0.6377751",
"0.6346886",
"0.6312215",
"0.6303978",
"0.62870264",
"0.62740266",
"0.62568307",
"0.62342364",
"0.6206151",
"0.62038183",
"0.6201208",
"0.6201208",
"0.6201208",
"0.6195353",
"0.619411",
"0.61670786",
"0.61262476",
"0.61058587",
"0.610205",
"0.60949844",
"0.6084783",
"0.6077532",
"0.6076478",
"0.607443",
"0.6064079",
"0.60555845",
"0.6054181",
"0.6048956",
"0.6047415",
"0.60367954",
"0.6010582",
"0.6005662",
"0.60017186",
"0.5998152",
"0.59931296",
"0.5982691",
"0.59674335",
"0.5967119",
"0.5965024",
"0.59631944",
"0.5962887",
"0.5954878",
"0.5951689",
"0.59509915",
"0.5933744",
"0.59277546",
"0.5920109",
"0.5916263",
"0.59113973",
"0.59111184",
"0.5897592",
"0.5897043",
"0.58957464",
"0.5887277",
"0.5869937",
"0.58687025",
"0.58671963",
"0.58629495",
"0.5846377",
"0.58443886",
"0.5843459",
"0.58430916",
"0.5839862",
"0.58378386",
"0.5830128",
"0.5828836",
"0.5826162",
"0.5825678",
"0.5800114",
"0.5800033",
"0.57869816",
"0.5776525",
"0.57683414",
"0.5750525",
"0.57478625",
"0.5744368",
"0.57402563",
"0.5735217",
"0.57320327",
"0.57317746",
"0.57310575",
"0.5725509",
"0.5717421",
"0.5717126",
"0.5707023",
"0.5704729",
"0.57036906"
] | 0.0 | -1 |
Send JSON to the client. | public function testAction() {
$reponse = new Reponse ();
$reponse->data = $this->person->toArray (); // $input_arrays;
// $this->societe->save();
$reponse->message = "TXT_PERSON_SENT";
$reponse->success = true;
$this->render ( $reponse );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function sendJson($json) {\n\t header('Content-Type: application/json');\n\t echo json_encode($json);\n\t}",
"protected abstract function send($json);",
"public function send()\n {\n $this->jsonManager->domain = $this->uri;\n $this->jsonManager->port = $this->port;\n $this->jsonManager->online = $this->isOnline();\n $this->jsonManager->send();\n }",
"public function send(){\n header('HTTP/1.1 200 OK');\n header('Content-type: application/json');\n echo CJavaScript::jsonEncode($this->get());\n Yii::app()->end();\n }",
"protected static function sendJson($data) {\n header('Content-Type: application/json');\n echo json_encode($data);\n exit;\n }",
"public static function sendJsonResponse($json)\n\t{\n\t\tif($json instanceof JsonObject)\n\t\t\t$json = $json->encode();\n\t\t\n\t\theader('Content-Type: text/json');\n\t\theader('Content-Length: ' . strlen($json));\n\t\techo $json;\n\t\texit;\n\t}",
"protected static function sendJson(array $data)\n {\n header('Content-Type: application/json');\n echo json_encode($data);\n }",
"public static function _json($data) {\n self::response(false)\n ->status(200)\n ->header('Content-Type', 'application/json')\n ->write(json_encode($data))\n ->send();\n }",
"public function json()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: application/json');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // if cli add time\n if ($cli = Utility::isCli()) {\n echo \"[\". date('Y-m-d H:i:s') . \"] \";\n }\n // set varibales data\n if ($cli && version_compare(phpversion(), '5.4.0') > 0) {\n $results = json_encode($this->vars, JSON_PRETTY_PRINT);\n } else {\n $results = json_encode($this->vars);\n }\n // send\n echo $results;\n // if cli add \\n\n if ($cli) {\n echo \"\\n\";\n }\n }\n }",
"public function send(){\n\t\techo json_encode(array(\"messages\" => $this->json_cards));\n\t}",
"public function json($data){\n $data = json_encode($data);\n\n $statusCode = $this->statusCode ? $this->statusCode : $this->statusCodes[$this->requestMethod];\n\n $this->sendReponse($statusCode, $data);\n }",
"public static function send_json($data)\r\n\t{\r\n\t\theader('Pragma: no-cache');\r\n\t\theader('Cache-Control: private, no-cache');\r\n\t\theader('Content-Disposition: inline; filename=\"file.json\"');\r\n\t\theader('X-Content-Type-Options: nosniff');\r\n\t\theader('Content-Type: application/json');\r\n\t echo json_encode($data);\r\n\t\texit;\r\n\t}",
"public static function send_quote_json(array $data)\n\t{\n\t\t// switch regular JSON response handling off\n\t\tegw_json_request::isJSONRequest(false);\n\n\t\theader('Content-Type: application/json; charset=utf-8');\n\t\techo json_encode(self::htmlencode_node($data));\n\n\t\tcommon::egw_exit();\n\t}",
"protected function send($data)\n\t{\n\t\t$this->response->setJsonContent($data);\n\t\t$this->response->send();\n\t\texit;\n\t}",
"public function send()\n {\n $response = $this->apiClient->sendRequest(\n $this->getRequest(),\n $this->withAuthentication\n );\n\n return $this->apiClient->getResponseJson($response);\n }",
"public static function flushAndSendJsonResponse($result)\n {\n ob_clean();\n header('Content-Type: application/json');\n echo json_encode($result);\n exit;\n }",
"function toJSON($json){\n header('Content-type: application/json');\n\t\techo $json;\n }",
"public function send(){\n\n\n\n $id = $_GET['id'];\n $msg = $_GET['msg'];\n $response = $this->sendMessage($id,$msg);\n $return[\"allresponses\"] = $response;\n $return = json_encode($return);\n $data = json_decode($response, true);\n\n echo $response;\n\n }",
"public static function sendJson($content = '', $status = 200)\n {\n\t\theader('Content-Type: application/json');\n\t\thttp_response_code($status);\n\t\t$data = [\n\t\t\t'message' => $content\n\t\t];\n\t\techo json_encode($data);\n\t\tdie();\n }",
"public static function sendJsonResponse($data = null){\n header('Content-Type: application/json; charset=utf-8');\n\n if($data == null){\n http_response_code(204);\n }\n else{\n http_response_code(200);\n echo json_encode($data);\n }\n die();\n }",
"public function send() {\r\n\t\t$this->resource->send();\r\n\t}",
"public static function sendJsonResponse($result, $options = 0)\n {\n header('Content-Type: application/json');\n echo json_encode($result, $options);\n exit;\n }",
"private function ToClient($data) {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode($data);\n// if (json_last_error() == 5) {\n// foreach ($data as $key => $value) {\n// $data[$key] = utf8ize($value);\n// }\n// } else {\n// echo $data_js;\n// }\n }",
"static function response(string $json){\n header('Content-Type: application/json');\n echo $json;\n }",
"protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }",
"protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }",
"protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }",
"public function echoJson() {\r\n header(\"Content-type: application/json;\");\r\n echo $this->getResult();\r\n }",
"public function send()\n {\n $fields = count($this->filed)?$this->filed:array();\n $fields = json_encode($fields);\n try{\n $client = new Client();\n $promise = $client->requestAsync('POST','https://onesignal.com/api/v1/notifications',[\n 'headers' =>array(\n 'Content-Type'=>'application/json',\n 'Authorization'=>'Basic '.$this->restKey[$this->platform]\n ),\n 'body'=>$fields\n ]);\n $promise->then(\n function (ResponseInterface $res){\n $body = $res->getBody();\n $stringBody = (string) $body;\n \\Yii::debug(\"onesignal: \".$stringBody);\n },\n function (RequestException $e) {\n \\Yii::error(\"onesignal error: \".$e->getMessage().' '.$e->getRequest()->getMethod());\n }\n );\n $promise->wait();\n }catch (RequestException $e) {\n \\Yii::error(\"send fail\");\n }\n }",
"public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $response = array(\n 'status' => (bool)$result\n );\n\n // encode return array\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}",
"public function sendData()\n \t{\n \t\t$data = $this->m_admin->getData(\"siswa\")->result();\n \t\techo json_encode($data) ;\n \t}",
"private function send(): void\n {\n $data = [\n 'code' => $this->status,\n 'message' => $this->message,\n 'datetime' => Carbon::now()\n ];\n\n $config = config(\"tebot.$this->channelConfig\");\n\n $data['title'] = $this->title . ' ' . $config['name'];\n\n if (!empty($this->detail)) $data['detail'] = json_encode($this->detail);\n\n Http::withHeaders(['x-api-key' => $config['key']])->post($config['url'] . '/api/message', $data);\n }",
"public function send()\n {\n $this->sendHeaders();\n $this->sendBody();\n }",
"public function render()\n {\n // Fire event\n C::Event()->fire('Json', 'renderStart');\n\n // Set content type\n header('Content-type: application/json');\n\n // Set status code\n http_response_code($this->statuscode);\n\n // Status on body?\n if (isset($this->settings['status_on_body']) && $this->settings['status_on_body']) {\n $this->data = [\"status\" => $this->statuscode] + $this->data;\n }\n\n // Pretty output?\n if (C::Config()->get('main:output.json.pretty', true)) {\n return json_encode($this->data, JSON_PRETTY_PRINT);\n }\n\n return json_encode($this->data);\n }",
"public function send(): void\n {\n $requiredParams = [\n 'v' => $this->client->getVersion(),\n 'tid' => $this->client->getTrackingId(),\n 'cid' => $this->client->getClientId(),\n 't' => $this->getHitType(),\n ];\n $paramValues = array_merge(\n $requiredParams,\n $this->parameters\n );\n \n $url = $this->getBaseUrl();\n\n $guzzle = new \\GuzzleHttp\\Client();\n $result = $guzzle->request('POST', $url, ['form_params' => $paramValues]);\n\n if ($this->client->isDebug()) {\n var_dump((string) $result->getBody());\n }\n }",
"private function send_success() {\n header('Content-Type: application/json');\n echo json_encode(array('success' => true));\n return;\n }",
"public function json($data)\n {\n $this->template = NULL;\n $this->response->headers('Content-Type', 'application/json; charset=utf-8');\n $this->response->body(json_encode($data));\n }",
"public function send()\n {\n // Stream post the data\n $this->evaluateResponse($this->httpPost($this->str_endpoint . '/event', $this->compile()));\n }",
"public function send(): void\n\t{\n\t\t$this->sendHeaders();\n\t\t$this->sendBody();\n\t}",
"public function send(): void\n {\n $this->sendHeaders();\n $this->sendBody();\n }",
"public function emit($requestJSONData);",
"protected function jsonReponse($jsonData)\n {\n $this->getResponse()->setHeader('Content-type', 'application/json');\n $this->getResponse()->setBody($jsonData);\n }",
"function jsonAction()\n {\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n $request_data = $this->_getAllParams();\n\n $method_name = $this->_getParam('method');\n if(!isset($method_name))\n {\n echo \"Inconsistent request\";\n exit;\n }\n\n $request_data = $this->_getAllParams();\n // Handle XML-RPC request\n $this->kwWebApiCore = new KwWebApiRestCore($this->apiSetup, $this->apicallbacks, array_merge($request_data, array('format' => 'json')));\n }",
"public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }",
"protected function send($data) {\n\t\tswitch ($this->content_type) {\n\t\t\tcase self::JSON:\n\t\t\t\t$response = json_encode($data, JSON_UNESCAPED_SLASHES);\n\t\t\t\tbreak;\n\t\t\tcase self::XML:\n\t\t\t\t$response = self::xml_encode('response', $data);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$response = is_array($data) ? json_encode($data, JSON_UNESCAPED_SLASHES) : (string) $data;\n\t\t\t\tbreak;\n\t\t}\n\n\t\theader('Content-Type: ' . $this->content_type . '; charset=utf-8');\n\t\theader('Content-Length: ' . strlen($response));\n\n\t\techo $response;\n\t}",
"public function send()\n {\n http_response_code($this->statusCode);\n $this->sendContent();\n }",
"public function testSendValidJsonHttpRequest()\n {\n $client = new HttpClient();\n $payload = [\n 'foo1' => 'bar1',\n 'foo2' => 'bar2',\n ];\n $response = $client->sendJson(\n HttpRequestMethod::POST,\n 'https://postman-echo.com/post',\n $payload\n );\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('OK', $response->getReasonPhrase());\n $responseBody = $response->getBody();\n $this->assertArrayHasKey('json', $responseBody);\n $this->assertEquals($payload, $responseBody['json']);\n $this->assertNotEmpty($response->getHeaders());\n }",
"private function sendData($item)\n\t{\n\t\t$content = json_encode($item);\n\t\t$options = new Registry;\n\t\t$options->set('Content-Type', 'application/json');\n\t\t$headers = array('Authorization' => 'Bearer ' . $this->params->get('key'));\n\n\t\treturn HttpFactory::getHttp($options)->post($this->serverUrl, $content, $headers, 2);\n\t}",
"private function giveJSONResponse($data) {\n \n header(\"Content-Type: application/json\");\n echo json_encode($data);\n }",
"function send_response($message)\n{\n\techo json_encode($message);\n}",
"public function sendResponse($message)\n {\n echo json_encode(array(\n 'message' => $message,\n ));\n }",
"public function sendContent(): JsonResponse\n {\n echo $this->getContent();\n\n return $this;\n }",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function json()\n {\n $data = [\n '$schema' => self::PAYLOAD_SCHEMA,\n 'dt' => $this->dt,\n 'message' => $this->message,\n 'level' => $this->level,\n ];\n\n if (count($this->context)) {\n $data['context'] = $this->context;\n }\n if (count($this->event)) {\n $data['event'] = $this->event;\n }\n\n $options = [\n RequestOptions::JSON => [$data],\n ];\n\n return $this->doRequest(self::METHOD_POST, 'frames', $options);\n }",
"public function send(){\n\t\t\n\t\t$database = new Database();\n\t\t$query = $database->selectOne('message_queues', array('id',\n\t\t\t\t\t\t\t\t\t 'is_executed','executed_at','message','cellphone'), \n\t\t\t\t\t\t\t\t\t ' is_executed=0 ');\n\t\t$exec = $database->query($query);\n\t\tif ($exec) {\n\t\t\t$record = $database->fetchArray($exec);\n\t\t\t$response = $this->sendMessage($database, $record);\n\n\t\t\treturn json_encode(array('status' => $response['status'], 'message' => $response['message']));\n\t\t}\n\n\t}",
"public static function EncodeJson (& $data);",
"function set_Json_Response()\n {\n $this->setCommand();\n //Fire Script \n $this->fire_Script();\n $response = array(\"status\"=>$this->status,\n \"script_ouput\"=>$this->script_output,\n \"executation_time\"=>$this->time_interval,\n \"message\"=>$this->message);\n \n echo json_encode($response, JSON_PRETTY_PRINT);\n }",
"public static function showJSON($json) {\n header('Content-Type: application/json');\n echo json_encode($json);\n }",
"public function json($data)\n {\n header(\"Access-Control-Allow-Origin: *\");\n header('Content-Type: application/json');\n\n echo json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK | JSON_BIGINT_AS_STRING);\n }",
"public function action_json()\n {\n $this->response->headers('Content-Type', 'application/json; charset=utf-8');\n echo json_encode($this->result);\n //Profiler::stop($bench);\n //echo View::factory('profiler/stats');\n //$this->response->body('hello!');\n }",
"function render_json($data)\n {\n $this->response->add_header('Content-Type', 'application/json');\n $this->render_text(json_encode(studip_utf8encode($data)));\n }",
"function sendSuccess( $message ) {\n\t\t$obj = new stdClass();\n\n\t\t$obj->success = true;\n\t\t$obj->errorMessage = null;\n\n\t\t$this->sendJSON( $obj );\n\t}",
"protected function sendData()\n {\n $content = json_encode($this->requests);\n\n $context = stream_context_create([\n 'http' => [\n 'method' => 'POST',\n 'header' => implode(\"\\r\\n\", $this->getHeaders($content)),\n 'content' => $content,\n ],\n ]);\n\n $content = file_get_contents($this->uri, false, $context);\n return json_decode($content);\n }",
"public function json($jsondata) {\n\t\techo json_encode($jsondata);\n\t}",
"public function send($state) {\n $this->lastState = json_encode($state);\n foreach ($this->clients as $client) {\n $client->send($this->lastState);\n }\n }",
"protected function sendJsonResponse($success, $message, $params = [])\n {\n $params['success'] = $success;\n $params['message'] = $message;\n if (!$success)\n $params['error'] = $message;\n echo json_encode($params, JSON_PRETTY_PRINT);\n }",
"public function sendResponse()\n {\n $this->_response = Mage::app()->getResponse();\n\n //check redirect\n if ($this->_response->isRedirect()) {\n $headers = $this->_response->getHeaders();\n $redirect = '';\n foreach ($headers as $header) {\n if (\"Location\" == $header[\"name\"]) {\n $redirect = $header[\"value\"];\n break;\n }\n }\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n }\n\n $this->_response->clearHeaders();\n $this->_response->setHeader('Content-Type', 'application/json');\n $this->_response->clearBody();\n $this->_response->setBody($this->toJson());\n $this->_response->sendResponse();\n exit;\n }",
"public function send()\n {\n if (!is_null($this->lastResponse)) {\n $this->lastResponse->send();\n }\n }",
"public function send()\n {\n http_response_code( $this->getResultCode() );\n echo $this->getBody();\n }",
"public static function block_seat_json()\n {\n $response = new stdClass();\n $post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0;\n if ($post_id > 0) {\n $objects = $_POST['selected_objects'];\n if (!empty($objects)) {\n if ($ret = EM_Seatsio::event_block($post_id, $objects, $status)) {\n $response->success = true;\n $response->seats = $ret;\n }\n }\n }\n wp_send_json($response);\n }",
"public function sendJsonMessage($message)\n {\n return array(\n 'output' => 'json',\n 'data' => array(\n 'items' => array(\n 'msg' => $message\n )\n )\n );\n }",
"public static function sendJsonResponse($content, $code = 200){\n http_response_code($code);\n\n header('Content-Type', 'application/json');\n dd($content);\n echo $content;\n }",
"function sendJsonResult($inMessage, $inStatus) {\n\t\t$this->setCacheLevelNone();\n\t\t\n\t\t$response = json_encode(\n\t\t\tarray(\n\t\t\t\t'status' => $inStatus === mvcSession::MESSAGE_INFO ? 'info' : ($inStatus === mvcSession::MESSAGE_OK ? 'success' : 'error'),\n\t\t\t\t'message' => $inMessage,\n\t\t\t)\n\t\t);\n\t\techo $response;\n\t}",
"public function send()\n {\n }",
"protected function send()\n {\n $this->addAuthorization();\n\n $response = $this->client->post(\n $this->apiUrl,\n array(\n 'json' => array(\n 'query' => $this->getQuery(),\n 'variables' => $this->variables,\n ),\n 'headers' => $this->headers,\n )\n );\n\n $responseBody = json_decode($response->getBody(), true);\n if ($responseBody === null) {\n throw new \\RuntimeException('Invalid api call: '.json_encode($this->getQuery()));\n }\n\n $this->body = $responseBody;\n if (isset($responseBody['errors'])) {\n $this->errors = $responseBody['errors'];\n } else {\n $this->response = $responseBody['data'];\n }\n }",
"private function json($data){\n header('Content-type: application/json');\n return json_encode($data);\n }",
"private function setJsonContentType()\n {\n Http::setContentType(self::JSON_CONTENT_TYPE);\n }",
"public function send() {}",
"public function send() {}",
"public function send() {}",
"public function send() {}",
"public function send() {}",
"public function send($data, $exit = true)\n\t{\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($data);\n\n\t\tif ($exit)\n\t\t{\n\t\t\tgarbage_collection();\n\t\t\texit_handler();\n\t\t}\n\t}",
"public function jsonString(){\n return json_encode($this->createRequestsArray());\n }",
"public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}",
"public function send_json_success( $data = null, $status_code = null ) {\r\n\t\t//log it if turned on\r\n\t\tif ( WPMUDEV_API_DEBUG ) {\r\n\t\t\t$req_time = round( ( microtime( true ) - $this->timer ), 4 ) . \"s\";\r\n\t\t\t$req_status = is_null( $status_code ) ? 200 : $status_code;\r\n\t\t\t$log = '[Hub API call response] %s %s %s %s';\r\n\t\t\t$log .= \"\\n Response: (success) %s\\n\";\r\n\t\t\t$msg = sprintf(\r\n\t\t\t\t$log,\r\n\t\t\t\t$_GET['wpmudev-hub'],\r\n\t\t\t\t$this->current_action,\r\n\t\t\t\t$req_status,\r\n\t\t\t\t$req_time,\r\n\t\t\t\tjson_encode( $data, JSON_PRETTY_PRINT )\r\n\t\t\t);\r\n\t\t\terror_log( $msg );\r\n\t\t}\r\n\r\n\t\twp_send_json_success( $data, $status_code );\r\n\t}",
"protected function jsonBody($data)\n {\n if (isset($data)) {\n $this->response = $this->response->withHeader('Content-Type', 'application/json');\n $this->response->getBody()->write(json_encode($data));\n }\n }",
"function send()\n {\n try{\n $client = new Client();\n $response = $client->request('POST', $this->base_url_SendSMS, [\n 'form_params' => [\n 'Userid' => $this->username,\n 'pwd' => $this->password,\n 'APIKEY' => $this->apikey,\n 'MSG' => $this->msgtext,\n 'FROM' => $this->from,\n 'To' => $this->to,\n ]\n ]);\n\n echo $response->getStatusCode(); // 200\n $response->getReasonPhrase(); // OK\n $response->getProtocolVersion(); // 1.1\n }\n catch(\\GuzzleHttp\\Exception\\ClientException $e){\n echo $e->getMessage();\n }\n catch(ErrorException $e){\n echo $e->getMessage();\n }\n }",
"public static function renderJSON($json)\n\t{\n\t if (!Application::instance()->isCLI())\n\t\t{\n\t\t\thdr('Content-Type: application/json');\n\t\t}\n\t\treturn json_encode($json, JSON_PRETTY_PRINT); # pretty json\n\t}",
"public function json()\n {\n $this->fetchFields();\n Log::json($this);\n }",
"public function send() {\n if (!$this->client) {\n return false;\n }\n }"
] | [
"0.7664531",
"0.75291",
"0.73974764",
"0.72468185",
"0.7103002",
"0.7024999",
"0.67069995",
"0.6617192",
"0.6598396",
"0.6531163",
"0.63269454",
"0.63181686",
"0.6216794",
"0.61660963",
"0.6148657",
"0.6112344",
"0.6028644",
"0.6020143",
"0.60155624",
"0.60065454",
"0.6005837",
"0.5996608",
"0.5944484",
"0.5938039",
"0.5855187",
"0.5855187",
"0.5855187",
"0.58472294",
"0.58208364",
"0.5802417",
"0.5793834",
"0.578186",
"0.5763786",
"0.5753745",
"0.5733473",
"0.57295936",
"0.5725276",
"0.57159257",
"0.57086307",
"0.568787",
"0.56799453",
"0.56782246",
"0.56671315",
"0.5646232",
"0.5644078",
"0.56398576",
"0.56390077",
"0.5637297",
"0.5633241",
"0.5629433",
"0.5626756",
"0.56240535",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.56231093",
"0.5621671",
"0.5610493",
"0.5605659",
"0.55984634",
"0.55956674",
"0.55881834",
"0.5579838",
"0.55763596",
"0.5575787",
"0.5554641",
"0.55497426",
"0.55497164",
"0.5540724",
"0.5540261",
"0.553265",
"0.55305207",
"0.5521919",
"0.55208194",
"0.5514774",
"0.5508748",
"0.5507463",
"0.5491851",
"0.5491656",
"0.54888225",
"0.5481795",
"0.5481795",
"0.5481795",
"0.5481795",
"0.5481795",
"0.546941",
"0.54664004",
"0.5465609",
"0.54628783",
"0.5457225",
"0.54359293",
"0.54345155",
"0.54318225",
"0.5427562"
] | 0.0 | -1 |
try to get the tag where the parent folder is specified | public function assetThumbnailListAction() {
$parentFolder = $this->document->getElement ( "parentFolder" );
if ($parentFolder) {
$parentFolder = $parentFolder->getElement ();
}
if (! $parentFolder) {
// default is the home folder
$parentFolder = Asset::getById ( 1 );
}
// get all children of the parent
$list = new \Asset\Listing ();
$list->setCondition ( "path like ?", $parentFolder->getFullpath () . "%" );
$this->view->list = $list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParentFolder() {}",
"public function getParentFolder() {}",
"public function getParentFolder() {}",
"public function parentTag(): ?string\n {\n return null;\n }",
"function get_post_parent($post = \\null)\n {\n }",
"public function find_parent_by_tag($tag)\r\n\t{\r\n\t\t$node = $this->parent();\r\n\t\t\r\n\t\twhile($this->parent() != null\r\n\t\t\t&& !$node instanceof SBBCodeParser_Document)\r\n\t\t{\r\n\t\t\tif($node->tag() === $tag)\r\n\t\t\t\treturn $node;\r\n\t\t\t\r\n\t\t\t$node = $node->parent();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public function get_parent();",
"private function getCatParent() {\r\n $rCat = new Read;\r\n $rCat->ExeRead(\"ml_categories\", \"WHERE category_id = :id\", \"id={$this->Data['post_category']}\");\r\n if ($rCat->getResult()):\r\n return $rCat->getResult()[0]['category_parent'];\r\n else:\r\n return null;\r\n endif;\r\n }",
"function get_parent_dir() {\n $path = $_SERVER['PHP_SELF'];\n $splitPath = explode('/', $path);\n return $splitPath[1];\n }",
"function getParent();",
"function wp_get_post_parent_id($post = \\null)\n {\n }",
"abstract protected function getParentName($document);",
"abstract protected function getParentName($document);",
"function get_parent_theme_file_path($file = '')\n {\n }",
"function getParentText();",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"function get_admin_page_parent($parent_page = '')\n {\n }",
"function getParentDir()\n {\n $parent = $this->getParent();\n if (trim($parent) != '')\n return ucwords($parent) . '\\\\';\n return $parent;\n }",
"protected function retrieveParent()\n {\n }",
"public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}",
"public function getParentElement() {}",
"function get_parent($obj = null){\n\tglobal $wp_query;\n\tif(!$obj){\n\t\t$obj = $wp_query->post;\n\t}\n\t\n\t// Checks to see if we've got a parent or not:\n\tif(empty($obj->post_parent))\n\t\treturn $obj->ID;\n\telse\n\t\treturn $obj->post_parent;\n}",
"function get_parent_theme_file_uri($file = '')\n {\n }",
"public function getParent()\n {\n return $this->Root->parentOfSection($this->URLSegment);\n }",
"public function getParentPath() {\n\t\treturn $this->parentPath;\n\t}",
"public function getParent(): ?array\n {\n if (!$this->currentFileName || !$this->metas) {\n return null;\n }\n\n $meta = $this->metas->get($this->currentFileName);\n\n if (!$meta || !isset($meta['parent'])) {\n return null;\n }\n\n $parent = $this->metas->get($meta['parent']);\n\n if (!$parent) {\n return null;\n }\n\n return $parent;\n }",
"function extract_parent_name($full_antimicrobic_name) {\n\t\t$start = strpos($full_antimicrobic_name, '(');\n\t\t\n\t\tif ($start === false)\n\t\t\treturn $full_antimicrobic_name;\n\t\t\t\n\t\t// Estrae il nome del \"padre\" (prima delle parentesi)\n\t\treturn trim( substr($full_antimicrobic_name, 0, $start) );\t\t\n\t}",
"function getParentPageID () {return $this->getFieldValue ('parent_page_id');}",
"public function getParentNode() {}",
"public function parent() { return $this->post->post_parent; }",
"protected function get_parent_shortcode() {\r\n return 'owp_fs';\r\n }",
"public function getParentExtensionName() {}",
"function getParent($id) {\n\t\t\t$this->query(\"SELECT parent FROM usecase WHERE id={$id};\");\n\t\t\t$rs = $this->resultSet();\n\t\t\tif($rs) {\n\t\t\t\t$usecase = $rs[0];\n\t\t\t\tif($usecase[\"parent\"] == \"\")\n\t\t\t\t\treturn 'NULL';\n\t\t\t\telse\n\t\t\t\t\treturn $usecase[\"parent\"];\n\t\t\t} else\n\t\t\t\treturn 'NULL';\n\t\t}",
"function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"private function get_parent($id)\n\t\t{\n\t\t\t$query = \"\tSELECT\n\t\t\t\t\t\t\t`MTN`.`parent` AS 'parent'\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\t\tAND `MTN`.`id`\t\t= \".$id.\"\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\t\t\t$row = $result->fetch_array(MYSQLI_ASSOC);\t\n\t\t\treturn $row['parent'];\t\t\n\t\t}",
"function getRootLevelFolder() ;",
"public function getOuterMostParent() {}",
"public function getParentName() {\n\t\t\t$parent = new Page();\n\t\t\t$parent->loadByGUID($this->parent);\n\t\t\treturn $parent->name;\n\t\t}",
"private function retrieve_parent_title() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) && ( ( is_singular() || is_admin() ) && isset( $GLOBALS['post'] ) ) ) {\n\t\t\tif ( isset( $GLOBALS['post']->post_parent ) && 0 !== $GLOBALS['post']->post_parent ) {\n\t\t\t\t$replacement = get_the_title( $GLOBALS['post']->post_parent );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"function tutv_get_parent_title( $page = null ) {\n global $post;\n\n if ( ! $page ) {\n $page = $post->ID;\n }\n\n\n if ( empty( $post->post_parent ) ) { // if there is no parent...\n return get_the_title( $post->ID ); // return the current page's title\n } else { // if there is a parent...\n return get_the_title( $post->post_parent ); // return the parent's title\n }\n}",
"public function getParentId(): string;",
"public function getGrandparent() {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT parent FROM pages WHERE guid = (SELECT parent FROM pages where guid = '{$this->guid}')\"); \n\t\t\treturn $data;\n\t\t}",
"public function get_plugin_parent_page(): string\n {\n return $this->plugin_parent_page;\n }",
"function parent(){\r\n\t\treturn rsgGalleryManager::get( $this->parent );\r\n\t}",
"protected function _getAssetParentId() {\n $assetParent = JTable::getInstance('Asset');\n $assetParentId = $assetParent->getRootId();\n\n $assetParent->loadByName('com_lajvit');\n\n if ($assetParent->id) {\n $assetParentId = $assetParent->id;\n }\n return $assetParentId;\n }",
"public function parentOfSection($filename)\n {\n // If we are on the root page, call the standard getParent()\n if ($filename == '') {\n return $this->getParent();\n }\n\n // The 'parent' field *must* be set or the node is invalid\n $node = $this->lookupNode($filename);\n if (! isset($node, $node['parent'])) {\n return null;\n }\n\n return $this->lookupSection($node['parent']['link']);\n }",
"function parentNode() {\n\t\treturn 'Albums';\n\t}",
"public function get_parents()\n {\n $hierarchy = array();\n $hierarchy[] = $this;\n\n $d = dirname($this->path);\n while (strlen($d) >= strlen(App::config('src_path')))\n {\n $hierarchy[] = new folder($d);\n $d = dirname($d);\n }\n\n return array_reverse($hierarchy);\n }",
"function ww_get_top_parent( $id = null ) {\n global $post;\n $temp_post = $id ? get_post( $id ) : $post;\n while( $temp_post->post_parent != 0 ) {\n $temp_post = get_post( $temp_post->post_parent );\n }\n return $temp_post;\n}",
"function get_parent() {\n return $this->get_mapped_property('parent');\n }",
"public function get_parent() {\n\t\treturn $this->parent();\n\t}",
"function frg_ancestor_id()\n{\n global $post;\n\n if ( $post->post_parent ) {\n $ancestors = array_reverse( get_post_ancestors( $post->ID ) );\n return $ancestors[0];\n }\n\n return $post->ID;\n}",
"public function parentKey()\n\t{\n\t\t$explode = explode('/', $this->getField('key'));\n\t\tif(isset($explode[1])) {\n\t\t\treturn $explode[0];\n\t\t}\n\n\t\treturn false;\n\t}",
"function get_parent_post_rel_link($title = '%title')\n {\n }",
"function getProjectTaskParent()\n {\n\n $projectTaskParent=false;\n\n if (!empty($this->parent_task_id) && !empty($this->project_id))\n {\n $query = \"SELECT id FROM project_task WHERE project_id = '{$this->project_id}' AND project_task_id = '{$this->parent_task_id}' AND deleted = 0 ORDER BY date_modified DESC\";\n $project_task_id = $this->db->getOne($query, true, \"Error retrieving parent project task\");\n\n if (!empty($project_task_id))\n {\n $projectTaskParent = BeanFactory::getBean('ProjectTask', $project_task_id);\n }\n }\n\n return $projectTaskParent;\n }",
"public function getParentDirectory($path);",
"private function getCurrentParent()\n {\n return $this->getCurrentCategory()->getParentCategory();\n }",
"final protected function parentId() {return $this->r('originalId');}",
"function column_parent( $item ) {\r\n\t\tif ( $item->post_parent ){\r\n\t\t\tif ( isset( $item->parent_title ) ) {\r\n\t\t\t\t$parent_title = $item->parent_title;\r\n\t\t\t} else {\r\n\t\t\t\t$parent_title = __( '(no title: bad ID)', 'media-library-assistant' );\r\n\t\t\t}\r\n\r\n\t\t\treturn sprintf( '<a href=\"%1$s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' ' . __( 'Parent ID', 'media-library-assistant' ) . '\">%2$s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'parent' => $item->post_parent,\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'Parent', 'media-library-assistant' ) . ': ' . $parent_title ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), (string) $item->post_parent );\r\n\t\t} else {\r\n\t\t\treturn (string) $item->post_parent;\r\n\t\t}\r\n\t}",
"public function getParentText(){\n return $this->parent_text;\n }",
"public function getParentNameSpace(){\n return $this->getSite()->getParent()->getParentNameSpace();\n }",
"protected function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"public function getParentId();",
"public function getParentId();",
"public function getParentId();",
"function get_field_parents($field_name, $id)\n{\n global $post;\n\n for($i=1; ; $i++) {\n $field_value = get_field($field_name, $id);\n\n if($field_value) {\n // Field data was found, return it!\n return $field_value;\n break;\n\n } else {\n\n // No field data was found\n if($id == $post->post_parent){\n // Current page is top parent\n break;\n } else {\n // Current page doesnt have a value, check parent page\n $id = $post->post_parent;\n $field_value = get_field($field_name, $id);\n return $field_value;\n break;\n }\n\n }\n\n }\n\n}",
"public function getParentEntry(){\r\n\r\n $url_parts = explode('/', $this->url);\r\n\r\n $size = count($url_parts);\r\n\r\n\r\n\r\n #Remove collection id and slash from end of url\r\n\r\n $url = substr($this->url, 0, -strlen($url_parts[$size-1])-1);\r\n\r\n\r\n\r\n try {\r\n\r\n $data = $this->adapter->request('GET', $url);\r\n\r\n return new AWeberEntry($data, $url, $this->adapter);\r\n\r\n } catch (Exception $e) {\r\n\r\n return NULL;\r\n\r\n }\r\n\r\n }",
"private function basePath()\n {\n return $this->allDescendants()\n ? $this->parentName\n : $this->childPath($this->parentName, $this->query['from'][0]['collectionId']);\n }",
"function getParentSelectorName() ;",
"function email_get_parent_folder($folder) {\n\n\tif (! $folder ) {\n\t\treturn false;\n\t}\n\n\tif ( is_int($folder) ) {\n\t\tif ( ! $subfolder = get_record('email_subfolder', 'folderchildid', $folder) ) {\n\t return false;\n\t }\n\t} else {\n\t\tif ( ! $subfolder = get_record('email_subfolder', 'folderchildid', $folder->id) ) {\n \treturn false;\n\t\t}\n }\n\n return get_record('email_folder', 'id', $subfolder->folderparentid);\n\n}",
"function getGroupParent($gid)\n {\n return null;\n }",
"public function getParentId()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'parentid'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'parentid'];\n\t\t}\n\t}",
"public static function parent()\n\t{\n $label = Text::_('JPARENT');\n\n $html = <<<EOT\n<label for=\"parent\">$label</label>\n<span name=\"parent\" class=\"\" aria-hidden=\"true\"><i>Implement ViewTemplates/Common/HelperEditWidgets::parent</i></span>\nEOT;\n\n\t\treturn $html;\n }",
"private function parentsSqlStatement()\n\t{\n\t\tif($this->stmt_parents == NULL) {\n\t\t\t$sql = \"SELECT parent_id\n\t\t\t\t\tFROM user_site_template_div\n\t\t\t\t\tWHERE id = :id\n\t\t\t\t\tAND template_id = :template_id\n\t\t\t\t\tAND site_id = :site_id\n\t\t\t\t\tAND parent_id <> 0\n\t\t\t\t\tLIMIT 1\";\n\t\t\treturn $this->_db->prepare($sql);\n\t\t} else {\n\t\t\treturn $this->stmt_parents;\n\t\t}\n\t}",
"Public function getParentPageId() {\n\t\tif(!empty($this->parent_pageid))\n\t\t\treturn $this->parent_pageid;\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getPath()\n {\n \treturn implode(' / ', array_map(create_function('$a', 'return trim($a->getName());'), $this->getParents()));\n }",
"public function GetParent()\n {\n $pathcount = count($this->paths);\n \n if ($pathcount <= 1)\n return FALSE; // there is no parent\n\n $pathcount--; // the parent has one path less\n\n $result = array();\n for ($i = 0; $i < $pathcount; $i++)\n $result[$i] = $this->paths[$i];\n\n return new TPhysicalPath($result);\n }",
"public function getParent($parent_name = NULL, $all = TRUE)\r\n\t{\r\n\t\t$parent = NULL;\r\n\r\n\t\tif (is_null($parent_name))\r\n\t\t{\r\n\t\t\t// Correct the nesting, because it is depending on the context, not on the tag\r\n\t\t\t// means the found and returned parent will have the same nesting\r\n\t\t\t$nesting = explode(':', $this->nesting());\r\n\t\t\twhile ( ! empty($nesting))\r\n\t\t\t{\r\n\t\t\t\t$last = array_pop($nesting);\r\n\t\t\t\tif ($last == $this->name)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$parent_name = ! empty($nesting) ? array_pop($nesting) : NULL;\r\n\t\t}\r\n\r\n\t\t// We're supposed to have one parent name\r\n\t\tif ( ! is_null($parent_name))\r\n\t\t{\r\n\t\t\t$stack = array_reverse($this->getStack());\r\n\t\t\tarray_shift($stack);\r\n\r\n\t\t\tforeach($stack as $binding)\r\n\t\t\t{\r\n\t\t\t\tarray_shift($stack);\r\n\r\n\t\t\t\tif ($binding->name == $parent_name)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($all == FALSE && $binding->isProcessTag() == TRUE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parent = $binding->getParent(NULL, FALSE);\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$parent = $binding;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $parent;\r\n\t}",
"public function getParentContentObject() {}",
"public function getGrandParent();",
"function ep_get_nav_menu_top_parent($menu_name) {\n\n\t$menulocations = get_nav_menu_locations();\n\t$menu_items = wp_get_nav_menu_items( $menulocations[$menu_name] );\n\t$top_parent_item = null;\n\t$current_item = null;\n\t$parent_item = null;\n\n\t// Find current post in menu\n\tforeach ($menu_items as $one_item) {\n\t\tif (get_queried_object_id() == $one_item->object_id) {\n\t\t\t$current_item = $one_item;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ($current_item) {\n\n\t\t// got current item, now look for top parent\n\t\t$parent_item = $current_item;\n\t\t$found_parent_item = null;\n\t\twhile ( $found_parent_item !== false ) {\n\t\t\t$found_parent_item = ep_get_nav_item_parent($parent_item, $menu_items);\n\t\t\tif ($found_parent_item !== false)\n\t\t\t\t$parent_item = $found_parent_item;\n\t\t}\n\n\t}\n\n\treturn $parent_item;\n\n}",
"function get_post_ancestors($post)\n {\n }",
"function getparentVideo($catid)\n{\n\t//echo $catid;\n\t$record=$cn->selectdb(\"SELECT * FROM tbl_video_category where cat_id=\".$catid.\"\");\n\t//echo \"select cat_id,cat_name,cat_parent_id from tbl_category where cat_id=\".$catid.\"\";\n\tif(dbNumRows($record)>0)\n\t{\n\t\t$sitemap=\"\";\n\t\twhile($row2 = dbFetchAssoc($record)) \n\t\t{\n\t\t\textract($row2);\n\t\t\t//$sitemap = $sitemap.$cat_name.\">>\";\n\t\t\t//$sitemap = $cat_name.\">>\".$sitemap;\n\t\t\t$sitemap = \"<a href='maingallery.php?id=\".$cat_id.\"' style='text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;color:#310101'>\".$cat_name.\"</a>\".\" » \".$sitemap;\n\t\t\tif($cat_parent_id!=0)\n\t\t\t{\n\t\t\t\tgetparentVideo($cat_parent_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t}\n\t\t\techo $sitemap;\n\t\t}\n\t}\n}",
"function get_top_parent_ID($id){\n\t$page = get_page($id);\n\t$id = $page->post_parent;\n\t$parent = get_page($id);\n\t\n\tif ($parent->post_parent == 0){\n\t\treturn $id;\n\t}\n\telse{\n\t\treturn get_top_parent_ID($id);\n\t}\n}"
] | [
"0.66096365",
"0.66088873",
"0.66088873",
"0.6501534",
"0.6483397",
"0.6426884",
"0.64138013",
"0.63204235",
"0.62081325",
"0.616778",
"0.61429715",
"0.6059597",
"0.6059597",
"0.6053329",
"0.60448045",
"0.5935197",
"0.5935197",
"0.5935197",
"0.5935197",
"0.5935197",
"0.5935197",
"0.5935197",
"0.59143215",
"0.5904429",
"0.5895323",
"0.58863926",
"0.58786505",
"0.5877364",
"0.5843821",
"0.5837051",
"0.5836666",
"0.5824933",
"0.58016264",
"0.5744688",
"0.5704069",
"0.5702646",
"0.5678969",
"0.5677722",
"0.5676338",
"0.5672589",
"0.5672589",
"0.56607556",
"0.5658755",
"0.564673",
"0.56246173",
"0.56195563",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.5613282",
"0.56061995",
"0.5579172",
"0.5579151",
"0.5572993",
"0.5566318",
"0.55574936",
"0.55574715",
"0.5556617",
"0.55560124",
"0.5553877",
"0.55495876",
"0.55427307",
"0.5541537",
"0.55302775",
"0.5529406",
"0.5527891",
"0.5520902",
"0.5519741",
"0.5515455",
"0.55016106",
"0.54971594",
"0.5496771",
"0.5486886",
"0.5471072",
"0.5471072",
"0.5471072",
"0.54683095",
"0.54670465",
"0.5457921",
"0.54569566",
"0.54425794",
"0.5437324",
"0.54324025",
"0.54321665",
"0.5431657",
"0.5426577",
"0.5423189",
"0.54198605",
"0.54193914",
"0.5419159",
"0.540948",
"0.5402523",
"0.53988093",
"0.539601",
"0.53925073"
] | 0.0 | -1 |
PHP will fatal error if we attempt to use the DateTime class without this being set. | public function getEventsAction() {
date_default_timezone_set ( 'UTC' );
// Short-circuit if the client did not give us a date range.
if (! isset ( $_GET ['start'] ) || ! isset ( $_GET ['end'] )) {
die ( "Please provide a date range." );
}
// Parse the start/end parameters.
// These are assumed to be ISO8601 strings with no time nor timezone, like "2013-12-29".
// Since no timezone will be present, they will parsed as UTC.
$range_start = Object\Shift::parseDateTime ( $_GET ['start'] );
$range_end = Object\Shift::parseDateTime ( $_GET ['end'] );
$data [] = $range_start->toString ( \Zend_Date::ISO_8601 );
$data [] = $range_end->toString ( \Zend_Date::ISO_8601 );
// Parse the timezone parameter if it is present.
$timezone = null;
if (isset ( $_GET ['timezone'] )) {
$timezone = new DateTimeZone ( $_GET ['timezone'] );
}
// Read and parse our events JSON file into an array of event data arrays.
$json = file_get_contents ( PIMCORE_LAYOUTS_DIRECTORY . '/assets/json/events.json' );
$input_arrays = new Object\Shift\Listing (); // json_decode($json, true);
// Accumulate an output array of event data arrays.
$output_arrays = array ();
foreach ( $input_arrays as $event ) {
// Convert the input array into a useful Event object
// $event2 = Object\Shift::create($event->toArray());
// $event2->setKey(Pimcore_File::getValidFilename('New Name 10'));
// $event2->setParentId(53);
// $event2->save();
// $output_arrays['new'] = $event2 ;
// $data[]= $event->getEnd()->toString(\Zend_Date::ISO_8601);
// If the event is in-bounds, add it to the output
if ($event->isWithinDayRange ( $range_start, $range_end )) {
$output_arrays [] = $event->toCalendar ();
}
}
// Send JSON to the client.
$reponse = new Reponse ();
$reponse->data = $output_arrays; // $input_arrays;
$reponse->message = "TXT_SHIFTS_SENT";
$reponse->success = true;
$this->render ( $reponse );
// echo json_encode($output_arrays);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDatetimeSetCorrectly()\n {\n $property = $this->logger_reflection->getProperty('datetime');\n $property->setAccessible(TRUE);\n\n $this->assertInstanceOf('Lunr\\Core\\DateTime', $property->getValue($this->logger));\n }",
"public function load_calendar_datetime()\n\t{\n\t\tif ( ! class_exists('Calendar_datetime'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.datetime.php';\n\t\t}\n\n\t\tif (! isset($this->CDT))\n\t\t{\n\t\t\t$this->CDT = new Calendar_datetime();\n\t\t\t$this->first_day_of_week = $this->get_first_day_of_week();\n\t\t}\n\t}",
"protected function setUpFakeDateTime()\n {\n $date = null;\n if (method_exists($this, 'fakeDateTime')) {\n $date = $this->fakeDateTime();\n } elseif (property_exists($this, 'fakeDateTime')) {\n $date = $this->fakeDateTime;\n }\n\n if (is_int($date)) {\n $date = Carbon::createFromTimestamp($date);\n }\n\n if (is_string($date)) {\n $date = Carbon::parse($date);\n }\n\n if ($date instanceof DateTimeInterface) {\n Carbon::setTestNow($date);\n }\n }",
"public function setUseDateTime($use_datetime) \n \t{\n \t\t$this->use_datetime = $use_datetime;\n \t}",
"public function testDateTime()\n {\n // Add a mostly dummy configuration. We are not going to read or write any files here.\n // The important part is the accessors part.\n $config = new Config([\n 'inputFile' => null,\n 'outputDir' => null,\n 'constructorParamsDefaultToNull' => true,\n ]);\n $complexType = new ComplexType($config, 'ComplexTypeTestClass');\n $complexType->addMember('dateTime', 'dateTimeAttribute', false);\n\n $this->generateClass($complexType);\n\n $this->assertClassExists('ComplexTypeTestClass');\n\n $this->assertClassHasAttribute('dateTimeAttribute', 'ComplexTypeTestClass');\n $this->assertClassHasMethod('ComplexTypeTestClass', 'getDateTimeAttribute');\n $this->assertClassHasMethod('ComplexTypeTestClass', 'setDateTimeAttribute');\n\n $object = new \\ComplexTypeTestClass(new \\DateTime());\n $class = new \\ReflectionClass($object);\n $this->assertMethodParameterHasType($class->getConstructor(), 'dateTimeAttribute', 'DateTime');\n $this->assertMethodParameterDocBlockHasType($class->getConstructor(), 'dateTimeAttribute', '\\DateTime');\n\n $this->assertMethodHasReturnType($class->getMethod('getDateTimeAttribute'), '\\DateTime');\n $this->assertMethodParameterHasType($class->getMethod('setDateTimeAttribute'), 'dateTimeAttribute', 'DateTime');\n $this->assertMethodParameterDocBlockHasType(\n $class->getMethod('setDateTimeAttribute'),\n 'dateTimeAttribute',\n '\\DateTime'\n );\n\n // Using reflection to set up bad datetime value as like SoapClass does it\n $property = 'dateTimeAttribute';\n $badDateTime = 'noDate';\n $this->setObjectProperty($object, $property, $badDateTime);\n $this->assertFalse($object->getDateTimeAttribute());\n\n // Test passing variable datetime formats available in SOAP, http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dateTime\n $now = new \\DateTime();\n foreach (['Y-m-d\\TH:i:s', 'Y-m-d\\TH:i:sP', 'Y-m-d\\TH:i:s.u', 'Y-m-d\\TH:i:s.uP', 'Y-m-d\\TH:i:s\\Z', 'Y-m-d\\TH:i:s.u\\Z'] as $format) {\n $this->setObjectProperty($object, $property, $now->format($format));\n $this->assertInstanceOf('\\DateTime', $object->getDateTimeAttribute());\n }\n }",
"function now() {\n return new DateTime();\n}",
"public function nowMutable(): \\DateTime;",
"public static function get_datetime_object( $datetime = NULL, $server = false )\n {\n return new \\DateTime( $datetime, self::get_timezone_object( $server ) );\n }",
"public function isDateTime();",
"protected function _load_cdt()\n\t{\n\t\tif ( ! class_exists('Calendar'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'mod.calendar.php';\n\t\t}\n\n\t\tif ( ! class_exists('Calendar_datetime'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.datetime.php';\n\t\t}\n\n\t\tif ($this->CDT === FALSE)\n\t\t{\n\t\t\t$this->CDT = new Calendar_datetime;\n\t\t}\n\t}",
"function ___init () { if ( isset ( $this->glob->config['website']['time-zone'] ) )\r\n $this->glob->date = new DateTime ( null, new DateTimeZone ( $this->glob->config['website']['time-zone'] ) ) ;\r\n else // No? Just use the server's time-zone\r\n $this->glob->date = new DateTime ( null ) ;\r\n\r\n $this->_register_resource ( XS_MODULE, '_api/modules/datetime' ) ;\r\n \r\n }",
"public function __construct()\n {\n $this->createdAt = new \\DateTime();\n }",
"public function __construct()\n {\n $this->createdAt = new \\DateTime();\n }",
"public function getAsDateTime() {}",
"public static function getCurrentDate(): DateTime\n\t{\n\t\treturn new DateTime();\n\t}",
"public function toDateTime() : DateTimeInterface\n {\n if (!is_int($this->y) || !is_int($this->m) || !is_int($this->d)) {\n throw new \\LogicException('DateTime can not be created from incompletely populated DateTimeData.');\n }\n\n $datetime = new DateTime();\n $datetime->setTimezone($this->timezone);\n $datetime->setDate($this->y, $this->m, $this->d);\n $datetime->setTime(0, 0, 0);\n\n if (is_int($this->h) && is_int($this->i) && is_int($this->s)) {\n $datetime->setTime($this->h, $this->i, $this->s);\n }\n\n return $datetime;\n }",
"public function testConstructAcceptsDateTimeDateApplied()\n\t{\n\t\t$dateApplied = new \\DateTime('-1 day');\n\t\t$timeSheetStatusChange = new TimeSheetStatusChange('open', $dateApplied);\n\t\t\n\t\t$this->assertSame($dateApplied, $timeSheetStatusChange->getDateApplied());\n\t}",
"public function toDateTime(&$value = false)\n {\n try{\n $value = (\\DateTime)$value;\n }\n catch(\\Exception $e){\n $value = new \\DateTime('0');\n }\n }",
"public function testConstructor()\n {\n $string = '2017-03-29T12:18:00+03:00';\n $dateTime = new DateTime($string);\n $this->assertEquals($string, (string) $dateTime);\n }",
"public function setDateTime($value) {\n\t\t$this->datetime = $value;\n\t}",
"public function __clone() /*: void*/\n {\n $this->frozen = false;\n // \\DateTime has no __clone() method in PHP 7.0.\n //parent::__clone();\n }",
"public function __construct()\n {\n // Observe o \\ antes da chamada da classe\n // Pois como DateTime é na nativa do PHP\n // não tem namespace\n $this->data_cli = new \\DateTime();\n }",
"function current_datetime()\n {\n }",
"public function Func(){\n\t\t$dt = new DateTime();\t\t\n\t\t\n\t\treturn $dt;\n\t}",
"public function getDissolutionDate(): ?\\DateTime;",
"public function curDateTime() {\r\n return new DateTime();\r\n }",
"public static function getCurrentDate()\n\t{\n\t\treturn new \\Bitrix\\Main\\Type\\DateTime();\n\t}",
"public function getDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('dateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'dateTime'\");\n }",
"public function __construct(DateTime $datum) {\r\n\t\t$this->_datum = $datum;\r\n\t}",
"private function _getDateTime()\r\n\t\t{\r\n\t\t\t\treturn getDateTime('%Y-%m-%d %H:%M:%S');\r\n\t\t}",
"public function __construct()\n {\n $this->created = new \\DateTime();\n }",
"public function setDate($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"function util_datetime()\n{\n\t\treturn date(\"Y-m-d H:i:s\");\n}",
"public function __construct()\n {\n $this->created_at = new \\Datetime();\n }",
"function __construct() {\n $this->day = strtolower(date('l')); // monday, tuesday ....\n //$this->day = 'monday';\n //$this->day = $url;\n \n $ltime = localtime();\n $this->time = ($ltime[2] * 60 * 60) + ($ltime[1] * 60) + $ltime[0]; // seconds past in day\n $ltime = null;\n \n //$utc = new DateTime(NULL, new DateTimeZone('UTC'));\n //$utc->setDate(1985, 1, 22);\n //$this->UTCday = $utc->getTimestamp();\n }",
"public function getFoundingDate(): ?\\DateTime;",
"public function setDate($year, $month, $day) : \\DateTime /*self invariant - PHP8:static*/\n {\n if ($this->frozen) {\n throw new \\RuntimeException(get_class($this) . ' is read-only, frozen.');\n }\n return parent::setDate($year, $month, $day);\n }",
"public function getDate($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"public function __construct(\n public string $dateTime ,\n public string $timezone ,\n )\n {\n }",
"public function getIssueDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('issueDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'issueDateTime'\");\n }",
"public function getPhpDatetime()\r\n {\r\n return new \\DateTime($this->format(self::MASK_TIMESTAMP_DB) . '.000000 UTC');\r\n }",
"private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}",
"public function stdWrap_dateDataProvider() {}",
"function set_datetime($date)\n{\n return date(\"Y-m-d H:i:s\", strtotime($date));\n}",
"public function testDateTimeConvertsToPHPValue(): void\n {\n $date = $this->type->convertToPHPValue('1985-09-01 00:00:00', $this->platform);\n self::assertInstanceOf(DateTime::class, $date);\n self::assertEquals('1985-09-01 00:00:00', $date->format('Y-m-d H:i:s'));\n }",
"public function getRequestedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('requestedDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'requestedDateTime'\");\n }",
"public function testTouch_DateTime()\n {\n \tif (!class_exists('DateTime')) $this->markTestSkipped(\"DateTime is not available.\");\n \tfilemtime($this->file); // Stat cache\n \t\n \t$this->Fs_Node->touch(new DateTime('2009-01-01 12:00:00'), new DateTime('2009-01-01 18:00:00'));\n \t$this->assertEquals('2009-01-01 12:00:00', date('Y-m-d H:i:s', filemtime($this->file)));\n \t$this->assertEquals('2009-01-01 18:00:00', date('Y-m-d H:i:s', fileatime($this->file)));\n }",
"public function testDatetime() {\n $time = mktime(16, 35, 0, 2, 26, 1988);\n\n $this->assertEquals('02/26/1988 04:35PM', Format::datetime($time));\n }",
"public function __construct()\n {\n\n $this->begindatum = new \\DateTime();\n $this->einddatum = new \\DateTime();\n\n }",
"public function setByDateTime(\\DateTime $dateTime) {}",
"protected function setUp()\n {\n $format = new HttpDateFormat(-540);\n $time = new Timestamp(2012, 5, 21, 8, 34, 45);\n $this->object = new HttpDate(\"Last-Modified\", $time, $format);\n }",
"public function __construct($datetime = null)\n {\n if(!is_null($datetime))\n {\n // Break into parts\n $parts = preg_split('/[T ]/', $datetime);\n\n $this->date = new Date($parts[0]);\n $this->time = new Time($parts[1]);\n }\n else\n {\n $this->date = new Date();\n $this->time = new Time();\n }\n }",
"public function getUseDateTime() \n \t{\n \t\treturn $this->use_datetime;\n \t}",
"public function setDateTime($value)\n {\n $this->createdAt=$value;\n }",
"public function GetDateTime() {\n return $this->DateTime;\n }",
"protected function getForm_Type_DatetimeService()\n {\n @trigger_error('The \"form.type.datetime\" service is deprecated since Symfony 3.1 and will be removed in 4.0.', E_USER_DEPRECATED);\n\n return $this->services['form.type.datetime'] = new \\Symfony\\Component\\Form\\Extension\\Core\\Type\\DateTimeType();\n }",
"public function GetAsDateTime(){\r\n\t\t\treturn new DateTime( $this->GetAsMySQLDateTime() );\r\n\t\t}",
"public function getDefaultBirthdate(): \\DateTimeInterface|null;",
"public function getDatetime();",
"public function getEffectiveDate(): DateTimeInterface;",
"public function getRequestDateTime()\n {\n if (array_key_exists(\"requestDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"requestDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"requestDateTime\"])) {\n return $this->_propDict[\"requestDateTime\"];\n } else {\n $this->_propDict[\"requestDateTime\"] = new \\DateTime($this->_propDict[\"requestDateTime\"]);\n return $this->_propDict[\"requestDateTime\"];\n }\n }\n return null;\n }",
"public function getStartingDay() : \\DateTime{\n return new \\DateTime(\"{$this->year}-{$this->month}-01\");\n}",
"public function testSetDateValidationTp() {\n\n // Set a Date/time mock.\n $dateValidationTp = new DateTime(\"2018-09-10\");\n\n $obj = new Collaborateurs();\n\n $obj->setDateValidationTp($dateValidationTp);\n $this->assertSame($dateValidationTp, $obj->getDateValidationTp());\n }",
"public function now(): \\DateTimeImmutable;",
"public function now(): \\DateTimeImmutable;",
"public function now(): \\DateTimeImmutable;",
"public function testDateConvertsToPHPValue()\n {\n $this->assertInstanceOf('\\DateTime', $this->_type->convertToPHPValue('1985-09-01'));\n }",
"public function __construct($dateTime = null) {\r\n \r\n if(is_object($dateTime))\r\n { \r\n // maybe DateTimeUtil::dateNull -> new DateTime Object\r\n $this->parmDateTime($dateTime);\r\n }\r\n else\r\n {\r\n if($dateTime != null)\r\n {\r\n $this->parmDate($dateTime); \r\n $this->parmTime($dateTime); \r\n $this->parmDateTime($dateTime); \r\n } \r\n else\r\n {\r\n $this->parmDate($this->curDateTime()->format(self::datePattern));\r\n $this->parmTime($this->curDateTime()->format(self::timePattern));\r\n $this->parmDateTime($this->curDateTime()->format(self::dateTimePattern));\r\n }\r\n }\r\n }",
"public static function dateTimeNoMicroseconds(string $datetime): ?DateTime {\n // If the format is Y-m-d\\TH:i:s.u\\Z, the length will be 27 characters and\n // the last eight should be striped to remove microseconds.\n if (strlen($datetime) == 27) {\n $datetime = substr($datetime, 0, -8) . 'Z';\n }\n try {\n $object = new DateTime($datetime);\n }\n catch (Exception $e) {\n $object = NULL;\n }\n return $object;\n }",
"public static function setDateTimeClassName(string $className)\n {\n if (!class_exists($className)) {\n throw new InvalidArgumentException($className . ' does not exist');\n }\n\n self::$_dateTimeClassName = $className;\n }",
"public function __construct()\n {\n $this->date = new \\DateTime();\n $this->earliestbookingdate = new \\DateTime();\n }",
"public function test_datefield_gets_converted_to_ar_datetime()\n {\n $author = Author::first();\n $author->some_date = new DateTime();\n $author->save();\n\n $author = Author::first();\n $this->assertInstanceOf('ActiveRecord\\\\DateTime', $author->some_date);\n }",
"public function serverDateTime()\n\t{\n\t\treturn new \\DateTime('now', new \\DateTimezone(date_default_timezone_get()));\n\t}",
"public function testSetSignDate() {\n\n // Set a Date/time mock.\n $signDate = new DateTime(\"2018-09-10\");\n\n $obj = new AttestationCacm();\n\n $obj->setSignDate($signDate);\n $this->assertSame($signDate, $obj->getSignDate());\n }",
"public function testSetDateAdded() {\n\n // Set a Date/time mock.\n $dateAdded = new DateTime(\"2018-09-10\");\n\n $obj = new iSessions();\n\n $obj->setDateAdded($dateAdded);\n $this->assertSame($dateAdded, $obj->getDateAdded());\n }",
"public function setStartDateTime($startDateTime = null)\n {\n if (!$startDateTime instanceof \\DateTime) {\n throw new \\InvalidArgumentException(\n sprintf(\n '\"%s\" is not an instance of DateTime but an %s',\n $startDateTime,\n is_object($startDateTime) ? get_class($startDateTime) : gettype($startDateTime)\n )\n );\n }\n $this->startDateTime = $startDateTime;\n }",
"private function toDateTime($string)\n\t{\n\t\tif ($dateTime = date_create($string)) {\n\t\t\treturn $dateTime;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function modifySafely(string $modify) : Time /*PHP8:static*/\n {\n if ($this->frozen) {\n throw new \\RuntimeException(get_class($this) . ' is read-only, frozen.');\n }\n $modified = $this->modify($modify);\n if (($modified instanceof \\DateTime)) {\n return $this;\n }\n throw new \\InvalidArgumentException('Arg modify[' . $modify . '] is invalid.');\n }",
"public function SetFromDateTime( DateTime $date_time ){\r\n\t\t\t$this->SetFromTimestamp( $date_time->format( 'U' ) );\r\n\t\t}",
"public function getAvailabilityStartDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('availabilityStartDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'availabilityStartDateTime'\");\n }",
"public function getTakenDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('takenDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'takenDateTime'\");\n }",
"static function checkDatetime($datetime)\n\t{\n\t\tdate_default_timezone_set('UTC');\n\t\t$format = 'Y-m-d H:i:s';\n\t\t\n\t\t$d = DateTime::createFromFormat($format, $datetime);\n\t\treturn $d && $d->format($format) == $datetime;\n\t}",
"public function hasDate() : bool;",
"public function getCompletionDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('completionDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'completionDateTime'\");\n }",
"public function getNow(): \\DateTimeImmutable;",
"public function setCreatedAt(DateTime $datetime): void;",
"public function getCurrentTime()\n {\n return new \\DateTime();\n }",
"public function __construct(DateTime $dateTime, $homeTeam, $awayTeam, $shortTime){\n //correctly\n $this->dateTime = $dateTime->setTimezone(new \\DateTimeZone(\"UTC\"));\n $this->homeTeam=$homeTeam;\n $this->awayTeam=$awayTeam;\n $this->shortTime=$shortTime;\n }",
"public function getDateTime()\n {\n return $this->dateTime;\n }",
"private function getEmptyStartDate()\n {\n return new \\DotbDateTime('2100-01-01 12:00:00');\n }",
"public function testGetNowDate()\n {\n $viewCounterServiceMock = $this->getMockBuilder(ViewCounter::class)\n ->setConstructorArgs([$this->counterManagerMock, $this->requestStackMock, $this->viewcounterConfigMock])\n ->setMethods(['getPage'])\n ->getMock();\n\n $nowDate = $this->invokeMethod($viewCounterServiceMock, 'getNowDate', []);\n\n $this->assertTrue($nowDate instanceof \\DateTime);\n }",
"public function testSetDateFinUtil() {\n\n // Set a Date/time mock.\n $dateFinUtil = new DateTime(\"2018-09-10\");\n\n $obj = new Materiels();\n\n $obj->setDateFinUtil($dateFinUtil);\n $this->assertSame($dateFinUtil, $obj->getDateFinUtil());\n }",
"public function getReviewedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('reviewedDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'reviewedDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }",
"public function getCreatedDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('createdDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'createdDateTime'\");\n }"
] | [
"0.64267796",
"0.63406694",
"0.62272245",
"0.6214801",
"0.61862636",
"0.6057291",
"0.60356873",
"0.60232806",
"0.6001876",
"0.5997865",
"0.5952149",
"0.59353924",
"0.59353924",
"0.5921118",
"0.5902005",
"0.5861967",
"0.58305806",
"0.5825474",
"0.58052945",
"0.58008504",
"0.5785474",
"0.5765135",
"0.57545286",
"0.57540625",
"0.5737806",
"0.57177335",
"0.5710316",
"0.5705935",
"0.57058126",
"0.5686291",
"0.5641089",
"0.563755",
"0.56237257",
"0.5616273",
"0.56158125",
"0.55970097",
"0.55898535",
"0.55802846",
"0.5579585",
"0.55788535",
"0.5576344",
"0.55737007",
"0.5558681",
"0.5557043",
"0.555164",
"0.5546681",
"0.553563",
"0.5526827",
"0.5525201",
"0.5520496",
"0.55197823",
"0.5506358",
"0.55020547",
"0.54940504",
"0.54742306",
"0.5470107",
"0.54692364",
"0.54649127",
"0.5452067",
"0.5448252",
"0.54466236",
"0.54399574",
"0.5423552",
"0.5418839",
"0.5418839",
"0.5418839",
"0.5414014",
"0.5406041",
"0.54058355",
"0.54048955",
"0.5397222",
"0.5394395",
"0.53917694",
"0.5384804",
"0.5360815",
"0.53514904",
"0.53452355",
"0.5338197",
"0.53376883",
"0.5333512",
"0.532707",
"0.53217334",
"0.5320094",
"0.53193796",
"0.5318905",
"0.53154266",
"0.5314719",
"0.5292226",
"0.528539",
"0.527963",
"0.52749205",
"0.52587664",
"0.5256315",
"0.52476686",
"0.52476686",
"0.52476686",
"0.52476686",
"0.52476686",
"0.52476686",
"0.52476686",
"0.52476686"
] | 0.0 | -1 |
/ Returns the current cache client | public function getCacheClient()
{
if ($this->cacheClient) {
return $this->cacheClient;
}
return $this->cacheClient = new CacheClient($this->cacheConnectionDsn);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClient()\n\t{\n\t\treturn $this->redisClient;\n\t}",
"public function getClient()\n {\n if (!$this->client) {\n $this->client = $this->createClient();\n $this->client->addCache($this->cachePool);\n }\n\n return $this->client;\n }",
"public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}",
"public function getClient() {\n return $this->_get( 'client' );\n }",
"public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }",
"public function getCaching()\n {\n return (!is_null($this->_cache) ? $this->_cache : Cache::instance('redis'));\n }",
"public function getClient()\n\t{\n\t\treturn $this->_client;\n\t}",
"public function getHost() {\n return new Client($this->memcache, $this->shareData[\"host\"]);\n }",
"protected function getCache()\n {\n return $this->cache;\n }",
"public function client()\n {\n return $this->client;\n }",
"public function client()\n {\n return $this->client;\n }",
"function getClient() {\n return $this -> _client;\n }",
"public function getCache()\n {\n return $this->_cache;\n }",
"public function getCache() {\n\n // return our instance of Cache\n return $this->oCache;\n }",
"public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}",
"public function getCache() {\n\t\t$this->sync();\n\t\treturn $this->cache;\n\t}",
"public static function getClient() {\n return self::$client;\n }",
"public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}",
"public function getCache()\n {\n return $this->Cache;\n }",
"public static function getCache()\n {\n return self::$_cache;\n }",
"public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}",
"private function get_client() {\n\t\treturn $this->client;\n\t}",
"private function get_client() {\n\t\treturn $this->client;\n\t}",
"private function get_client() {\n\t\treturn $this->client;\n\t}",
"public static function getClient(){\n $redis=new \\Redis();\n $redis->connect(self::CLIENT_CONF['host'], self::CLIENT_CONF['port']);\n $redis->auth(self::CLIENT_CONF['password']);\n return $redis;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"protected function getClient()\n\t{\n\t\treturn $this->client;\n\t}",
"function getCache() {\n return $this->cache;\n }",
"public function getClient()\n {\n return $this->accessToken->getClient();\n }",
"public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}",
"public function getCache()\n {\n return $this->get('cache', false);\n }",
"public function &getClient()\n\t{\n\t\treturn $this->_client;\n\t}",
"public function getRedisClient()\n {\n if (empty($this->redisClient)) {\n $this->redisClient = new Client($this->redisParams, $this->redisOptions);\n }\n return $this->redisClient;\n }",
"public function getRedisClient( ){\n if( empty( $this->redisHandler ) ){\n $this->redisHandler = new RedisHandler();\n }\n return $this->redisHandler->getConnection();\n }",
"public function getCache()\n\t{\n\t\treturn CacheBot::get($this->getCacheKey(), self::$objectCacheLife);\n\t}",
"public function getCache()\n {\n return Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager')->getCache( 'frontcore' );\n }",
"function getCache() {\n return $this->cache;\n }",
"public function client()\n {\n return $this->connection;\n }",
"public function getCache() {\n if( null === $this->_cache ) {\n $this->_cache = Zend_Cache::factory\n ( $this->_frontend\n , $this->_backend\n , $this->_frontendOptions\n , $this->_backendOptions\n );\n }\n return $this->_cache;\n }",
"public function getCache(): Cache\n {\n return $this->cache;\n }",
"public function getCache() {\n return $this->cache;\n }",
"public function cache()\n {\n return $this->cache;\n }",
"public function cache() {\n\t\treturn $this->_cache;\n\t}",
"public static function client(){\n\t\tif(!self::$client){\n\t\t\tself::$client = new self();\n\t\t}\n\t\treturn self::$client;\n\t}",
"protected function get_cache() {\n\t\n // uncomment next line to flush previous cache\n\t //delete_transient($this->get_cache_id()); \n\t\n \treturn get_transient( $this->get_cache_id() ); \t \n\t}",
"public function getClient(): Client\n {\n return $this->client;\n }",
"public function getClient(): Client\n {\n return $this->client;\n }",
"public function memcached()\n {\n return $this->memcached;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient()\n {\n return $this->client;\n }",
"public function getClient() {\n return $this->client;\n }",
"public function getClient() {\n return $this->client;\n }",
"public function getClient() {\n return $this->client;\n }",
"public function getClient()\n {\n // If the client is a closure, resolve it\n if($this->client instanceof Closure) {\n return $this->client = call_user_func($this->client);\n }\n\n // Return the client\n return $this->client;\n }",
"public function getClient() {\n return $this->client;\n }",
"public function getClient() {\n return $this->client;\n }",
"public function getClient() {\n return $this->client;\n }",
"public static function get($cacheName='_'){\n\t\tif(!isset(self::$_instances[$cacheName]))\n\t\t\tself::$_instances[$cacheName]=CCache::create(self::$_config[$cacheName]);\n\t\treturn self::$_instances[$cacheName];\n\t}",
"static public function getCache(){\n return static::$cache;\n }",
"function App_Cache() {\n\t\t\treturn App_Cache::instance()->getAdapter();\n\t\t}",
"protected function getClient() {\n\n\t\t\tif (!$this->client) {\n\n\t\t\t\t$client = $this->createClient();\n\n\t\t\t\treturn $this->client = $client;\n\t\t\t}\n\n\t\t\treturn $this->client;\n\n\t\t}",
"protected function getClient()\n {\n if ($this->client == null) {\n $this->client = new Client();\n }\n\n return $this->client;\n }",
"public static function getCache()\n\t{\n\t\tif (null === self::$_cache) {\n\t\t\tself::setCache(Zend_Cache::factory(\n\t\t\t\tnew Core_Cache_Frontend_Runtime(),\n\t\t\t\tnew Core_Cache_Backend_Runtime()\n\t\t\t));\n\t\t}\n\t\n\t\treturn self::$_cache;\n\t}",
"protected function _getCache()\n\t{\n\t\t/**\n\t\t * @todo needs to be adjusted for use with Zend_Cache_Manager\n\t\t */\n\t\treturn self::$_cache;\n\n\t}",
"public function getCache()\n\t{\n\t\tif( ! $this->cache_on)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(isset($this->cache_obj))\n\t\t{\n\t\t\treturn $this->cache_obj;\n\t\t}\n\t\t\n\t\t$class = 'Db_Cache_'.$this->cachedrv;\n\t\t\n\t\t$this->cache_obj = new $class($this->cacheopt);\n\t\t\n\t\treturn $this->cache_obj;\n\t}",
"private function getCacheServer()\n {\n /**\n * The configuration options are encapsulated in a class called RedisOptions\n * Here we setup the server configuration using the values from our config file\n */\n $redis_options = new RedisOptions();\n $redis_options->setServer(array(\n 'host' => self::$__endpoint,\n 'port' => self::$__port,\n 'timeout' => self::$__timeout\n ));\n // /**\n // * This is not required, although it will allow to store anything that can be serialized by PHP in Redis\n // */\n // $redis_options->setLibOptions ( array (\n // Redis::OPT_SERIALIZER => Redis::SERIALIZER_PHP\n // ) );\n \n /**\n * We create the cache passing the RedisOptions instance we just created\n */\n $redis_cache = new Redis($redis_options);\n \n return $redis_cache;\n }",
"public static function getCacheManager()\n {\n return static::$cache;\n }",
"protected function getActiveClient()\n\t{\n\n\t\t$method = new \\ReflectionMethod($this, 'getRunningClient');\n\t\t$method->setAccessible(TRUE);\n\n\t\treturn $method->invoke($this);\n\n\t}",
"private function getClient()\n {\n if ($this->client === null) {\n // @codeCoverageIgnoreStart\n $this->setClient(new Client());\n }\n // @codeCoverageIgnoreEnd\n\n return $this->client;\n }",
"public function getCache(): string\n {\n return $this->cache;\n }",
"public function get()\n {\n return Cache::get($this->cacheKey);\n }",
"protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}"
] | [
"0.7260233",
"0.724409",
"0.71030086",
"0.69043005",
"0.682955",
"0.6823672",
"0.6822708",
"0.67673963",
"0.67619896",
"0.6756854",
"0.67511517",
"0.6738703",
"0.6736963",
"0.6727503",
"0.67053026",
"0.6704763",
"0.6696726",
"0.6694915",
"0.6692241",
"0.6680761",
"0.6680061",
"0.6673797",
"0.6673797",
"0.6673797",
"0.666945",
"0.66606176",
"0.66606176",
"0.66606176",
"0.66606176",
"0.66606176",
"0.66606176",
"0.66606176",
"0.6638553",
"0.66369915",
"0.6628295",
"0.66042304",
"0.658533",
"0.65752584",
"0.65698785",
"0.6566192",
"0.65639967",
"0.6562362",
"0.6543105",
"0.6523162",
"0.65211874",
"0.65205264",
"0.65104485",
"0.6490184",
"0.6476523",
"0.6464762",
"0.6442849",
"0.6437812",
"0.6437812",
"0.6428976",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.64143074",
"0.6410955",
"0.6410955",
"0.6410955",
"0.6399567",
"0.639706",
"0.63948804",
"0.63948804",
"0.6390252",
"0.6386085",
"0.63859",
"0.63788176",
"0.6376095",
"0.6367618",
"0.6360971",
"0.63529384",
"0.63473475",
"0.63465154",
"0.6344215",
"0.6343092",
"0.6336611",
"0.63322115",
"0.6330964"
] | 0.80121833 | 0 |
Get the default properties of all feedback | public static function get_default_property_names($extended_property_names = array())
{
return parent::get_default_property_names(array(self::PROPERTY_CONTENT_OBJECT_ID));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_default_properties()\r\n {\r\n return $this->defaultProperties;\r\n }",
"public function getDefaultProperties () {\n return array(\n 'deleted' => 0,\n 'published' => 1,\n 'active' => 1,\n 'only_check_permissions' => 0,\n 'checkCustomPermissions' => 0,\n 'checkByRelatedObjects' => 1,\n 'needCounters' => 0,\n );\n }",
"public function getDefaults();",
"public static function getDefaultVars()\n {\n return [\n 'posts_per_page' => 15,\n 'topics_per_page' => 15,\n 'hot_threshold' => 20,\n 'email_from' => '', // use system default email\n 'url_ranks_images' => \"ranks\",\n 'post_sort_order' => 'ASC',\n 'log_ip' => false,\n 'extendedsearch' => false,\n 'm2f_enabled' => false,\n 'favorites_enabled' => false,\n 'removesignature' => false,\n 'striptags' => false,\n 'hooks' => ['providers' => [], 'subscribers' => []],\n 'rss2f_enabled' => false,\n 'timespanforchanges' => 24,\n 'forum_enabled' => true,\n 'forum_disabled_info' => 'Sorry! The forums are currently off-line for maintenance. Please try later.',\n 'signaturemanagement' => false,\n 'signature_start' => '--',\n 'signature_end' => '--',\n 'showtextinsearchresults' => false,\n 'minsearchlength' => 3,\n 'maxsearchlength' => 30,\n 'fulltextindex' => false,\n 'solved_enabled' => false,\n 'ajax' => false,\n 'striptagsfromemail' => false,\n 'indexTo' => '',\n 'notifyAdminAsMod' => 2,\n 'defaultPoster' => 2,\n 'onlineusers_moderatorcheck' => false,\n 'forum_subscriptions_enabled' => false,\n 'topic_subscriptions_enabled' => false,\n ];\n }",
"public function getDefaults()\n {\n return [\n 'flash' => $this->getFlashMessage('flash'),\n 'success' => $this->get('success'),\n 'validation_errors' => [],\n 'error' => $this->get('error'),\n ];\n }",
"private function getDefaultAttributes()\n {\n return array('lastPhotoId' => '', 'lastActionId' => '', 'lastGroupId' => '', 'lastWebhookId' => '', 'password' => '');\n }",
"protected function getDefaults(){\n\t\treturn array();\n\t}",
"static function get_default_property_names()\r\n {\r\n return array(self :: PROPERTY_COURSE_GROUP, self :: PROPERTY_USER);\r\n }",
"public function getDefaults() {\n\n\t\treturn [\n\t\t\t'module' => $this->_defaultModule,\n\t\t\t'controller' => $this->_defaultController,\n\t\t\t'action' => $this->_defaultAction,\n\t\t\t'params' => $this->_defaultParams\n\t\t];\n\t}",
"protected function defaultAttributes(){\n return [\n 'parentId' => 0, \n 'projectId' => 0, \n 'done' => 0, \n 'potion' => 0, \n 'notes' => array(), \n 'name' => '', \n ];\n }",
"protected function get_default_params() {\n\t\t$defaults = [];\n\t\t$schema = $this->get_public_item_schema();\n\t\tforeach ( $schema['properties'] as $arg => $options ) {\n\t\t\tif ( isset( $options['default'] ) ) {\n\t\t\t\t$defaults[ $arg ] = $options['default'];\n\t\t\t}\n\t\t}\n\t\treturn $defaults;\n\t}",
"public function getDefaultAppearanceData() {}",
"public function getDefaults() {\n\t\treturn $this->_defaults;\n\t}",
"public function defaultSettings()\n\t{\n\t\treturn [\n\t\t\t'notifications' => [\n\t\t\t\t'team_event_create' => 1,\n\t\t\t\t'team_event_update' => 2,\n\t\t\t\t'team_event_delete' => 2,\n\t\t\t\t'team_stats' \t\t=> 1,\n\t\t\t\t'team_post' \t\t=> 1,\n\t\t\t\t'user_post' \t\t=> 2,\n\t\t\t\t'user_stats'\t\t=> 1,\n\t\t\t],\n\t\t];\n\t}",
"private static function get_default_properties()\r\n {\r\n $content_object_alias = RepositoryDataManager :: get_instance()->get_alias(ContentObject :: get_table_name());\r\n \r\n $properties = array();\r\n $properties[] = new GalleryObjectTableProperty(ContentObject :: PROPERTY_TITLE, $content_object_alias);\r\n $properties[] = new GalleryObjectTableProperty(ContentObject :: PROPERTY_DESCRIPTION, $content_object_alias);\r\n return $properties;\r\n }",
"public function getFeedbackStatus()\n {\n return collect(config('constants.feedback_status'));\n }",
"protected function get_default_fee_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}",
"static function get_default_property_names()\n {\n return array(self :: PROPERTY_ID, self :: PROPERTY_NAME, self :: PROPERTY_DESCRIPTION, self :: PROPERTY_BEGIN, self :: PROPERTY_END, self :: PROPERTY_AGREEMENT_ID, self :: PROPERTY_OWNER);\n }",
"public function getDefaultData()\n {\n return $this->predefined;\n }",
"public function getDefaultSettings() {\n $defaults = array();\n $fields = $this->getFields();\n foreach ($fields as $field) {\n $default = '';\n if (array_key_exists('default', $field) && $field['default']) {\n $default = $field['default'];\n }\n $defaults[$field['name']] = $default;\n }\n return $defaults;\n }",
"public function & GetDefaults () {\n\t\treturn $this->defaults;\n\t}",
"public function getDefaults(): array;",
"protected function prepareBasic(): array {\n\t\t\n\t\t$defaults = [\n\t\t\t'title' => '',\n\t\t\t'description' => '',\n\t\t\t'subject' => '',\n\t\t\t'from' => '',\n\t\t\t'access_id' => elgg_get_default_access(null, [\n\t\t\t\t'entity_type' => 'object',\n\t\t\t\t'entity_subtype' => \\Newsletter::SUBTYPE,\n\t\t\t\t'container_guid' => $this->container_guid,\n\t\t\t\t'purpose' => 'read',\n\t\t\t]),\n\t\t\t'tags' => [],\n\t\t\t'container_guid' => $this->container_guid,\n\t\t];\n\t\t\n\t\t// edit?\n\t\tif ($this->entity instanceof \\Newsletter) {\n\t\t\tforeach ($defaults as $name => $value) {\n\t\t\t\t$defaults[$name] = $this->entity->$name;\n\t\t\t}\n\t\t\t\n\t\t\t$defaults['entity'] = $this->entity;\n\t\t}\n\t\t\n\t\t// sticky form\n\t\t$sticky_values = elgg_get_sticky_values('newsletter/edit');\n\t\tif (!empty($sticky_values)) {\n\t\t\tforeach ($sticky_values as $name => $value) {\n\t\t\t\t$defaults[$name] = $value;\n\t\t\t}\n\t\t\t\n\t\t\telgg_clear_sticky_form('newsletter/edit');\n\t\t}\n\t\t\n\t\treturn $defaults;\n\t}",
"public function getDefaultVars() {\n\t\t$ret = array();\n\t\tforeach ($this->_vars as $key => $var) {\n\t\t\t$ret[$key] = $var->defaultValue;\n\t\t}\n\t\treturn $ret;\n\t}",
"protected function get_default() {\n\t\treturn array(\n\t\t\t'ownerID' => 0,\n\t\t\t'accountID' => '',\n\t\t\t'adsenseLinked' => false,\n\t\t\t'adsConversionID' => '',\n\t\t\t'anonymizeIP' => true,\n\t\t\t'internalWebPropertyID' => '',\n\t\t\t'profileID' => '',\n\t\t\t'propertyID' => '',\n\t\t\t'trackingDisabled' => array( 'loggedinUsers' ),\n\t\t\t'useSnippet' => true,\n\t\t\t'canUseSnippet' => true,\n\t\t\t'dashboardView' => Analytics::DASHBOARD_VIEW,\n\t\t);\n\t}",
"public function getMessDefault ()\n {\n return $this->mess_default;\n }",
"public function getExpectedDefaults();",
"public static function getDefaults()\n {\n return [];\n }",
"public function defaultStatKeys()\n {\n \treturn $this->defaultKeys;\n }",
"protected function getDefaultValues() {\n\t\treturn array(\n\t\t\t'name' => '',\n\t\t\t'email' => '',\n\t\t\t'isEnabled' => true);\n\t}",
"public function getGeneralSettingsDefaultData()\n {\n $settings = array(\n 'enabled' => 1,\n 'pull_out' => 1,\n 'display_interval' => 1,\n 'custom_css' => '',\n 'wheel_sound' => 1,\n 'show_fireworks' => 0,\n 'pull_out_image_url' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'vss_spinandwin' . DS . 'gift.png'\n );\n return $settings;\n }",
"public function default_settings() : array {\n\t\treturn [\n\t\t\t'layout' => 'block',\n\t\t\t'newsletter' => '',\n\t\t\t'theme' => 'light',\n\t\t\t'type' => 'subscribe',\n\t\t];\n\t}",
"public function get_default_params()\n {\n }",
"public function GetDefaults ();",
"public static function getDefaults() {\n\t\tglobal $helpful, $post;\n\n\t\t$post_id = $post->ID;\n\t\t$user_id = self::getUser();\n\t\t$credits_html = sprintf(\n\t\t\t'<a href=\"%s\" target=\"_blank\" rel=\"nofollow\">%s</a>',\n\t\t\t$helpful['credits']['url'],\n\t\t\t$helpful['credits']['name']\n\t\t);\n\t\t$defaults = [\n\t\t\t'heading' => self::convertTags( get_option( 'helpful_heading' ), $post_id ),\n\t\t\t'content' => self::convertTags( get_option( 'helpful_content' ), $post_id ),\n\t\t\t'button_pro' => get_option( 'helpful_pro' ),\n\t\t\t'button_contra' => get_option( 'helpful_contra' ),\n\t\t\t'counter' => ( ! get_option( 'helpful_count_hide' ) ),\n\t\t\t'count_pro' => Helpful_Helper_Stats::getPro( $post_id ),\n\t\t\t'count_pro_percent' => Helpful_Helper_Stats::getPro( $post_id, true ),\n\t\t\t'count_contra' => Helpful_Helper_Stats::getContra( $post_id ),\n\t\t\t'count_contra_percent' => Helpful_Helper_Stats::getContra( $post_id, true ),\n\t\t\t'credits' => get_option( 'helpful_credits' ),\n\t\t\t'credits_html' => $credits_html,\n\t\t\t'exists' => ( self::checkUser( $user_id, $post_id ) ? 1 : 0 ),\n\t\t\t'exists_text' => self::convertTags( get_option( 'helpful_exists' ), $post_id ),\n\t\t];\n\n\t\treturn $defaults;\n\t}",
"private function get_defaults() {\n\t\treturn array(\n\t\t\t'phpbb_path' \t\t\t\t=> '',\n\t\t\t'integrateLogin' \t\t\t=> 0, \n\t\t\t'showHdrFtr' \t\t\t\t=> 'NONE',\n\t\t\t'wpSimpleHdr' \t\t\t\t=> 1,\n\t\t\t'dtdSwitch' \t\t\t\t=> 0,\n\t\t\t'phpbbCensor' \t\t\t\t=> 1,\n\t\t\t'wpPageName' \t\t\t\t=> 'page.php',\n\t\t\t'phpbbPadding' \t\t\t\t=> '6-12-6-12',\n\t\t\t'xposting' \t\t\t\t\t=> 0,\n\t\t\t'phpbbSmilies' \t\t\t\t=> 0,\n\t\t\t'avatarsync'\t\t\t\t=> 1,\n\t\t\t'integcreatewp'\t\t\t\t=> 1,\n\t\t\t'integcreatephpbb'\t\t\t=> 1,\n\t\t\t'xpostautolink' \t\t\t=> 0,\n\t\t\t'xpostspam' \t\t\t\t=> 'all',\n\t\t\t'xpostforce' \t\t\t\t=> -1,\n\t\t\t'xposttype' \t\t\t\t=> 'excerpt',\n\t\t\t'xpostprefix'\t\t\t\t=> '[BLOG] ',\n\t\t\t'cssMagic' \t\t\t\t\t=> 1,\n\t\t\t'templateVoodoo' \t\t\t=> 1,\n\t\t\t'useForumPage' \t\t\t\t=> 1\n\t\t);\n\t}",
"public static function getDefaults () {\n\t\t$configuration = array(\n\t\t\t'xtype' => 'textfield',\n\t\t\t'anchor' => '95%',\n\t\t\t'blankText' =>'fieldMandatory',\n\t\t\t'labelSeparator' => '',\n\t\t\t'selectOnFocus' => TRUE,\n\t\t);\n\t\treturn $configuration;\n\t}",
"protected function get_default_settings()\n {\n return [\n 'default' => [\n 'id' => '',\n 'url' => '',\n 'size' => '',\n 'name' => '',\n ],\n ];\n }",
"static function get_default_property_names()\r\n {\r\n return array(self :: PROPERTY_ITEM_ID, self :: PROPERTY_USER_ID);\r\n }",
"public function getFeedbackFields()\n {\n return $this->feedbackFields;\n }",
"protected function getDefaultAtts() {\n \t\t\n \t\treturn array_combine(\n array_map(function($param) { \n \t\treturn $param['param_name'];\n }, $this->params),\n \t\tarray_map(function($param) { \n \t\treturn ! empty( $param['default'] ) ? $param['default'] : '';\n }, $this->params)\n );\n \t\t\n\t\t}",
"public function default()\n {\n return [\n 'remark' => '',\n 'process' => 1,\n ];\n }",
"protected function defaults() {\n\t\treturn array( 'text' => false );\n\t}",
"protected function _getDefaultAttributes()\n {\n return ['entity_type_id', 'attribute_set_id', 'created_at', 'updated_at'];\n }",
"public static function getDefaults()\n\t{\n\t\tglobal $helpful, $post;\n\n\t\t$post_id = $post->ID;\n\t\t$user_id = self::getUser();\n\t\t$credits_html = sprintf(\n\t\t\t'<a href=\"%s\" target=\"_blank\" rel=\"nofollow\">%s</a>',\n\t\t\t$helpful['credits']['url'],\n\t\t\t$helpful['credits']['name']\n\t\t);\n\t\t$defaults = [\n\t\t\t'heading_tag' => 'h3',\n\t\t\t'heading' => self::convertTags( get_option( 'helpful_heading' ), $post_id ),\n\t\t\t'content' => self::convertTags( get_option( 'helpful_content' ), $post_id ),\n\t\t\t'button_pro' => get_option( 'helpful_pro' ),\n\t\t\t'button_contra' => get_option( 'helpful_contra' ),\n\t\t\t'counter' => ( ! get_option( 'helpful_count_hide' ) ),\n\t\t\t'count_pro' => Helpful_Helper_Stats::getPro( $post_id ),\n\t\t\t'count_pro_percent' => Helpful_Helper_Stats::getPro( $post_id, true ),\n\t\t\t'count_contra' => Helpful_Helper_Stats::getContra( $post_id ),\n\t\t\t'count_contra_percent' => Helpful_Helper_Stats::getContra( $post_id, true ),\n\t\t\t'credits' => get_option( 'helpful_credits' ),\n\t\t\t'credits_html' => $credits_html,\n\t\t\t'exists' => self::checkUser( $user_id, $post_id ) ? 1 : 0,\n\t\t\t'exists_text' => self::convertTags( get_option( 'helpful_exists' ), $post_id ),\n\t\t\t'post_id' => $post_id,\n\t\t];\n\n\t\treturn $defaults;\n\t}",
"public function getApplicableAttributes(): array\n {\n return array_keys($this->defaults);\n }",
"protected function get_default_item_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'quantity' => 0,\n\t\t\t'product' => false,\n\t\t\t'price_includes_tax' => false,\n\t\t\t'subtotal' => 0,\n\t\t\t'subtotal_tax' => 0,\n\t\t\t'total' => 0,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}",
"function getDefaultSendParams()\n {\n $params = array();\n\n $params['max_length'] = array(\n 'label' => _(\"Max messages quantity\"),\n 'type' => 'int',\n 'default_value' => 3);\n\n $params['unicode'] = array(\n 'label' => _(\"Unicode message flag\"),\n 'type' => 'int',\n 'default_value' => 1);\n\n return $params;\n }",
"public static function get_element_defaults() {\n\n\t\t\t\treturn [\n\t\t\t\t\t'hide_on_mobile' => fusion_builder_default_visibility( 'string' ),\n\t\t\t\t\t'class' => '',\n\t\t\t\t\t'css_id' => '',\n\t\t\t\t\t'api_params' => '',\n\t\t\t\t\t'autoplay' => 'false',\n\t\t\t\t\t'alignment' => '',\n\t\t\t\t\t'center' => 'no',\n\t\t\t\t\t'height' => 360,\n\t\t\t\t\t'id' => '',\n\t\t\t\t\t'width' => 600,\n\t\t\t\t];\n\t\t\t}",
"private function getDefaultAttributes()\n {\n return [\n 'name' => [\n 'type' => 'varchar',\n 'label' => 'Name',\n 'input' => 'text',\n 'sort_order' => 1,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'is_active' => [\n 'type' => 'int',\n 'label' => 'Is Active',\n 'input' => 'select',\n 'source' => Boolean::class,\n 'sort_order' => 2,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'url_key' => [\n 'type' => 'varchar',\n 'label' => 'URL Key',\n 'input' => 'text',\n 'required' => false,\n 'sort_order' => 3,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'description' => [\n 'type' => 'text',\n 'label' => 'Description',\n 'input' => 'textarea',\n 'required' => false,\n 'sort_order' => 4,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'wysiwyg_enabled' => true,\n 'is_html_allowed_on_front' => true,\n 'group' => 'General',\n ],\n 'image' => [\n 'type' => 'varchar',\n 'label' => 'Image',\n 'input' => 'image',\n 'backend' => Image::class,\n 'required' => false,\n 'sort_order' => 5,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n ];\n }",
"public function get_default_options()\n\t{\n\t\t$defaults = array();\n\t\t$defaults['title'] = '';\n\t\t$defaults['placeholder'] = 'Search Connections...';\n\t\t\n\t\treturn $defaults;\n\t}",
"public function defaultOptions() {\n return $this->default_options;\n }",
"protected function _getDefaultAttributes()\r\n {\r\n return array(\r\n 'entity_type_id',\r\n 'attribute_set_id',\r\n 'created_at',\r\n 'updated_at',\r\n 'increment_id',\r\n 'store_id',\r\n 'website_id'\r\n );\r\n }",
"public function set_behaviors_default_data() {\n\n\t\t$this->is_google_personalize_enabled = 'checked';\n\t\t$this->google_confirmation_title = 'Personalized advertisements';\n\t\t$this->google_confirmation_message = 'Turning this off will opt you out of personalized advertisements delivered from Google on this website.';\n\t\t$this->confirmbutton = 'Confirm';\n\t\t$this->is_email_enabled = 'checked';\n\t\t$this->email_address = '';\n\t\t$this->popup_main_title = 'Do Not Sell My Personal Information';\n\t\t$this->link_text = 'Privacy Policy';\n\t\t$this->link_url = '';\n\t\t$this->privacy_policy_message = 'Exercise your consumer rights by contacting us below';\n\t\t$this->is_phone_enabled = 'checked';\n\t\t$this->phone_number = '';\n\t\t$this->form_link_text = 'Exercise Your Rights';\n\t\t$this->form_link_url = '';\n\t\t$this->form_enable = 'checked';\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\t\t$this->selectuseroption\t\t\t\t = 'All';\n\t\t$this->isIABEnabled \t\t\t\t = 'checked';\n\t\t$this->isLSPAenable \t\t\t\t = '';\n\t}",
"public function getFeedback()\n {\n return $this->feedback;\n }",
"public function get_default_value()\n {\n return [\n 'id' => '',\n 'url' => '',\n 'size' => '',\n 'name' => '',\n ];\n }",
"public function getDisplaySettingsDefaultData()\n {\n $settings = array(\n 'screen_size' => '320_480',\n 'display_frequency' => 1,\n 'hide_after' => 1,\n 'display_position' => 1,\n 'who_to_show' => 'all',\n 'when_to_display' => 'immediately',\n 'time_in_seconds' => 5,\n 'scroll_percent' => 10,\n 'geo_location' => 'always'\n );\n return $settings;\n }",
"protected function getDefaults(): array\n {\n $defaults = [];\n\n foreach ($this->getPropDefs() as $name => $def) {\n if (isset($def['default'])) {\n if ($def['default'] instanceof \\Closure) {\n $defaults[$name] = $def['default']();\n } else {\n $defaults[$name] = $def['default'];\n }\n }\n }\n\n return $defaults;\n }",
"public function getFeedback()\n {\n return $this->_feedback;\n }",
"public function getDefaultValues()\n {\n return [\n 'is_active' => self::STATUS_ENABLED\n ];\n }",
"private function getDefault(){\n\t\treturn array(\n\t\t\t'id' => \t'', \n\t\t\t'name' => \t'',\n\t\t\t'date' => \t'', \n\t\t\t'lvl' => \t'', \n\t\t\t'exp' => \t''\n\t\t);\n\t}",
"protected function getDefaultValues() {\n\t\t$user = Environment::getCurrent()->getUser();\n\t\t\n\t\treturn array(\n\t\t\t'email' => $user->getEmail(),\n\t\t\t'emailConfirmation' => $user->getEmail());\n\t}",
"public static function get_element_defaults() {\n\n\t\t\t\treturn [\n\t\t\t\t\t'class' => '',\n\t\t\t\t\t'id' => '',\n\t\t\t\t\t'link' => '',\n\t\t\t\t];\n\t\t\t}",
"public function getProperties()\n {\n $class = get_called_class();\n $reflection = new \\ReflectionClass($class);\n $members = array_keys($reflection->getdefaultProperties());\n return $members;\n }",
"public static function get_element_defaults() {\n\t\t\t\t$fusion_settings = fusion_get_fusion_settings();\n\t\t\t\treturn [\n\t\t\t\t\t'margin_bottom' => '',\n\t\t\t\t\t'margin_left' => '',\n\t\t\t\t\t'margin_right' => '',\n\t\t\t\t\t'margin_top' => '',\n\t\t\t\t\t'hide_on_mobile' => fusion_builder_default_visibility( 'string' ),\n\t\t\t\t\t'class' => '',\n\t\t\t\t\t'id' => '',\n\t\t\t\t\t'animation_type' => '',\n\t\t\t\t\t'animation_direction' => 'down',\n\t\t\t\t\t'animation_speed' => '0.1',\n\t\t\t\t\t'animation_offset' => $fusion_settings->get( 'animation_offset' ),\n\t\t\t\t];\n\t\t\t}",
"protected function defaultParams()\r\n\t{\r\n\t\treturn array();\r\n\t}",
"protected function defaults() {\n\t\treturn array(\n\t\t\t'content' => false,\n\t\t\t'content_path' => false,\n\t\t\t'markdown' => false,\n\t\t);\n\t}",
"public function getDefaultParams()\n {\n $defaults = array(\n );\n return $defaults;\n }",
"static function get_default_property_names($extended_property_names = array())\r\n {\r\n return array(self :: PROPERTY_COURSE, self :: PROPERTY_USER, self :: PROPERTY_STATUS);\r\n }",
"protected function getDefaultParameters()\n {\n return array(\n 'parser.class' => 'Everzet\\\\Gherkin\\\\Parser',\n 'i18n.class' => 'Everzet\\\\Gherkin\\\\I18n',\n 'event_dispatcher.class' => 'Everzet\\\\Behat\\\\EventDispatcher\\\\EventDispatcher',\n 'event_listeners' => array('formatter'),\n 'formatter.class' => 'Everzet\\\\Behat\\\\Formatter\\\\%formatter.name%Formatter',\n 'step_definition.class' => 'Everzet\\\\Behat\\\\Definition\\\\StepDefinition',\n 'environment.class' => 'Everzet\\\\Behat\\\\Environment\\\\WorldEnvironment',\n 'features_loader.class' => 'Everzet\\\\Behat\\\\Loader\\\\FeaturesLoader',\n 'steps_loader.class' => 'Everzet\\\\Behat\\\\Loader\\\\StepsLoader',\n );\n }",
"public static function get_element_defaults() {\n\n\t\t\t$fusion_settings = fusion_get_fusion_settings();\n\n\t\t\treturn [\n\t\t\t\t'admin_label' => '',\n\t\t\t\t'is_nested' => '0', // Variable that simply checks if the current container is a nested one (e.g. from FAQ or blog element).\n\t\t\t\t'hide_on_mobile' => fusion_builder_default_visibility( 'string' ),\n\t\t\t\t'id' => '',\n\t\t\t\t'class' => '',\n\t\t\t\t'status' => 'published',\n\t\t\t\t'publish_date' => '',\n\t\t\t\t// Background.\n\t\t\t\t'background_color' => $fusion_settings->get( 'full_width_bg_color' ),\n\t\t\t\t'gradient_start_color' => $fusion_settings->get( 'full_width_gradient_start_color' ),\n\t\t\t\t'gradient_end_color' => $fusion_settings->get( 'full_width_gradient_end_color' ),\n\t\t\t\t'gradient_start_position' => '0',\n\t\t\t\t'gradient_end_position' => '100',\n\t\t\t\t'gradient_type' => 'linear',\n\t\t\t\t'radial_direction' => 'center',\n\t\t\t\t'linear_angle' => '180',\n\t\t\t\t'background_image' => '',\n\t\t\t\t'background_position' => 'center center',\n\t\t\t\t'background_repeat' => 'no-repeat',\n\t\t\t\t'background_parallax' => 'none',\n\t\t\t\t'parallax_speed' => '0.3',\n\t\t\t\t'background_blend_mode' => 'none',\n\t\t\t\t'opacity' => '100',\n\t\t\t\t'break_parents' => '0',\n\t\t\t\t'fade' => 'no',\n\t\t\t\t// Style.\n\t\t\t\t'hundred_percent' => 'no',\n\t\t\t\t'hundred_percent_height' => 'no',\n\t\t\t\t'hundred_percent_height_scroll' => 'no',\n\t\t\t\t'hundred_percent_height_center_content' => 'no',\n\t\t\t\t'padding_bottom' => '',\n\t\t\t\t'padding_left' => '',\n\t\t\t\t'padding_right' => '',\n\t\t\t\t'padding_top' => '',\n\t\t\t\t'border_color' => $fusion_settings->get( 'full_width_border_color' ),\n\t\t\t\t'border_size' => $fusion_settings->get( 'full_width_border_size' ),\n\t\t\t\t'border_style' => 'solid',\n\t\t\t\t'equal_height_columns' => 'no',\n\t\t\t\t'data_bg_height' => '',\n\t\t\t\t'data_bg_width' => '',\n\t\t\t\t'enable_mobile' => 'no',\n\t\t\t\t'menu_anchor' => '',\n\t\t\t\t'margin_top' => '',\n\t\t\t\t'margin_bottom' => '',\n\t\t\t\t'link_color' => $fusion_settings->get( 'link_color' ),\n\t\t\t\t'link_hover_color' => $fusion_settings->get( 'primary_color' ),\n\t\t\t\t// Video Background.\n\t\t\t\t'video_mp4' => '',\n\t\t\t\t'video_webm' => '',\n\t\t\t\t'video_ogv' => '',\n\t\t\t\t'video_loop' => 'yes',\n\t\t\t\t'video_mute' => 'yes',\n\t\t\t\t'video_preview_image' => '',\n\t\t\t\t'overlay_color' => '',\n\t\t\t\t'overlay_opacity' => '0.5',\n\t\t\t\t'video_url' => '',\n\t\t\t\t'video_loop_refinement' => '',\n\t\t\t\t'video_aspect_ratio' => '16:9',\n\t\t\t\t// Filters.\n\t\t\t\t'filter_hue' => '0',\n\t\t\t\t'filter_saturation' => '100',\n\t\t\t\t'filter_brightness' => '100',\n\t\t\t\t'filter_contrast' => '100',\n\t\t\t\t'filter_invert' => '0',\n\t\t\t\t'filter_sepia' => '0',\n\t\t\t\t'filter_opacity' => '100',\n\t\t\t\t'filter_blur' => '0',\n\t\t\t\t'filter_hue_hover' => '0',\n\t\t\t\t'filter_saturation_hover' => '100',\n\t\t\t\t'filter_brightness_hover' => '100',\n\t\t\t\t'filter_contrast_hover' => '100',\n\t\t\t\t'filter_invert_hover' => '0',\n\t\t\t\t'filter_sepia_hover' => '0',\n\t\t\t\t'filter_opacity_hover' => '100',\n\t\t\t\t'filter_blur_hover' => '0',\n\t\t\t];\n\t\t}",
"public function getAvailableProps()\n {\n if(is_object($this->_model_class)) {\n $class = $this->_model_class->className();\n return $class::getReportManagerSettings();\n } else {\n return [];\n }\n }",
"public function defaultKeys() {\n return [\n 'enabled',\n 'url',\n 'severity_level',\n 'environment_uuid',\n ];\n }",
"private static function defaults() {\n\t\treturn array(\n\t\t\t\"before_tweet\" => function($data) {\n\t\t\t\treturn \"\";\n\t\t\t},\n\t\t\t\"after_tweet\" => function($data) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t);\n\t}",
"protected function getDefaultValues() {\n\t\treturn array(\n\t\t\t'name' => $this->getStructureNode()->getName(),\n\t\t\t'title' => $this->getStructureNode()->getTitle());\n\t}",
"public function getLookAndFeelSettingsDefaultData()\n {\n $settings = array(\n 'image_url' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'vss_spinandwin' . DS . 'front_image.png',\n 'try_luck_color' => '00c74c',\n 'try_luck_text_color' => 'ffffff',\n 'feel_lucky_text_color' => 'fffbf8',\n 'continue_color' => 'd6042e',\n 'next_time_color' => 'ff8400',\n 'background_color' => '007aa7',\n 'text_color' => 'ffffff',\n 'wheel_color' => '4497bb',\n 'wheel_text_color' => 'ffffff',\n 'theme' => 0,\n 'wheel_design' => 1\n );\n return $settings;\n }",
"private function getDefaults()\n\t{\n\t\t/* @formatter:off */\n\t\treturn array(\n\t\t\t'cli_codepage' => 'cp852',\n\t\t\t'cookie_file' => dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'SESSION_ID',\n\t\t\t'exit_on' => E_ERROR | E_USER_ERROR,\n\t\t\t'is_debug' => false,\n\n\t\t\t/* Services */\n\t\t\t'api' => 'Orkan\\\\Filmweb\\\\Api\\\\Api',\n\t\t\t'tarnsport' => 'Orkan\\\\Filmweb\\\\Transport\\\\Curl',\n\t\t\t'request' => 'Orkan\\\\Filmweb\\\\Transport\\\\CurlRequest',\n\t\t\t'logger' => 'Orkan\\\\Filmweb\\\\Logger',\n\n\t\t\t/* Hide sensitive log data */\n\t\t\t'logger_mask' => array( 'search' => array( $this->pass ), 'replace' => array( '***' ) ),\n\t\t);\n\t\t/* @formatter:on */\n\t}",
"static function getDefaults($underscore = false)\n {\n return array(\n ($underscore ? 'iptc_headline' : 'iptcHeadline') => 'Untitled',\n ($underscore ? 'iptc_caption' : 'iptcCaption') => 'Caption pending',\n ($underscore ? 'iptc_byline' : 'iptcByline') => 'Author pending',\n ($underscore ? 'iptc_keywords' : 'iptcKeywords') => 'structured;fun',\n ($underscore ? 'iptc_copyright' : 'iptcCopyright') => 'Copyright remains with author, image transformation licence granted to StructuredFun',\n ($underscore ? 'iptc_source' : 'iptcSource') => 'Source pending',\n );\n }",
"protected function get_default_shipping_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'total' => 0,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}",
"protected function getDefaults()\n {\n return $this->transbankConfig->getDefaults(\n lcfirst(Helpers::classBasename(static::class))\n ) ?? [];\n }",
"public static function getDefaultOptions(){\n\n\t\t$options = array(\n\t\t\tWPC_OPTIONS => array(\n\t\t\t\tWPC_OPTIONS_LANGUAGE => 'en_US',\n\t\t\t\tWPC_OPTIONS_THEME => WPC_THEME_LIGHT\n\t\t\t),\n\t\t\tWPC_OPTIONS_COMMENTS => array(\n\t\t\t\tWPC_OPTIONS_COMMENTS_NUMBER => 6,\n\t\t\t\tWPC_OPTIONS_COMMENTS_WIDTH => 480,\n\t\t\t\tWPC_OPTIONS_COMMENTS_POSITION => WPC_CUSTOM_FIELD_VALUE_POSITION_BOTTOM,\n\t\t\t\tWPC_OPTIONS_COMMENTS_ENABLED => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_DISPLAY_EVERYWHERE => 'on',\n\t\t\t\tWPC_OPTIONS_DISPLAY_NOWHERE => ''\n\t\t\t),\n\t\t\tWPC_OPTIONS_LIKE_BUTTON => array(\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_SEND => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_LAYOUT => WPC_LAYOUT_STANDARD,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_WIDTH => 480,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_FACES => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_VERB => WPC_ACTION_LIKE,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_FONT => WPC_FONT_DEFAULT,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_POSITION => WPC_CUSTOM_FIELD_VALUE_POSITION_TOP,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_ENABLED => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_DISPLAY_EVERYWHERE => 'on'\n\t\t\t)\n\t\t);\n\n\t\treturn $options;\n\n\t}",
"public function getDefaultSettings();",
"protected function _getDefaultValues()\n {\n return array(\n );\n }",
"private static function default_options()\n\t{\n\t\t$options = array(\n\t\t\t'jambo__send_to' => $_SERVER['SERVER_ADMIN'],\n\t\t\t'jambo__subject' => _t('[CONTACT FORM] %s', 'jambo'),\n\t\t\t'jambo__show_form_on_success' => 1,\n\t\t\t'jambo__success_msg' => _t('Thank you for your feedback. I\\'ll get back to you as soon as possible.', 'jambo'),\n\t\t\t);\n\t\treturn Plugins::filter('jambo_default_options', $options);\n\t}",
"public function get_props() : array\n {\n return $this->additional['props'] ?? [];\n }",
"private static function default_settings() {\n\t\treturn array(\n\t\t\t'module_ga' => true,\n\t\t\t'module_ip' => true,\n\t\t\t'module_log' => true,\n\t\t\t'sent_data' => false,\n\t\t\t'api_key' => '',\n\t\t\t'mark_as_approved' => true,\n\t\t);\n\t}",
"public function default_data() : array {\n\t\treturn [\n\t\t\t'meta' => [\n\t\t\t\t'title' => '',\n\t\t\t\t'permalink' => '',\n\t\t\t\t'cta_text' => '',\n\t\t\t\t'cta_url' => '',\n\t\t\t],\n\t\t\t'curate' => [\n\t\t\t\t'post_ids' => [],\n\t\t\t],\n\t\t\t'filters' => [\n\t\t\t\t'filter' => [],\n\t\t\t],\n\t\t];\n\t}",
"protected function getDefaultParams()\n {\n return $this->arrDefaultParam;\n }",
"protected function getDefaultParameters()\n {\n return [\n 'core.root_path' => './../',\n 'core.php_ext' => 'php',\n 'core.environment' => 'production',\n 'core.debug' => false,\n 'core.cache_dir' => './../cache/production/',\n 'passwords.driver.argon2_memory_cost' => 1024,\n 'passwords.driver.argon2_threads' => 2,\n 'passwords.driver.argon2_time_cost' => 2,\n 'passwords.driver.bcrypt_cost' => 10,\n 'text_formatter.cache.dir' => './../cache/production/',\n 'text_formatter.cache.parser.key' => '_text_formatter_parser',\n 'text_formatter.cache.renderer.key' => '_text_formatter_renderer',\n 'core.template.cache_path' => './../cache/production/twig/',\n 'tables.acl_groups' => 'phpbb_acl_groups',\n 'tables.acl_options' => 'phpbb_acl_options',\n 'tables.acl_roles' => 'phpbb_acl_roles',\n 'tables.acl_roles_data' => 'phpbb_acl_roles_data',\n 'tables.acl_users' => 'phpbb_acl_users',\n 'tables.attachments' => 'phpbb_attachments',\n 'tables.auth_provider_oauth_token_storage' => 'phpbb_oauth_tokens',\n 'tables.auth_provider_oauth_states' => 'phpbb_oauth_states',\n 'tables.auth_provider_oauth_account_assoc' => 'phpbb_oauth_accounts',\n 'tables.banlist' => 'phpbb_banlist',\n 'tables.bbcodes' => 'phpbb_bbcodes',\n 'tables.bookmarks' => 'phpbb_bookmarks',\n 'tables.bots' => 'phpbb_bots',\n 'tables.captcha_qa_questions' => 'phpbb_captcha_questions',\n 'tables.captcha_qa_answers' => 'phpbb_captcha_answers',\n 'tables.captcha_qa_confirm' => 'phpbb_qa_confirm',\n 'tables.config' => 'phpbb_config',\n 'tables.config_text' => 'phpbb_config_text',\n 'tables.confirm' => 'phpbb_confirm',\n 'tables.disallow' => 'phpbb_disallow',\n 'tables.drafts' => 'phpbb_drafts',\n 'tables.ext' => 'phpbb_ext',\n 'tables.extensions' => 'phpbb_extensions',\n 'tables.extension_groups' => 'phpbb_extension_groups',\n 'tables.forums' => 'phpbb_forums',\n 'tables.forums_access' => 'phpbb_forums_access',\n 'tables.forums_track' => 'phpbb_forums_track',\n 'tables.forums_watch' => 'phpbb_forums_watch',\n 'tables.groups' => 'phpbb_groups',\n 'tables.icons' => 'phpbb_icons',\n 'tables.lang' => 'phpbb_lang',\n 'tables.log' => 'phpbb_log',\n 'tables.login_attempts' => 'phpbb_login_attempts',\n 'tables.migrations' => 'phpbb_migrations',\n 'tables.moderator_cache' => 'phpbb_moderator_cache',\n 'tables.modules' => 'phpbb_modules',\n 'tables.notification_types' => 'phpbb_notification_types',\n 'tables.notifications' => 'phpbb_notifications',\n 'tables.poll_options' => 'phpbb_poll_options',\n 'tables.poll_votes' => 'phpbb_poll_votes',\n 'tables.posts' => 'phpbb_posts',\n 'tables.privmsgs' => 'phpbb_privmsgs',\n 'tables.privmsgs_folder' => 'phpbb_privmsgs_folder',\n 'tables.privmsgs_rules' => 'phpbb_privmsgs_rules',\n 'tables.privmsgs_to' => 'phpbb_privmsgs_to',\n 'tables.profile_fields' => 'phpbb_profile_fields',\n 'tables.profile_fields_data' => 'phpbb_profile_fields_data',\n 'tables.profile_fields_options_language' => 'phpbb_profile_fields_lang',\n 'tables.profile_fields_language' => 'phpbb_profile_lang',\n 'tables.ranks' => 'phpbb_ranks',\n 'tables.reports' => 'phpbb_reports',\n 'tables.reports_reasons' => 'phpbb_reports_reasons',\n 'tables.search_results' => 'phpbb_search_results',\n 'tables.search_wordlist' => 'phpbb_search_wordlist',\n 'tables.search_wordmatch' => 'phpbb_search_wordmatch',\n 'tables.sessions' => 'phpbb_sessions',\n 'tables.sessions_keys' => 'phpbb_sessions_keys',\n 'tables.sitelist' => 'phpbb_sitelist',\n 'tables.smilies' => 'phpbb_smilies',\n 'tables.sphinx' => 'phpbb_sphinx',\n 'tables.styles' => 'phpbb_styles',\n 'tables.styles_template' => 'phpbb_styles_template',\n 'tables.styles_template_data' => 'phpbb_styles_template_data',\n 'tables.styles_theme' => 'phpbb_styles_theme',\n 'tables.styles_imageset' => 'phpbb_styles_imageset',\n 'tables.styles_imageset_data' => 'phpbb_styles_imageset_data',\n 'tables.teampage' => 'phpbb_teampage',\n 'tables.topics' => 'phpbb_topics',\n 'tables.topics_posted' => 'phpbb_topics_posted',\n 'tables.topics_track' => 'phpbb_topics_track',\n 'tables.topics_watch' => 'phpbb_topics_watch',\n 'tables.user_group' => 'phpbb_user_group',\n 'tables.user_notifications' => 'phpbb_user_notifications',\n 'tables.users' => 'phpbb_users',\n 'tables.warnings' => 'phpbb_warnings',\n 'tables.words' => 'phpbb_words',\n 'tables.zebra' => 'phpbb_zebra',\n 'core.disable_super_globals' => true,\n 'datetime.class' => '\\\\phpbb\\\\datetime',\n 'mimetype.guesser.priority.lowest' => -2,\n 'mimetype.guesser.priority.low' => -1,\n 'mimetype.guesser.priority.default' => 0,\n 'mimetype.guesser.priority.high' => 1,\n 'mimetype.guesser.priority.highest' => 2,\n 'passwords.algorithms' => [\n 0 => 'passwords.driver.argon2id',\n 1 => 'passwords.driver.argon2i',\n 2 => 'passwords.driver.bcrypt_2y',\n 3 => 'passwords.driver.bcrypt',\n 4 => 'passwords.driver.salted_md5',\n 5 => 'passwords.driver.phpass',\n ],\n 'allow_install_dir' => false,\n 'debug.exceptions' => false,\n 'debug.load_time' => false,\n 'debug.sql_explain' => false,\n 'debug.memory' => false,\n 'debug.show_errors' => false,\n 'session.log_errors' => false,\n 'tables' => [\n 'acl_groups' => 'phpbb_acl_groups',\n 'acl_options' => 'phpbb_acl_options',\n 'acl_roles' => 'phpbb_acl_roles',\n 'acl_roles_data' => 'phpbb_acl_roles_data',\n 'acl_users' => 'phpbb_acl_users',\n 'attachments' => 'phpbb_attachments',\n 'auth_provider_oauth_token_storage' => 'phpbb_oauth_tokens',\n 'auth_provider_oauth_states' => 'phpbb_oauth_states',\n 'auth_provider_oauth_account_assoc' => 'phpbb_oauth_accounts',\n 'banlist' => 'phpbb_banlist',\n 'bbcodes' => 'phpbb_bbcodes',\n 'bookmarks' => 'phpbb_bookmarks',\n 'bots' => 'phpbb_bots',\n 'captcha_qa_questions' => 'phpbb_captcha_questions',\n 'captcha_qa_answers' => 'phpbb_captcha_answers',\n 'captcha_qa_confirm' => 'phpbb_qa_confirm',\n 'config' => 'phpbb_config',\n 'config_text' => 'phpbb_config_text',\n 'confirm' => 'phpbb_confirm',\n 'disallow' => 'phpbb_disallow',\n 'drafts' => 'phpbb_drafts',\n 'ext' => 'phpbb_ext',\n 'extensions' => 'phpbb_extensions',\n 'extension_groups' => 'phpbb_extension_groups',\n 'forums' => 'phpbb_forums',\n 'forums_access' => 'phpbb_forums_access',\n 'forums_track' => 'phpbb_forums_track',\n 'forums_watch' => 'phpbb_forums_watch',\n 'groups' => 'phpbb_groups',\n 'icons' => 'phpbb_icons',\n 'lang' => 'phpbb_lang',\n 'log' => 'phpbb_log',\n 'login_attempts' => 'phpbb_login_attempts',\n 'migrations' => 'phpbb_migrations',\n 'moderator_cache' => 'phpbb_moderator_cache',\n 'modules' => 'phpbb_modules',\n 'notification_types' => 'phpbb_notification_types',\n 'notifications' => 'phpbb_notifications',\n 'poll_options' => 'phpbb_poll_options',\n 'poll_votes' => 'phpbb_poll_votes',\n 'posts' => 'phpbb_posts',\n 'privmsgs' => 'phpbb_privmsgs',\n 'privmsgs_folder' => 'phpbb_privmsgs_folder',\n 'privmsgs_rules' => 'phpbb_privmsgs_rules',\n 'privmsgs_to' => 'phpbb_privmsgs_to',\n 'profile_fields' => 'phpbb_profile_fields',\n 'profile_fields_data' => 'phpbb_profile_fields_data',\n 'profile_fields_options_language' => 'phpbb_profile_fields_lang',\n 'profile_fields_language' => 'phpbb_profile_lang',\n 'ranks' => 'phpbb_ranks',\n 'reports' => 'phpbb_reports',\n 'reports_reasons' => 'phpbb_reports_reasons',\n 'search_results' => 'phpbb_search_results',\n 'search_wordlist' => 'phpbb_search_wordlist',\n 'search_wordmatch' => 'phpbb_search_wordmatch',\n 'sessions' => 'phpbb_sessions',\n 'sessions_keys' => 'phpbb_sessions_keys',\n 'sitelist' => 'phpbb_sitelist',\n 'smilies' => 'phpbb_smilies',\n 'sphinx' => 'phpbb_sphinx',\n 'styles' => 'phpbb_styles',\n 'styles_template' => 'phpbb_styles_template',\n 'styles_template_data' => 'phpbb_styles_template_data',\n 'styles_theme' => 'phpbb_styles_theme',\n 'styles_imageset' => 'phpbb_styles_imageset',\n 'styles_imageset_data' => 'phpbb_styles_imageset_data',\n 'teampage' => 'phpbb_teampage',\n 'topics' => 'phpbb_topics',\n 'topics_posted' => 'phpbb_topics_posted',\n 'topics_track' => 'phpbb_topics_track',\n 'topics_watch' => 'phpbb_topics_watch',\n 'user_group' => 'phpbb_user_group',\n 'user_notifications' => 'phpbb_user_notifications',\n 'users' => 'phpbb_users',\n 'warnings' => 'phpbb_warnings',\n 'words' => 'phpbb_words',\n 'zebra' => 'phpbb_zebra',\n ],\n 'core.adm_relative_path' => 'adm/',\n 'core.table_prefix' => 'phpbb_',\n 'cache.driver.class' => 'phpbb\\\\cache\\\\driver\\\\file',\n 'dbal.new_link' => false,\n ];\n }",
"public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}",
"public function properties() {\n $properties = clone($this->properties);\n if ($this->answers === null) {\n $this->get_answers();\n }\n if (count($this->answers)>0) {\n $count = 0;\n foreach ($this->answers as $answer) {\n $properties->{'answer_editor['.$count.']'} = array('text'=>$answer->answer, 'format'=>$answer->answerformat);\n $properties->{'response_editor['.$count.']'} = array('text'=>$answer->response, 'format'=>$answer->responseformat);\n $properties->{'jumpto['.$count.']'} = $answer->jumpto;\n $properties->{'score['.$count.']'} = $answer->score;\n $count++;\n }\n }\n return $properties;\n }",
"public function getProductDefaults()\n {\n $defaults = $this->_config->get('product_defaults');\n\n if (is_array($defaults)) {\n return $defaults;\n }\n\n return [];\n }",
"public function getDefaultAttributes()\n {\n return array_unique(array_merge($this->_getDefaultAttributes(), [$this->getEntityIdField(), $this->getLinkField()]));\n }",
"public static function getDefaultVars(){\n\t\treturn Array(\n\t\t\t//--whether to output debug messages for this class\n\t\t\t'debug'=> false\n\t\t\t,'contentRelativePath'=> '_content'\n\t\t\t,'host'=> ($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['PWD']\n\t\t\t,'webRoot'=> ($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $_SERVER['PWD']\n\t\t\t,'wpRelativePath'=> '_wp'\n\t\t\t,'protocol'=> (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'https' : 'http'\n\t\t);\n\t}",
"protected static function define_other_properties() {\n $attachmentdefinition = stored_file_exporter::read_properties_definition();\n $attachmentdefinition['urls'] = [\n 'type' => [\n 'export' => [\n 'type' => PARAM_URL,\n 'description' => 'The URL used to export the attachment',\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ]\n ]\n ];\n $attachmentdefinition['html'] = [\n 'type' => [\n 'plagiarism' => [\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source for the Plagiarism Response',\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n ]\n ];\n\n return [\n 'id' => ['type' => PARAM_INT],\n 'subject' => ['type' => PARAM_TEXT],\n 'replysubject' => ['type' => PARAM_TEXT],\n 'message' => ['type' => PARAM_RAW],\n 'messageformat' => ['type' => PARAM_INT],\n 'author' => ['type' => author_exporter::read_properties_definition()],\n 'discussionid' => ['type' => PARAM_INT],\n 'hasparent' => ['type' => PARAM_BOOL],\n 'parentid' => [\n 'type' => PARAM_INT,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'timecreated' => ['type' => PARAM_INT],\n 'unread' => [\n 'type' => PARAM_BOOL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'isdeleted' => ['type' => PARAM_BOOL],\n 'isprivatereply' => ['type' => PARAM_BOOL],\n 'haswordcount' => ['type' => PARAM_BOOL],\n 'wordcount' => [\n 'type' => PARAM_INT,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'charcount' => [\n 'type' => PARAM_INT,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'capabilities' => [\n 'type' => [\n 'view' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can view the post',\n ],\n 'edit' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can edit the post',\n ],\n 'delete' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can delete the post',\n ],\n 'split' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can split the post',\n ],\n 'reply' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can reply to the post',\n ],\n 'selfenrol' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can self enrol into the course',\n ],\n 'export' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can export the post',\n ],\n 'controlreadstatus' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can control the read status of the post',\n ],\n 'canreplyprivately' => [\n 'type' => PARAM_BOOL,\n 'null' => NULL_ALLOWED,\n 'description' => 'Whether the user can post a private reply',\n ]\n ]\n ],\n 'urls' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => [\n 'view' => [\n 'description' => 'The URL used to view the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'viewisolated' => [\n 'description' => 'The URL used to view the post in isolation',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'viewparent' => [\n 'description' => 'The URL used to view the parent of the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'edit' => [\n 'description' => 'The URL used to edit the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'delete' => [\n 'description' => 'The URL used to delete the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'split' => [\n 'description' => 'The URL used to split the discussion ' .\n 'with the selected post being the first post in the new discussion',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'reply' => [\n 'description' => 'The URL used to reply to the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'export' => [\n 'description' => 'The URL used to export the post',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'markasread' => [\n 'description' => 'The URL used to mark the post as read',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'markasunread' => [\n 'description' => 'The URL used to mark the post as unread',\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ],\n 'discuss' => [\n 'type' => PARAM_URL,\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED\n ]\n ]\n ],\n 'attachments' => [\n 'multiple' => true,\n 'type' => $attachmentdefinition\n ],\n 'tags' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'multiple' => true,\n 'type' => [\n 'id' => [\n 'type' => PARAM_INT,\n 'description' => 'The ID of the Tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'tagid' => [\n 'type' => PARAM_INT,\n 'description' => 'The tagid',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'isstandard' => [\n 'type' => PARAM_BOOL,\n 'description' => 'Whether this is a standard tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'displayname' => [\n 'type' => PARAM_TEXT,\n 'description' => 'The display name of the tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'flag' => [\n 'type' => PARAM_BOOL,\n 'description' => 'Wehther this tag is flagged',\n 'null' => NULL_NOT_ALLOWED,\n ],\n 'urls' => [\n 'description' => 'URLs associated with the tag',\n 'null' => NULL_NOT_ALLOWED,\n 'type' => [\n 'view' => [\n 'type' => PARAM_URL,\n 'description' => 'The URL to view the tag',\n 'null' => NULL_NOT_ALLOWED,\n ],\n ]\n ]\n ]\n ],\n 'html' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => [\n 'rating' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source to rate the post',\n ],\n 'taglist' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source to view the list of tags',\n ],\n 'authorsubheading' => [\n 'optional' => true,\n 'default' => null,\n 'null' => NULL_ALLOWED,\n 'type' => PARAM_RAW,\n 'description' => 'The HTML source to view the author details',\n ],\n ]\n ]\n ];\n }",
"public function getDefaultDataParameters()\n {\n return [\n Config::PARAM_CURRENT_URL => $this->getCurrentUrl(),\n Config::PARAM_REFERRER_URL => $this->getReferrerUrl(),\n Config::PARAM_VISIT_TYPE => $this->getCookie(Config::COOKIE_VISIT_TYPE, 'first_time'),\n Config::PARAM_VERSION => Config::ANALYTICS_VERSION,\n Config::PARAM_VISIT_ID => $this->getCookie(Config::COOKIE_VISIT_ID, $this->generateRandomString())\n ];\n }",
"protected function defaults() {\n\t\treturn array( 'content' => false );\n\t}",
"public function getTranslatedPreferences()\n {\n $translate = Tinebase_Translation::getTranslation($this->_application);\n\n $prefDescriptions = array(\n self::DEFAULTADDRESSBOOK => array(\n 'label' => $translate->_('Default Addressbook'),\n 'description' => $translate->_('The default addressbook for new contacts'),\n ),\n self::DEFAULTPERSISTENTFILTER => array(\n 'label' => $translate->_('Default Favorite'),\n 'description' => $translate->_('The default favorite which is loaded on addressbook startup'),\n ),\t\t\n\t\t\tself::TEMPLATE_LABEL => array(\n\t 'label' => 'Dokumentvorlage Adressaufkleber',\n\t 'description' => '',\n\t\t\t)\n );\n \n return $prefDescriptions;\n }",
"public function get_default_config() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'key' => 'name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__( 'Name', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'required',\n\t\t\t\t'placeholder' => esc_html__( 'Name', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'email',\n\t\t\t\t'type' => 'email',\n\t\t\t\t'label' => esc_html__( 'Email', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'required',\n\t\t\t\t'placeholder' => esc_html__( 'Email', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'phone',\n\t\t\t\t'type' => 'number',\n\t\t\t\t'label' => esc_html__( 'Phone', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'optional',\n\t\t\t\t'placeholder' => esc_html__( 'Phone', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'message',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'label' => esc_html__( 'Message', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'required',\n\t\t\t\t'placeholder' => esc_html__( 'Message', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t);\n\t}",
"public function getDefaultCategoryElements() {\n return $this->defaultCategoryElements;\n }",
"public function getDefaultAttributes()\n {\n return [\n 'Value' => 0,\n 'MinValue' => 0,\n 'MaxValue' => 100,\n 'Increment' => 1,\n ];\n }"
] | [
"0.7097628",
"0.67619187",
"0.66481405",
"0.6602465",
"0.6542237",
"0.64325637",
"0.6408378",
"0.6332843",
"0.6295338",
"0.6287865",
"0.6256248",
"0.62404895",
"0.62089264",
"0.6194956",
"0.61926645",
"0.61790764",
"0.6150747",
"0.6130503",
"0.6114488",
"0.61141676",
"0.6112288",
"0.6110389",
"0.61089236",
"0.6105114",
"0.6096171",
"0.6058122",
"0.60552824",
"0.6047186",
"0.6036876",
"0.60333705",
"0.60273147",
"0.60263604",
"0.59888226",
"0.59806937",
"0.59760886",
"0.5960256",
"0.59490496",
"0.5944965",
"0.59409404",
"0.5936042",
"0.59253967",
"0.59218335",
"0.59203535",
"0.591911",
"0.59178096",
"0.59140277",
"0.59066796",
"0.5884764",
"0.58797145",
"0.5863736",
"0.5813038",
"0.58073264",
"0.580484",
"0.58029574",
"0.58028495",
"0.5801487",
"0.57986134",
"0.5795461",
"0.5792037",
"0.5783054",
"0.578239",
"0.576361",
"0.5760432",
"0.5756627",
"0.5736253",
"0.5730063",
"0.57290715",
"0.5728775",
"0.57254994",
"0.57142806",
"0.571271",
"0.5710304",
"0.57010716",
"0.570093",
"0.569692",
"0.56928605",
"0.5683262",
"0.5678558",
"0.5678244",
"0.567773",
"0.5675824",
"0.5674339",
"0.5673631",
"0.5671615",
"0.56714165",
"0.5670709",
"0.5663222",
"0.5658395",
"0.5657651",
"0.5655857",
"0.5655147",
"0.5651825",
"0.5649522",
"0.5644306",
"0.56275386",
"0.5624338",
"0.5607071",
"0.5606553",
"0.56018305",
"0.55958354",
"0.5586604"
] | 0.0 | -1 |
construct akan otomatis dijalankan apabila ada instance baru | public function __construct($name, $price, $image) {
$this->name = $name;
$this->price = $price;
$this->image = $image;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function construct() {\n\n }",
"function _construct(){ }",
"public function __construct() {\n // Aqui todo lo que se define para este constructor\n }",
"protected function construct(){\n\n }",
"function __construct(){\n\t\t// nowt much...\n\t}",
"function _construct() {\n \t\n\t\t\n\t}",
"public function construct()\n\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(){}",
"public function __construct() {\n\n\t\t}",
"function __construct (){\n\t\t}",
"public function __construct() {\n\n $this->vista = new Vista();\n $this->usuario = new Usuario();\n $this->reserva = new Reserva();\n $this->instalacion = new Instalacion();\n $this->horario = new Horario();\n $this->rol = new Rol();\n $this->seguridad = new Seguridad();\n\n }",
"public function _construct()\n\t{\n\n\t}",
"public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}",
"function __construct(){\n //constructor vacio\n }",
"public function __construct() {\r\n\r\n\t\t}",
"function __construct() {\n\n\t\t}",
"public function __construct() {\n\t\t# ...\n\t}",
"public function __construct(){\n\t\t//asi poder tener dispoble la vista que le pertenece a esta clase\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}",
"function __construct(){\n\n\t\t}",
"private function __construct(){\n \t\n }",
"public function __construct() { \n\t\t\n\n\t\t}",
"public function __construct(){\n\t\t//\n\t}",
"public function __construct(){\n\t\t//\n\t}",
"public function __init(){}",
"function __construct()\n {\n $this->obj_contato_anunciante = new OBJ_Contato_Anunciante();\n }",
"public function __construct() {\r\n\r\n\t}",
"public function __construct()\n\t\t{\n\t\t\t//\n\t\t}",
"public function __CONSTRUCT(){\n\t}",
"protected abstract function __construct();",
"function __construct() {\n\t\t\t\t// INSTANSIASI CLASS KONEKSI \n\t\t\t\tparent::__construct();\t\n\n\t\t\t}",
"function __construct() {\n\t\t\t\t// INSTANSIASI CLASS KONEKSI \n\t\t\t\tparent::__construct();\t\n\n\t\t\t}",
"function __construct() {\n\t\t\t\t// INSTANSIASI CLASS KONEKSI \n\t\t\t\tparent::__construct();\t\n\n\t\t\t}",
"public function __construct() {\n\t\t//\n\t}",
"public function __construct() {\n\t\t//\n\t}",
"public function __construct() {\n\t\t//\n\t}",
"public function __construct() {\n\t\t//\n\t}",
"public function __construct() {\r\n\t\t//\r\n\t}",
"protected function __construct(){}",
"protected function __construct(){}",
"protected function __construct(){}",
"function __construct(){\n $this->toko = new M_Toko();\n $this->produk = new M_Produk(); //variabel model merupakan objek baru yang dibuat dari class model\n }",
"private function __construct(){\n\t\t }",
"public function __construct()\r\n\t\t{\r\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() {}",
"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.75529087",
"0.7505178",
"0.7483625",
"0.7436631",
"0.7434678",
"0.74184054",
"0.74064755",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73802805",
"0.73303086",
"0.731984",
"0.73039",
"0.72872376",
"0.7282394",
"0.72793514",
"0.7276572",
"0.72756314",
"0.7275572",
"0.7270442",
"0.72656465",
"0.7264212",
"0.7257594",
"0.72484523",
"0.724713",
"0.724713",
"0.72442675",
"0.7217012",
"0.72131807",
"0.7203113",
"0.71997553",
"0.71905845",
"0.71899223",
"0.71899223",
"0.71899223",
"0.718729",
"0.718729",
"0.718729",
"0.718729",
"0.7182114",
"0.7180448",
"0.7180448",
"0.7180448",
"0.71787995",
"0.71675944",
"0.71623546",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654",
"0.71606654"
] | 0.0 | -1 |
getter agar dapat mengakses kelas private | public function getName(){
return $this->name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFromDB() {}",
"function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}",
"public function giveOrGet(){\n //$pass = $this->db->query($result);\n \n }",
"public function getSingleData(){\n //buatlah query\n $sqlQuery = \"SELECT \n * \n FROM\n \".$this->t_name.\"\n WHERE \n id = ?\n LIMIT 0,1\";\n //siapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n //bindParam\n $stmt->bindParam(1,$this->id);\n //eksekusi perintahnya\n $stmt->execute();\n\n $dataRow = $stmt->fetch(PDO::FETCH_ASSOC);\n \n $this->name = $dataRow['name'];\n $this->email = $dataRow['email'];\n $this->age = $dataRow['age'];\n $this->designation = $dataRow['designation'];\n $this->created = $dataRow['created'];\n }",
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"ide\" =>$this->ide);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"private function fetchDataFromDB($sql){\r\n $dbOps = new DBOperations();\r\n $dataFromDB = $dbOps->fetchData($sql);\r\n return $dataFromDB; \r\n }",
"public function getDBTValue(){ \n $query = \"SELECT * FROM tbl_payment WHERE id ='1'\"; // id = 1 for direct bank\n $result = $this->db->select($query);\n return $result;\n }",
"private function getDbData()\n\t{\n\t\t//make sure we have an id....\n\t\tif ($this->id)\n\t\t{\n\t\t\t$result = db()->getRow(\"\n\t\t\t\tSELECT *\n\t\t\t\tFROM $this->tableName\n\t\t\t\tWHERE id = '$this->id'\n\t\t\t\");\n\n\t\t\tif (is_array($result))\n\t\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function readOne() {\n $query = \"SELECT\n id, name, description, created \n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n $stmt = $this->conn->prepare($query);\n \n $stmt->bindParam(1, $this->id); //ambil id dr bukunya\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC); //mengembalikan barisnya\n\n //set values objek bukunya berdasarkan id tadi\n $this->name = $row['name'];\n $this->description = $row['description'];\n $this->created = $row['created'];\n }",
"public function getDatosUsuario(){\r\n $sql = \"SELECT *\r\n FROM usuarios WHERE Usuario = '{$this->usuario}' AND Clave='{$this->clave}';\";\r\n $data = $this->conexion->getTable($sql);\r\n $row = mysqli_fetch_assoc($data);\r\n return $row;\r\n}",
"function readOne(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}",
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"IDP\" =>$this->IDP);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"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 SqlFetch($prikaz){\n /* zjednoduseni nacteni hodnoty z db primo do promenne */\n if (!$this->Sql($prikaz) && $this->FetchRowA()) {\n return (string)($this->data[0]);\n }else{\n return '';\n } \n }",
"public function getData(){\n\t\tglobal $dbh;\n\t\t$this->data = array();\n\t\t$data = $dbh->query(\"SELECT * FROM cliente WHERE id=?;\",array($this->id));\n\t\tif( $data!==false && !empty($data) ){\n\t\t\t$data = $data[0];\n\t\t\t$this->data = $data;\n\t\t\treturn $this->data;\n\t\t}\n\t\treturn false;\n\t}",
"function tampilkan(){\r\n\t\t\t$query \t= \"SELECT * FROM data\";\r\n\t\t\treturn result($query);\r\n\t\t}",
"function pengguna() {\n global $conn; //memanggil variabel global koneksi\n //select di database berdasarkan nama pengguna yang tercatat di sesi dan dijoinkan dengan tabel jenis pengguna untuk keterangan yang login admin atukah customer\n $q = $conn->prepare(\"SELECT * FROM pengguna p JOIN jenis_pengguna j ON p.jenis_pengguna=j.id WHERE p.nama_pengguna='{$_SESSION['nama-pengguna']}'\");\n $q->execute();\n return @$q->fetchAll()[0]; //direrurn berupa array, ditambah @ akan mereturn false jika data tidak ada\n}",
"public function get_data($id){\r\n\t\t\t$query=\"SELECT * FROM $this->_table WHERE $this->_id='$id' \";\r\n\t\t\t$result = $this->db->query($query);\r\n\t\t\t//$result=mysqli_query($this->db,$query);\r\n\t\t\t$user_data=$result->fetch_object();\r\n\t\t\t//echo $user_data['nama'];\r\n\t\t\t//var_dump($user_data);\r\n\t\t\treturn $user_data;\t\r\n\t\t}",
"public function modelFetch(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban where maphongban=$maphongban\");\n\t\t\t//tra ve mot ban ghi\n\t\t\treturn $query->fetch();\n\t\t}",
"function lihatdata()\n {\n return $this->db->get('tb_santriwati');\n }",
"function select($id)\r\n{\r\n\r\n$sql = \"SELECT * FROM aattribut WHERE aatribut_pk_id = $id;\";\r\n$result = $this->database->query($sql);\r\n$result = $this->database->result;\r\n$row = mysql_fetch_object($result);\r\n\r\n\r\n$this->id_attribut = $row->id_attribut;\r\n\r\n$this->id_produit = $row->id_produit;\r\n\r\n$this->valeur = $row->valeur;\r\n\r\n}",
"public function getData(){\n $sql = \"SELECT*FROM $this->tablename\";\n\n $result = mysqli_query($this->conn, $sql);\n if(mysqli_num_rows($result)>0){\n return $result;\n }\n\n }",
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"public function getDataWithTypeDb() {}",
"public function unico(){\n $this->execute();\n return $this->statemet->fetch(PDO::FETCH_OBJ);\n }",
"function get_pengguna(){\n return $this->db->get('tb_user');\n}",
"function get( $id = \"\")\n {\n\n $query = \"SELECT * FROM \".$this->table_name. \"WHERE `id`=\".$id;\n //prepare query\n $stmt = $this->conn->prepare($query);\n\n // echo $query;\n\n try{\n if( $stmt->execute())\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n if(!$row)\n return false;\n // set values to object properties\n $this->id = $row['id'];\n $this->name = $row['name'];\n $this->usage = $row['use'];\n $this->user_id = $row['user_id'];\n $this->public_key_n = $row['public_key_n'];\n $this->vault_id = $row['vault_id'];\n $this->key_version = $row['key_version'];\n\n return true;\n\n } catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return false;\n\n }",
"public function get_Banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from banco;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"function getData($id){\n // ineed to be more clear about where to get this data because i need to nkow where i should pick up this data from?\n return $this->db->get_where(\"mahasiswa\",array('nim' => $id))->row();\n }",
"abstract function getSQL();",
"function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }",
"public function get_data()\n {\n\n\n }",
"function ambil_data(){\n\t\t$this->db->order_by($this->id_admin,$this->order);\n\t\treturn $this->db->get($this->nama_table)->result();\n\t}",
"public function loadFromDB()\n {\n }",
"public function getDataByID($id){\n $query = $this->db->query('select from books where ID');\n }",
"public function readone(){\r\t\t\t$query=\"select * from `\".$this->tablename.\"` where `id`='\".$this->id.\"'\";\r\t\t\t$result=mysqli_query($this->conn,$query);\r\t\t\t$value=mysqli_fetch_row($result);\r\t\t\treturn $value;\r\t\t}",
"public function 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}",
"function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}",
"function retriveDataRow(){\r\n\t\t$coal_name = $this->getName();\r\n\t\tmysql_query(\"SET NAMES 'latin2'\");\r\n\t\tif(gettype($this->data) == 'boolean' && !is_null($coal_name)){\r\n\t\t\t$query = \"SELECT * FROM \". TBL_COALITION .\r\n \" WHERE nazwa = '$coal_name'\";\r\n\t\t\tif($result = mysql_query($query)){\r\n\t\t\t\tif(mysql_num_rows($result) == 0){\r\n\t\t\t\t\t$this->data = NULL;\r\n\t\t\t\t\t$this->coalition = NULL;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\r\n\t\t\t\t\t$this->data = $row;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$this->data = NULL;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function getChevalById(){\n\n\n\t\t$query = \"SELECT * from \". $this->table_name . \" WHERE id = ? \";\n\t\t$stmt = $this->conn->prepare( $query );\n\n\t\t// affecte la valeur de l id au paramètre de la requete\n\t\t$stmt->bindParam(1, $this->id);\n\n\t\t// execute la requete\n\t\t$stmt->execute();\n\n\t\t// recupere la ligne\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // valorise les proprietes de cheval\n\t\t$this->id = $row['id'];\n\t\t$this->nom = $row['nom'];\n\t\t$this->sexe = $row['sexe'];\n\t\t$this->prixDepart = $row['prixDepart'];\n\n\t}",
"function select($id)\r\n{\r\n\r\n$sql = \"SELECT * FROM attribut WHERE attribut_pk_id = $id;\";\r\n$result = $this->database->query($sql);\r\n$result = $this->database->result;\r\n$row = mysql_fetch_object($result);\r\n\r\n\r\n$this->id_attribut = $row->id_attribut;\r\n\r\n$this->nom = $row->nom;\r\n\r\n}",
"function ambil_data(){ //fungsi yang akan mengambil data pada table user\n\t\treturn $this->db->get('user'); //mengambil data dari database, mengembalikan data yang ditangkap pada controller yang memanggil function ambil_data\n\t}",
"public function data($id = null)\n\t{\n if($id != null)\n {\n return $this->db->get($this->table, \"*\", [$this->primaryKey => $id]);\n }\n else\n {\n // return $this->db->query(\"SELECT bidang.*, pegawai.nama FROM bidang JOIN pegawai ON bidang.nip = pegawai.nip\")->fetchAll(PDO::FETCH_ASSOC);\n return $this->db->query(\"SELECT * from bidang\")->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}",
"function get_data()\n\t{\n\t\t$query = $this->db->get(\"Testing\");\n\n\t\treturn $query;\n\t}",
"public function fetchResult();",
"public function fetchField();",
"function dataGetData($p_id)\n {\n $p_id = parent::escape($p_id);\n \n $sql = 'SELECT fkusertypeid,';\n $sql .= 'username, ';\n $sql .= 'userpwd, ';\n $sql .= 'saltpwd, ';\n $sql .= 'firstname, ';\n $sql .= 'lastname, ';\n $sql .= 'email, ';\n $sql .= 'DATE_FORMAT(datelastlogin, \\'%d %b %Y %H:%i\\'), ';\n $sql .= 'isactive ';\n $sql .= 'FROM user ';\n $sql .= 'WHERE id = ' . $p_id . ' ';\n $sql .= 'AND isdeleted = 0 '; \n \n $result_mysqli = parent::query($sql);\n $result = parent::fetchAllRows($result_mysqli);\n parent::clear($result_mysqli); \n\n return $result; \n }",
"public function __toString(){\n return $this->execute();\n }",
"public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }",
"public function read_single(){\n $query='SELECT * FROM '.$this->table.' WHERE id=?';\n\n $stmt = $this->conn->prepare($query);\n\n $stmt->bindparam(1,$this->id);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n \n }",
"public function _query()\n {\n }",
"public function modelGetRecord(){\n $id = isset($_GET[\"id\"])&&$_GET[\"id\"] > 0 ? $_GET[\"id\"] : 0;\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select * from inventory where id=$id\");\n // tra ve mot ban ghi\n return $query->fetch();\n }",
"static private function get()\r\n { \r\n $con = mysqli_connect(self::$_dbHost, self::$_dbUserName, self::$_dbUserPwd, self::$_dbName);\r\n \r\n // connect to database\r\n if (!$con) {\r\n die('Could not connect: ' . mysql_error());\r\n }\r\n else{\r\n\t\t\techo \"konek goblog\";\r\n\t\t} \r\n // mysqli_select_db(self::$_dbName, $con);\r\n \r\n $result = mysqli_query($con, \"SELECT * FROM points\");\r\n \r\n $data = false;\r\n \r\n while($row = mysqli_fetch_array($result,MYSQLI_ASSOC))\r\n {\r\n $data = $row['data'];\r\n }\r\n \r\n // close connection\r\n mysqli_close($con); \r\n \r\n return $data;\r\n }",
"function dbacha($sql, $retorno) {\r\n $qtemp = DBExecute($sql . \" LIMIT 0,1\");\r\n foreach ($qtemp as $r) {\r\n $campo = $r[$retorno];\r\n }\r\n return $campo;\r\n }",
"public function getFromCache_queryRow() {}",
"function readOne() {\n\t\t\t$query = \"SELECT * FROM `\".$this->table_name.\"` WHERE id ='\".$this->id.\"'\";\n\t\t \n\t\t\t// prepare query statement\n\t\t\t$hasil = mysqli_query($this->conn, $query);\n\t\t\t \n\t\t\t$row = mysqli_fetch_array($hasil);\n\t\t\t\n\t\t\treturn $row;\n\t\t}",
"public function get_row();",
"public function GetData() {\n try {\n $conn = new BancoDados();\n $conectar =$conn->Conectar();\n \n if ( $conectar==null) {\n \n throw new Exception(\"Não foi possivel conectar ao banco de dados\");\n \n }else {\n \n $list=$conectar->query(\"Select * from movies\");\n return $list; \n \n }\n } catch (PDOException $exc) {\n echo $exc->getMessage();\n }\n\n \n }",
"public function get()\n {\n ci()->db->order_by('id', 'asc');\n $q = ci()->db->get($this->_table); \n if($q->num_rows()>0)\n {\n return $data = $q->result();\n }\n else\n {\n return false;\n } \n }",
"public function lihatDataGaleri(){\n\t\t$this->db->where(\"tipe\",1);\n\t\treturn $this->db->get(\"galeri\");\n\t}",
"public function readInfoById() {\t\t\n\t\t$fnName = \"getId\";\n\t\t$_id = -1;\n\t\t\n\t\t$_nombre = get_class( $this ) ;\n\t\t$result = null;\n\t\t$params = array();\n\t\t\n\t\tforeach(get_class_methods( $this ) as $id => $vl){\n\t\t\tif( strtolower( $vl ) == strtolower( $fnName ) ){\n\t\t\t\t$_id = $this->$fnName();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $_id > 0 ){\n\t\t\t$stmt = null;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM \" . strtolower( $_nombre ) . \" WHERE id = ?\";\n\t\t\tif ($stmt = self::$lnk->prepare($query)) {\n\t\t\t\t$stmt->bind_param(\"i\", $_id);\n\t\t\t $stmt->execute();\n\t\t\t \n\t\t\t\t$meta = $stmt->result_metadata(); \n\t\t\t while ($field = $meta->fetch_field()) {\n\t\t\t \t$params[] = &$row[ $field->name ]; \n\t\t\t } \n\t\t\t\n\t\t\t call_user_func_array(array($stmt, 'bind_result'), $params); \n\t\t\t \n\t\t\t while ($stmt->fetch()) {\n\t\t\t \t$o = new $_nombre();\n\t\t\t foreach($row as $key => $val) {\n\t\t\t $o->{ \"set\" . Singleton::toCap($key)}( $val );\n\t\t\t } \n\t\t\t $result = $o;\t\t\t \n\t\t\t }\n\t\t\t $stmt->close();\n\t\t\t}else{\n\t\t\t\t$this->mensaje_error = self::$lnk->error;\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn $result;\n\t\t\n\t}",
"function readName(){\n $query = \"SELECT id, name, status FROM \" . $this->table_name . \" WHERE id = ? limit 0,1\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->name = $row['name'];\n $this->status = $row['status'];\n $this->id = $row['id'];\n }",
"public function get()\n {\n return self::fetchAll();\n }",
"public function selectdata(){\n$this->autoRender=false;\n$data=$this->connection->execute(\"select * from users\")->fetchAll();\nprint_r($data);\n}",
"public function get_data()\n {\n }",
"public function get_data()\n {\n }",
"public function get_data()\n {\n }",
"public function get_data()\n {\n }",
"public function get_data();",
"public function getSQL();",
"public function getData(){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data;\n\t}",
"public function getAll(){\n $sqlQuery = \"SELECT * FROM \".$this->t_name.\"\";\n //prepate stamt;\n $stmt = $this->conn->prepare($sqlQuery);\n $stmt->execute();\n //kembalikan nilai stmt\n return $stmt;\n }",
"function __get($var) {\n// if (array_key_exists($var, $this->data)) {\n// $this->data[]\n// }\n if (!array_key_exists($var, $this->data)) {\n $desc = \"DESC user_db.users ?\";\n if ($stmt = $db->prepare($desc)) {\n $stmt->bind_param(\"s\", $var);\n $stmt->execute();\n $stmt->bind_result();\n }\n }\n return $this->data[$var];\n }",
"public function selectMedecin(){\n $bdd=Connexion::getInstance();\n $req=\" select * from utilisateur u ,specialite s,service ser \n WHERE u.idSpecialite=s.idSpecialite and s.idService=ser.idService\n AND idStatus=\".self::NIVEAU_1;\n $rep=$bdd->query($req);\n return $rep->fetchall();\n \n }",
"function read(){\n //select all data\n $query = \"SELECT\n id, name, status\n FROM\n \" . $this->table_name . \"\n ORDER BY\n id DESC\"; \n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }",
"public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}",
"function list_pengguna() {\n global $conn; //manggil global variabel koneksi ke database\n //melakukan select data pengguna dan yang aktif\n $q = $conn->prepare('SELECT * FROM pengguna WHERE aktif=\"1\"');\n $q->execute();\n //mereturn data tersebut berbentuk array\n return @$q->fetchAll();\n}",
"function Data($sloupec){\n // prevod z velkych pismen na mala pro MySQL\n if (isset($this->data[$sloupec])){\n return $this->data[$sloupec];\n }else{\n if (isset($this->data[strtolower($sloupec)])){\n return $this->data[strtolower($sloupec)];\n }else{\n return '';\n }\n }\n }",
"function sqlData($sql){\n // \n $result = $this->query($sql);\n //\n //\n if (!$result) {\n print \"<p>Could not retrieve data: </p>\";\n }\n while ($row = $result->fetchAll()) {\n $data = $row;\n return json_encode($data);\n }\n }",
"public function getInformesuser(){ \n \n $consultacantidaduser =\"SELECT count(*) cantidad_usuarios, R.nombre_rol\n FROM roles R\n INNER JOIN usuarios U \n ON U.roles_id = R.id \n GROUP BY R.nombre_rol ASC\";\n \n $this->getInformesuser=Yii::app()->db->createCommand($consultacantidaduser)->queryAll();// consulta base de datos Mysql \n \n return $this->getInformesuser;// devuelve el valor de la funcion get de el modelo\n }",
"function dbGet(){\r\n global $db_query;\r\n return $db_query->fetch(PDO::FETCH_ASSOC);\r\n}",
"function Readto()\n {\n $conexion=floopets_BD::Connect();\n $conexion->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\n $consulta=\"SELECT denuncia.*,tipo_denuncia.* FROM tipo_denuncia INNER JOIN denuncia on tipo_denuncia.td_cod_tipo_denuncia=denuncia.td_cod_tipo_denuncia \";\n // $consulta=\"SELECT * FROM citas WHERE Cod_usu=?\";\n $query=$conexion->prepare($consulta);\n $query->execute(array());\n\n\t$resultado=$query->fetchAll(PDO::FETCH_BOTH);\n\n\tfloopets_BD::Disconnect();\n\n\treturn $resultado;\n }",
"public function get_sql()\n {\n }",
"public function get_data(){\n\t\t// by using given function\n\t\tif($this->func_data_total && function_exists($this->func_data_total)){\n\t\t\t$this->items_total = call_user_func_array($this->func_data_total, array());\n\t\t// by using direct SQL request\n\t\t}else{\n\t\t\t$total = $this->db->fetch_all(\n\t\t\t\tsprintf(\n\t\t\t\t\t'SELECT COUNT(*) as cnt'\n\t\t\t\t\t\t.' FROM %s'\n\t\t\t\t\t\t.'%s',\n\t\t\t\t\t$this->sql['table'], // TABLE\n\t\t\t\t\t$this->sql['where'] // WHERE\n\t\t\t\t),\n\t\t\t\t'obj'\n\t\t\t);\n\t\t\t$this->items_total = $total[0]->cnt;\n\t\t}\n\t\t\n\t\t// Getting data\n\t\t// by using given function\n\t\tif($this->func_data_get && function_exists($this->func_data_get)){\n\t\t\t$param = array($this->sql['offset'], $this->sql['limit']);\n\t\t\tif($this->order_by) $param[] = current($this->order_by);\n\t\t\tif($this->order_by) $param[] = key($this->order_by);\n\t\t\t$this->rows = call_user_func_array($this->func_data_get, $param);\n\t\t// by using direct SQL request\n\t\t}else{\n\t\t $columns = array();\n\t\t foreach ( $this->columns_names as $columns_name ) {\n\t\t\t $columns[] = $this->sql['table'] . '.' . $columns_name;\n }\n\t\t\t$this->rows = $this->db->fetch_all(\n\t\t\t\tsprintf(\n\t\t\t\t\t'SELECT %s'\n\t\t\t\t\t\t.' FROM %s'\n\t\t\t\t\t\t.'%s'\n\t\t\t\t\t\t.' ORDER BY %s %s'\n\t\t\t\t\t\t.' LIMIT %s%d',\n\t\t\t\t\timplode(', ', $columns), // COLUMNS\n\t\t\t\t\t$this->sql['table'], // TABLE\n\t\t\t\t\t$this->sql['where'], // WHERE\n\t\t\t\t\tkey($this->order_by), current($this->order_by), // ORDER BY\n\t\t\t\t\t$this->sql['offset'].',', $this->sql['limit'] // LIMIT\t\n\t\t\t\t),\n\t\t\t\t$this->sql['get_array'] === true ? 'array' : 'obj'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Adding actions to each row \n\t\tforeach($this->rows as &$row){\n\t\t\tif(is_object($row)) $row->actions = array_flip(array_keys($this->actions));\n\t\t\tif(is_array($row)) $row['actions'] = array_flip(array_keys($this->actions));\n\t\t} unset($row);\n\n\t\t$this->items_count = count((array)$this->rows);\n\t\t\n\t\t// Execute given function to prepare data\n\t\tif($this->func_data_prepare && function_exists($this->func_data_prepare))\n\t\t\tcall_user_func_array($this->func_data_prepare, array(&$this)); // Changing $this in function\n\t\telse{\n\t\t\t$this->preapre_data__default();\n\t\t}\n\t\t\n\t\treturn $this;\n\t\t\n\t}",
"public function select(){\n\t$sql=\"SELECT * FROM tipousuario\";\n\treturn ejecutarConsulta($sql);\n}",
"function resultado(){\n\t\t\treturn $this->result=mysql_fetch_object($this->query);\n\t\t\t}",
"public function read_single() {\n $query = 'SELECT id, author\n FROM ' . $this->table . ' WHERE id = :id';\n\n //prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(':id', $this->id);\n\n //excuted query\n $stmt->execute();\n //GET the array \n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //set properties\n $this->id = $row['id'];\n $this->author = $row['author'];\n }",
"public function get(){\n\n if(is_null($this->columns)) $this->columns = ['*'];\n $select_statement = $this->grammer->compileSelect($this);\n \n \n $result = $this->connection->get($select_statement); \n \n if(!empty($this->model)){\n \n return $this->return_results_objects($result);\n\n }else{\n \n return $this->return_result_as_array($result);\n }\n \n }",
"public function get_data(){\n // $id = 2;\n // $stmt = $this->verivied()->prepare(\"SELECT * FROM emptab WHERE id= :id\");\n // $stmt->bindParam(':id', $id);\n // $stmt->execute();\n // $data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n // return $data;\n // select by id;\n $data1 = $this->Xgen->select('id,nama')->from('emptab')->where('id = :id', 4)->go();\n // select all;\n //$data = $this->Xgen->select('id,nama')->from('emptab')->go();\n // inser data\n // $data = $this->Xgen->insert_query('emptab',[\n // 'nama' => 'bxel'\n // ])->go();\n //update data\n //$data = $this->Xgen->update_query('emptab', ['nama' => 'new name'])->where('id = :id', 4)->go();\n //DELETE\n //$data1 = $this->Xgen->delete('emptab','id = :id',4)->go();\n\n }",
"public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }",
"public static function modeloUserGet ($userid){\n $datosuser=[];\n $stmt=self::$db->prepare(self::$consulta_user);\n $stmt->bindValue(1,$userid);\n $stmt->execute();\n if ($stmt->rowCount()>0) {\n $stmt->setFetchMode(PDO::FETCH_CLASS,\"Usuario\");\n $cod=$stmt->fetch();\n $datosuser=[\n $cod->clave,\n $cod->nombre,\n $cod->email,\n $cod->plan,\n $cod->estado\n ];\n return $datosuser;\n }\n return null;\n}",
"public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }",
"function datagolongan() {\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 golongan\";\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}",
"private function retrieveData(){\n\t\t\n\t\t$dbo=new DB();\n\t\t$db=$dbo->db;\n\t\t$stmt = $db->prepare(\t'SELECT `description`, '.\n\t\t\t\t\t\t\t\t\t\t'`duration` '.\n\t\t\t\t\t\t\t\t'FROM `status` '.\t\t\n\t\t\t\t\t\t\t\t'WHERE `status` = ? '.\n\t\t\t\t\t\t\t\t'LIMIT 1'\n\t\t\t\t\t\t\t\t);\n\t $stmt->bind_param(\"s\", $this->id);\n\t $stmt->bind_result($this->description,$this->duration);\n\t $stmt->execute();\n\t $stmt->fetch();\n \t\t$stmt->close();\n \t\t\n\t}",
"function ambil_data(){\n\t\treturn $this->db->get('user'); //digunakan untuk mengambil data yang ditangkap pada controller yang memanggil function ambil_data(controller belelajar pada function user())\n\t}",
"public function getTableData()\n\t{\n\t}",
"public function fetch()\n\t{\n\t\t//$this -> error();\n\t\t$dbName = $this -> databaseName;\n\t\treturn $dbName() -> fetch();\n\t}",
"public function getMember(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->email = $row['email'];\n $this->username = $row['username'];\n }",
"function getById($id){\n $item=new Alumnos();\n $query=$this->db->conn()->prepare('SELECT * FROM ALUMNO WHERE id_alumno=:id');\n try{\n $query->execute(['id'=>$id]);\n while($row=$query->fetch()){\n $item->id=$row['id_alumno'];\n $item->nombre=$row['nombre'];\n $item->apellido=$row['apellido'];\n $item->telefono=$row['telefono'];\n }\n return $item;\n }catch(PDOException $e){\n return [];\n }\n }",
"function getInscritos()\n{\n global $mysqli;\n $Query = new Query($mysqli, \"SELECT name,lastname,nombre_usuario,email,type from usuarios\");\n $parametros = array();\n $data = $Query->getresults();\n\n if (isset($data[0])) {\n return $data[0];\n } else {\n return null;\n }\n\n}",
"public function get(){\n $this->query = \"SELECT \".$this->select.\" FROM $this->table WHERE \";\n $wheres = $this->mergeWhere().\" OR \".$this->mergeOrWhere();\n $query = $this->query.$wheres;\n $statement = $this->prepare($query);\n $statement->execute($this->bindings);\n return $statement->fetchAll();\n }"
] | [
"0.71949023",
"0.66579574",
"0.6623534",
"0.65750515",
"0.65725225",
"0.654264",
"0.6506629",
"0.65035045",
"0.6490499",
"0.6387599",
"0.63822025",
"0.6380647",
"0.6375793",
"0.63609564",
"0.6360659",
"0.6356933",
"0.63520235",
"0.6349741",
"0.6343569",
"0.6329156",
"0.63218236",
"0.6314192",
"0.6298928",
"0.6271291",
"0.62537384",
"0.6251153",
"0.62502766",
"0.6248365",
"0.6243392",
"0.6242852",
"0.6239277",
"0.62390494",
"0.62373614",
"0.6234275",
"0.6229005",
"0.6228375",
"0.6217923",
"0.62172914",
"0.62167007",
"0.6202317",
"0.6197071",
"0.61821",
"0.61754435",
"0.6163657",
"0.6155243",
"0.61541474",
"0.6153821",
"0.6149009",
"0.6142436",
"0.6141301",
"0.6128894",
"0.6119879",
"0.6109464",
"0.6106324",
"0.61057323",
"0.61004657",
"0.6093351",
"0.60873425",
"0.6085103",
"0.6084254",
"0.60826606",
"0.6081985",
"0.6077048",
"0.607062",
"0.60655457",
"0.60655457",
"0.60655457",
"0.60652274",
"0.6057812",
"0.6051837",
"0.6051505",
"0.6044775",
"0.6039403",
"0.6031824",
"0.6019406",
"0.6018071",
"0.6015475",
"0.6013378",
"0.6012647",
"0.6012591",
"0.6008878",
"0.6005647",
"0.5999448",
"0.5997533",
"0.5996336",
"0.59962815",
"0.5992153",
"0.59908646",
"0.59892803",
"0.5989277",
"0.59888387",
"0.59864235",
"0.59858847",
"0.59822226",
"0.597894",
"0.5978808",
"0.5973596",
"0.5971242",
"0.59706646",
"0.5969069",
"0.59676063"
] | 0.0 | -1 |
Assign slider to banners | protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
$this->saveBanners($object);
$this->saveProducts($object);
return parent::_afterSave($object);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setSlider($slider=7){\n\t\t\t$this->slider = $slider;\n\t\t}",
"public function slider($limit='0')\n\t{\n\t\tif(!$this->session->userdata('logged_in')){\n\t\t\tredirect('login');\n\t\t\t\n\t\t}\n\t\t$logged_in=$this->session->userdata('logged_in');\n\t\tif($logged_in['base_url'] != base_url()){\n\t\t$this->session->unset_userdata('logged_in');\t\t\n\t\tredirect('login');\n\t\t}\n\t\t\n\t \t\t$logged_in=$this->session->userdata('logged_in');\n $acp=explode(',',$logged_in['setting']);\n\t\t\tif(!in_array('All',$acp)){\n\t\t\texit($this->lang->line('permission_denied'));\n\t\t\t}\n\t\t\t\n\t\t\n\t\t \t \n\t\t\t\n\t\t\t\n\t $data['title']=$this->lang->line('slider');\n\t\t\t\t$data['result']=$this->Cms_model->slider_list();\n\t\t\t\t \n\t\t$this->load->view('header',$data);\n\t\t $this->load->view('slider',$data);\n\t\t$this->load->view('footer',$data);\n\t}",
"function cool_carousel_activation(){}",
"function bnk_slider() {\r\n\tif (is_page_template('template-home.php') || is_single() ) {\r\n\r\n\t\tglobal $smof_data;\r\n\t\t$animation = $smof_data['bnk_slide_animation'];\r\n\t\t$slideDirection = $smof_data['bnk_slide_direction'];\r\n\t\t$slideshowSpeed = $smof_data['bnk_slide_speed'];\r\n\t\t$animationDuration = $smof_data['bnk_slide_animduration'];\r\n\t\t$directionNav = $smof_data['bnk_slide_dirnav'];\r\n\t\t$controlNav = $smof_data['bnk_slide_control'];\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n jQuery(window).load(function() {\r\n\t\t\t\tif (jQuery().flexslider) {\r\n\t\t\t\t\tjQuery('.flexslider').flexslider({\r\n\t\t\t\t\t\t<?php if($animation ) : ?> animation: \"<?php echo $animation; ?>\", <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($slideDirection ) : ?> slideDirection: \"<?php echo $slideDirection; ?>\", <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($slideshowSpeed ) : ?> slideshowSpeed: <?php echo $slideshowSpeed; ?>, <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($animationDuration ) : ?> animationDuration: <?php echo $animationDuration; ?>, <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($directionNav == 0 ) : ?> directionNav: false, <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($controlNav == 0 ) : ?> controlNav: false <?php endif; ?>\r\n\t\t\t\t\t });\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\n\t}\r\n}",
"function banner() {\n global $wp_query;\n\n $wp_query = new WP_Query( array( 'post_type' => 'banner' ) );\n\n $indicators = '';\n $slides = '';\n $i = 0;\n\n if ( have_posts()) : while ( have_posts() ) : the_post();\n global $post;\n\n $img = get_the_post_thumbnail( $post->ID, 'full' );\n $class = ($i == 0 ? 'active' : '');\n\n $url = get_field( 'banner_link' );\n\n $slide = '\n <li class=\"item '.$class.'\">\n <h3 class=\"carousel-caption\"><a href=\"' . $url . '\">' . get_the_title() . '</a></h3>\n ' . $img . '\n </li>\n ';\n\n $slides .= $slide;\n\n $indicators .= ' <li data-target=\"#main_banner\" data-slide-to=\"' . $i . '\" class=\"' . $class . '\"></li>' . \"\\n\";\n\n $i++;\n endwhile; else: return ''; endif; wp_reset_query();\n\n return '\n <div id=\"main_banner\" class=\"carousel slide\" data-ride=\"carousel\">\n <!-- Slides -->\n <ul class=\"carousel-inner\" role=\"listbox\">\n ' . $slides . '\n </ul>\n\n <!-- Indicators -->\n <ul class=\"carousel-indicators\">' . \"\\n\" . $indicators . ' </ul>\n\n <!-- Prev/Next Controls -->\n <a class=\"left carousel-control\" href=\"#main_banner\" role=\"button\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">Previous</span>\n </a>\n <a class=\"right carousel-control\" href=\"#main_banner\" role=\"button\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">Next</span>\n </a>\n </div>\n ';\n}",
"function rps_activate()\n{\n $width = '460';\n $height = '470';\n $post_per_slide = '1';\n $total_posts = '8';\n $slider_content = '3';\n rps_post_img_thumb();\n}",
"function itransform_ibanner_slider () { \r\n\r\n\t$itrans_slogan = esc_attr(get_theme_mod('banner_text', of_get_option('itrans_slogan')));\r\n\t$sliderscpeed = get_theme_mod('itrans_sliderspeed', (of_get_option('sliderspeed', 6000)/1000))*1000;\r\n\r\n\t$upload_dir = wp_upload_dir();\r\n\t$upload_base_dir = $upload_dir['basedir'];\r\n\t$upload_base_url = $upload_dir['baseurl'];\r\n\t\t\t\t\t\r\n\t$arrslidestxt = array();\r\n\t$template_dir = get_template_directory_uri();\r\n for($slideno=1;$slideno<=4;$slideno++){\r\n\t\t\t$strret = '';\r\n\t\t\t\r\n\t\t\t$slide_speed = esc_attr( get_theme_mod('itrans_sliderspeed')*1000 );\r\n\t\t\t$slide_title = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_title', of_get_option ('itrans_slide'.$slideno.'_title', 'Multi-Purpose WP Theme')) );\r\n\t\t\t$slide_desc = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_desc', of_get_option ('itrans_slide'.$slideno.'_desc', 'To start setting up i-transform go to appearance > Customize. Make sure you have installed recommended plugin "TemplatesNext Toolkit" by going appearance > install plugin.')) );\r\n\t\t\t$slide_linktext = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_linktext', of_get_option ('itrans_slide'.$slideno.'_linktext', 'Know More')) );\r\n\t\t\t$slide_linkurl = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_linkurl', of_get_option ('itrans_slide'.$slideno.'_linkurl', 'http://templatesnext.org/icraft/?page_id=783')) );\t\t\t\r\n\t\t\t$slide_image = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_image', of_get_option ('itrans_slide'.$slideno.'_image', get_template_directory_uri() . '/images/slide-'.$slideno.'.jpg')) );\t\t\t\t\r\n \r\n\t\t\t$slider_image_id = itransform_get_attachment_id_from_url( $slide_image );\t\t\t\r\n\t\t\t$slider_resized_image = wp_get_attachment_image( $slider_image_id, \"slider-thumb\" );\r\n\r\n\t\t\t\r\n\t\t\tif ($slider_resized_image==\"\")\r\n\t\t\t{\r\n\t\t\t\t$slider_resized_image = '<img src=\"'.get_template_directory_uri() . '/images/missing-thumb.png\">';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//echo \"<h3>Original Image URL : \".$slide_image.\"</h3>\";\r\n\t\t\t//echo \"<h3>Image ID : \".$slider_image_id.\"</h3>\";\r\n\t\t\t//echo \"<h3>Resized Image URL : \".$slider_resized_image.\"</h3>\";\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif (!$slide_linktext)\r\n\t\t\t{\r\n\t\t\t\t$slide_linktext = __('Read more', 'i-transform');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($slide_title) {\r\n\t\t\t$strret .= '<h2>'.$slide_title.'</h2>';\r\n\t\t\t$strret .= '<p>'.$slide_desc.'</p>';\r\n\t\t\t$strret .= '<a href=\"'.$slide_linkurl.'\" class=\"da-link\">'.$slide_linktext.'</a>';\r\n\t\t\t\r\n\t\t\t\tif( $slide_image!='' ){\r\n\t\t\t\t\tif( file_exists( str_replace($upload_base_url,$upload_base_dir,$slide_image) ) ){\r\n\t\t\t\t\t\t$strret .= '<div class=\"da-img\">' . $slider_resized_image .'</div>';\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//$slide_image = $template_dir.'/images/no-image.png';\r\n\t\t\t\t\t\t$slide_image = $template_dir.'/images/slide-'.$slideno.'.jpg';\r\n\t\t\t\t\t\t$strret .= '<div class=\"da-img noslide-image-1\"><img src=\"'.$slide_image.'\" alt=\"'.$slide_title.'\" /></div>';\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t$slide_image = $template_dir.'/images/no-image.png';\r\n\t\t\t\t\t$strret .= '<div class=\"da-img noslide-image\"><img src=\"'.$slide_image.'\" alt=\"'.$slide_title.'\" /></div>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($strret !=''){\r\n\t\t\t\t$arrslidestxt[$slideno] = $strret;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t}\r\n\tif(count($arrslidestxt)>0){\r\n\t\techo '<div class=\"ibanner\" data-sliderspeed=\"'.$sliderscpeed.'\">';\r\n echo '\t<div class=\"slidexnav\">';\r\n\t\techo '\t\t<a href=\"#\" class=\"sldprev genericon genericon-leftarrow\"></a>';\r\n\t\techo '\t\t<a href=\"#\" class=\"sldnext genericon genericon-rightarrow\"></a>';\r\n\t\techo '\t</div>';\r\n\t\techo '\t<div id=\"da-slider\" class=\"da-slider\" role=\"banner\">';\r\n\t\t\t\r\n\t\tforeach ( $arrslidestxt as $slidetxt ) :\r\n\t\t\techo '<div class=\"da-slide\">';\t\r\n\t\t\techo\t$slidetxt;\r\n\t\t\techo '</div>';\r\n\r\n\t\tendforeach;\r\n\t\t\r\n\t\techo '\t\t<nav class=\"da-arrows\">';\r\n\t\techo '\t\t\t<span class=\"da-arrows-prev\"></span>';\r\n\t\techo '\t\t\t<span class=\"da-arrows-next\"></span>';\r\n\t\techo '\t\t</nav>';\r\n\t\techo '\t</div>';\r\n\t\techo '</div>';\r\n\t} else\r\n\t{\r\n echo '<div class=\"iheader front\">';\r\n echo ' <div class=\"titlebar\">';\r\n echo ' <h1>';\r\n\t\t\r\n\t\tif ( $itrans_slogan ) {\r\n\t\t\t\t\t\t//bloginfo( 'name' );\r\n\t\t\techo $itrans_slogan;\r\n\t\t} \r\n\t\t//else {\r\n\t\t\t//printf( __( 'Welcome To ', 'i-transform' ) ); bloginfo( 'name' );\r\n\t\t//}\r\n echo ' </h1>';\r\n\t\techo ' \t\t <h2>';\r\n\t\t\t \t\t//bloginfo( 'description' );\r\n\t\t\t\t\t\t//echo of_get_option('itrans_sub_slogan');\r\n\t\techo '\t\t</h2>';\r\n echo ' </div>';\r\n echo '</div>';\r\n\t}\r\n \r\n}",
"public function set_slider_slides($slides) {\n $this->slides_to_include = $slides;\n }",
"function lumo_slider(){\n\t\t$slides = new Lumo_Slider_Query();\n\n\t\tif( $slides->have_posts() ) :\n\t\t\t$display = \"\";\n\t\t\techo '<ul id=\"lumo-slider\">';\n\t\t\twhile( $slides->have_posts() ) : $slides->the_post();\n\t\t\t\t$slide_image = get_the_post_thumbnail(get_the_ID(), 'home-slider-image-lowrez');\n\t\t\t\t$slide_image_url = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID(), 'home-slider-image') );\n\n\t\t\t\t$set_width_fullrez = sprintf('width=\"100%%\" data-fullrez=\"%s\"', esc_url($slide_image_url) );\n\n\t\t\t\t$slide_image = preg_replace('/width=\"\\d+\" +height=\"\\d+\"/', $set_width_fullrez, $slide_image);\n\n\t\t\t\techo '<li class=\"lumo-slide\" style=\"'.$display.'\">';\n\t\t\t\t\techo $slide_image;\n\t\t\t\t\techo '<div class=\"hero-placeholder\"></div>';\n\t\t\t\t\techo '<div class=\"hero\">';\n\t\t\t\t\t\t\techo '<h4 class=\"hero\">'.get_the_title().'</h4>';\n\t\t\t\t\t\t\tthe_content();\n\t\t\t\t\techo '</div>';\n\t\t\t\techo '</li>';\n\t\t\t\t$display = \" display:none; \";\n\t\t\tendwhile;\n\t\t\twp_reset_postdata();\n\t\t\techo '</ul>';\n\t\tendif;\n\t}",
"public function run() {\n $sliders = array(\n ['slider_image' => 'assets/images/home-banner-1.png'],\n ['slider_image' => 'assets/images/home-banner-2.png'],\n ['slider_image' => 'assets/images/home-banner-3.png'],\n ['slider_image' => 'assets/images/home-banner-4.png'],\n );\n foreach($sliders as $slider){\n \n HomeSlider::create($slider);\n }\n }",
"private function fill_slider(){\n\t\tglobal $DB;\n\t\t$slides= \"SELECT * FROM {theme_archaius} ORDER BY position ASC\";\n\t $slides= $DB->get_records_sql($slides);\n\t return $slides;\n\t}",
"public function changeSlider(){\n $slider = $this->appearance->getAllSlider();\n return view('dashboard.slider',['slider' => $slider]);\n }",
"function display_bri_slider($prefid, $id, $gnum, $lnum = \"\") {\n\techo \"<TD CLASS=bslider>\";\n\techo \"<DIV ID=\" . $prefid . \"bs_$id CLASS=brislider gnum=$gnum\";\n\tif ($lnum != \"\") {\n\t\techo \" lnum=$lnum\";\n\t}\n\techo \"></DIV>\";\n\techo \"<TD><DIV ID=\" . $prefid . \"bs_\" . $id . \"_val CLASS=bsval></DIV>\";\n}",
"function getSlider_images()\n\t\t{\n\t\t\t$slider_images = $this->manage_content->getValue('slider_info','*');\n\t\t\tforeach($slider_images as $slider_image)\n\t\t\t{\n\t\t\t\tif($slider_image['slider_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$slider_image[\"slider_link\"].'\"><img src=\"images/'.$slider_image[\"slider_image\"].'\" style=\"width:692px;height:210px;\"/></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function wpsp_tour_slideshow() {\n\tglobal $post;\n\n\t$photos = explode( ',', get_post_meta( $post->ID, 'wpsp_tour_slideshow', true ) );\n\n\tif ( $photos[0] != '' ) { ?>\n\t\t<script type=\"text/javascript\">\n jQuery(document).ready(function($){\n $('#slides').superslides({\n \tplay: 5000,\n\t\t\t\t animation_speed: 600,\n\t\t\t\t animation_easing: 'swing',\n\t\t\t\t animation: 'slide',\n\t\t\t inherit_width_from: '.site-slider',\n\t\t\t inherit_height_from: '.site-slider'\n\t\t\t });\n }); \n </script>\n\t<?php\n\t\techo '<div class=\"site-slider\">';\n\t\techo '<div id=\"slides\">';\n echo '<ul class=\"slides-container\">';\n foreach ( $photos as $photo ) : \n echo '<li>' . wp_get_attachment_image( $photo, 'post-slide' ) . '</li>';\n \tendforeach;\n echo '</ul>';\n echo '<nav class=\"slides-navigation\">';\n\t echo '<a href=\"#\" class=\"next\"><i class=\"fa fa-chevron-right\"></i></a>';\n\t echo '<a href=\"#\" class=\"prev\"><i class=\"fa fa-chevron-left\"></i></a>';\n\t echo '</nav>';\n\t\techo ' </div> <!-- #slides -->';\n echo '</div> <!-- .site-slider -->';\n\t}\n}",
"function mySlider(){\n\t// $slider['images'] = ['glavnii' => [\n\t// ['img' => '1.jpg', 'title' => 'Праздник дня рождения', 'text' => 'Веселые ребята и их родители с нашими аниматорами'],\n\t// ['img' => '2.jpg', 'title' => 'Праздник дня рождения', 'text' => 'Веселые ребята и их родители с нашими аниматорами'],\n\t// ['img' => '3.jpg', 'title' => 'Праздник дня рождения', 'text' => 'Веселые ребята и их родители с нашими аниматорами'],\n\t// ]];\n\t// setOption('MySliders', $slider, true);\n\tinclude 'settings.php';\n}",
"function lucid_slider( $id ) {\n\t$slider = new Lucid_Slider( $id );\n\t$slider->display_slider();\n}",
"function wpbm_slider_images(){\n global $wpdb;\n include( 'inc/admin/wpbm-slider-image.php' );\n die();\n }",
"public function sliders()\n {\n \n $this->data['main_title']='Sliders';\n $this->data['url_title']='Sliders';\n $param=[];\n $this->data['slider_details']=$this->settings->sliderList($param);\n $this->load->view('slider/manage_slider',$this->data);\n }",
"function get_slider_view()\r\n\t{\r\n\t\t$sort = get_option('sort'); if(empty($sort)){\r\n\t\t\t$sort = \"post_date\";\r\n\t\t}\r\n\t\t$order = get_option('order'); if(empty($order)){\r\n\t\t\t$order = \"DESC\";\r\n\t\t} // Non utilise\r\n\t\t$limit = get_option('limit'); if(empty($limit)){\r\n\t\t\t$limit = 350;\r\n\t\t} // Non utilise\r\n\t\t$points = get_option('points'); if(empty($points)){\r\n\t\t\t$points = \"...\";\r\n\t\t}\r\n\t\t$post_limit = get_option('limit_posts'); if(empty($limit_posts)){\r\n\t\t\t$limit_posts = \"-1\";\r\n\t\t}\r\n\t\t$auto_switch = get_option('auto_switch'); if(empty($auto_switch)){\r\n\t\t\t$auto_switch = \"1\";\r\n\t\t} // 1 = true, 0 = false\r\n\t\t$timeout = get_option('timeout'); if(empty($timeout)){\r\n\t\t\t$timeout = 5000;\r\n\t\t} // temps de transition par defaut\r\n\r\n\t\t$img_width = get_option('img_width');\r\n\t\tif(empty($img_width)) {\r\n\t\t\t$img_width = 580;\r\n\t\t}\r\n\r\n\t\t$img_height = get_option('img_height');\r\n\t\tif(empty($img_height)) {\r\n\t\t\t$img_height = 300;\r\n\t\t}\r\n\r\n\t\t// Get the slider content\r\n\t\tglobal $wpdb;\r\n\t\tglobal $post;\r\n\r\n\t\t$args = array( 'meta_key' => 'fading_slider',\r\n\t\t\t\t'meta_value'=> '1', // Seulement les objets dont la case est cochée dans le back\r\n\t\t\t\t'suppress_filters' => 0,\r\n\t\t\t\t'post_type' => array('post', 'page'),\r\n\t\t\t\t'orderby' => $sort,\r\n\t\t\t\t'order' => 'DESC', \t// DESC = Show last post first\r\n\t\t\t\t'numberposts'=> 4); // HTML Markup only allows 4 slides\r\n\r\n\t\t$myposts = get_posts( $args );\r\n\r\n\t\tif (function_exists('add_image_size')) {\r\n\t\t\tadd_image_size( 'fading_slider', $img_width, $img_height, true ); // Miniatures des archives\r\n\t\t}\r\n\r\n\t\t/* PHP Generated Styles here */\r\n\t\t?>\r\n\t\t<style type=\"text/css\">\r\n\r\n\t\t\t#fading_slider {\r\n\t\t\t\tbackground-color: #<?php $bg = get_option('fading_slider_bg'); if(!empty($bg)) {echo $bg;} else {echo \"FFF\";}?>;\r\n\t\t\t\tborder: 8px solid #<?php $border = get_option('fading_slider_border'); if(!empty($border)) {echo $border;} else {echo \"CCC\";}?>;\r\n\t\t\t\twidth: <?php $width = get_option('fading_slider_width'); if(!empty($width)) {echo $width;} else {echo \"580\";}?>px;\r\n\t\t\t}\r\n\t\t<?php\r\n\r\n\t\t\t$i = 1;\r\n\t\t\tforeach( $myposts as $post ) : setup_postdata($post);\r\n\r\n\t\t\t\t$custom = get_post_custom($post->ID);\r\n\t\t\t\techo \"/* ID POST : \" . $post->ID . \"*/\";\r\n\t\t\t\t$thumb = $this->get_wp_generated_thumb( get_the_post_thumbnail( $post->ID ) );\r\n\t\t\t\t// $thumb = $this->get_wp_generated_thumb( get_the_post_thumbnail($post->ID, \"fading_slider\") );\r\n\r\n\t\t\t\techo \".cr-container input.cr-selector-img-\".$i.\":checked ~ .cr-bgimg,\r\n\t\t.cr-bgimg div span:nth-child(\".$i.\"){\r\n\t\t background-image: url(\".$thumb.\");\r\n\t\t}\\n\";\r\n\r\n\t\t\t\t$i++;\r\n\t\t\tendforeach; wp_reset_postdata();\r\n\r\n\t\t?>\r\n\t\t</style>\r\n\r\n\t\t<div id=\"fading_slider\">\r\n\r\n <section class=\"cr-container\">\r\n\r\n <!-- boutons cliquables -->\r\n <input id=\"select-img-1\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-1 current\" checked/>\r\n <label for=\"select-img-1\" class=\"cr-label-img-1\">1</label>\r\n\r\n \t<input id=\"select-img-2\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-2\" />\r\n <label for=\"select-img-2\" class=\"cr-label-img-2\">2</label>\r\n\r\n \t<input id=\"select-img-3\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-3\" />\r\n <label for=\"select-img-3\" class=\"cr-label-img-3\">3</label>\r\n\r\n \t<input id=\"select-img-4\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-4\" />\r\n <label for=\"select-img-4\" class=\"cr-label-img-4\">4</label>\r\n\r\n\t <div class=\"clr\"></div>\r\n\r\n\t\t<!-- images (tranches) -->\r\n\t\t<div class=\"cr-bgimg\">\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 1 - Image 1</span>\r\n\t\t\t\t<span>Tranche 1 - Image 2</span>\r\n\t\t\t\t<span>Tranche 1 - Image 3</span>\r\n\t\t\t\t<span>Tranche 1 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 2 - Image 1</span>\r\n\t\t\t\t<span>Tranche 2 - Image 2</span>\r\n\t\t\t\t<span>Tranche 2 - Image 3</span>\r\n\t\t\t\t<span>Tranche 2 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 3 - Image 1</span>\r\n\t\t\t\t<span>Tranche 3 - Image 2</span>\r\n\t\t\t\t<span>Tranche 3 - Image 3</span>\r\n\t\t\t\t<span>Tranche 3 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 4 - Image 1</span>\r\n\t\t\t\t<span>Tranche 4 - Image 2</span>\r\n\t\t\t\t<span>Tranche 4 - Image 3</span>\r\n\t\t\t\t<span>Tranche 4 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n\t\t<!-- titles -->\r\n\t\t<div class=\"cr-titles\">\r\n\r\n<?php\r\n\t$i = 1;\r\n\tforeach( $myposts as $post ) :\tsetup_postdata($post);\r\n\r\n\t\t\t// $custom = get_post_custom($post->ID);\r\n\t\t\t$thumb = $this->get_wp_generated_thumb( get_the_post_thumbnail($post->ID, \"fading_slider\") );\r\n?>\r\n\r\n\t\t\t<h3>\r\n\t\t\t\t<?php\r\n\t\t\t\t\t$category = get_the_category();\r\n\t\t\t\t\techo \"<span>\".$category[0]->cat_name.\"</span>\\n\";\r\n\t\t\t\t?>\r\n\t\t\t\t<span><a class=\"lienArticle\" href=\"<?php the_permalink();?>\" title=\"<?php _e(\"Read post\", \"wp-fading-content-slider-locale\");?>\"><?php the_title();?></a></span>\r\n \t<a class=\"lienImage\" href=\"<?php the_permalink();?>\" title=\"<?php _e(\"Read post\", \"wp-fading-content-slider-locale\");?>\"></a>\r\n\t\t\t</h3>\r\n\r\n<?php\r\n\t$i++;\r\n\tendforeach; wp_reset_postdata();\r\n?>\r\n\r\n </div>\r\n\r\n </section>\r\n\r\n</div>\r\n\r\n<script type=\"text/javascript\">\r\n\tvar $j = jQuery.noConflict();\r\n\tvar i = 2; // premier switch vers image 2\r\n\r\n\tfunction switchImage()\r\n\t{\r\n\t\t$j(\".current\").removeAttr('checked');\r\n\t\t$j(\".current\").removeClass('current');\r\n\r\n\t\t$j(\"#select-img-\"+i).addClass('current');\r\n\t\t$j(\"#select-img-\"+i).attr('checked', true);\r\n\r\n\t\tif (i==4)\r\n\t\t{\r\n\t\t\ti=1; // retour au debut sur image 1\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ti++; // image suivante\r\n\t\t}\r\n\t}\r\n\r\n\t$j(document).ready(function(){ //on lance l'annimation en boucle toute les 5 secondes (5000 miliseconde)\r\n\t\t<?php if ($auto_switch == \"1\") echo \"setInterval('switchImage();', \".$timeout.\");\\n\"; ?>\r\n\t});\r\n\r\n</script>\r\n\r\n\t\t<?php\r\n\r\n\t\t// TODO This should be prettier in the next version\r\n\t\t// include ( plugins_url() . '/wp-fading-content-slider/views/display.php' );\r\n\t}",
"public function sliderread()\n {\n $data['sliders'] = $this->admin_m->geAlltSliders();\n $data['content'] = 'admin/sliderread';\n $this->load->view('components/template', $data);\n }",
"function tfuse_slideshow($atts, $content) {\n global $slide;\n $slide = array();\n extract(shortcode_atts(array('type_size' => ''), $atts));\n $get_slideshow = do_shortcode($content);\n $uniq = rand(1, 400);\n $i = 0;\n $output = '<div class=\"slider slider_'.$type_size.'\">\n <div class=\"slider_container clearfix\" id=\"slider'.$uniq.'\">';\n while (isset($slide['type'][$i])) {\n if( $slide['type'][$i]=='image' )\n {\n if($type_size=='medium'){\n $width = 600;\n $height = 338;\n }\n elseif($type_size=='small'){\n $width = 430;\n $height = 242;\n }\n else{\n $width = 240;\n $height = 135;\n }\n $getimage = new TF_GET_IMAGE();\n $img = $getimage->width($width)->height($height)->src($slide['content'][$i])->get_img();\n $output .= '<div class=\"slider-item\">'.$img .'</div>';\n }\n else $output .= ' <div class=\"slider-item\"><div class=\"inner\">'.$slide['content'][$i].'</div></div>';\n $i++;\n }\n $output .= '</div>\n <div class=\"slider_pagination\" id=\"slider'.$uniq.'_pag\"></div>\n </div>\n <script>\n jQuery(document).ready(function($) {\n $(\"#slider'.$uniq.'\").carouFredSel({\n pagination : \"#slider'.$uniq.'_pag\",\n infinite: false,\n auto: false,\n height: \"auto\",\n items: 1,\n scroll: {\n fx: \"fade\",\n duration: 200\n }\n });\n });\n </script>';\n return $output;\n}",
"public function slide(){\r\n\t\t\r\n\t}",
"function auxin_metabox_fields_general_slider(){\n $slider_ids = array( 'none' => __( 'Choose ..', 'phlox') );\n\n $args = array(\n 'post_type' => 'slider',\n 'orderby' => \"date\",\n 'post_status' => 'publish',\n 'posts_per_page' => -1\n );\n\n $th_query = null;\n $th_query = new WP_Query( $args );\n if( $th_query->have_posts() ): while ( $th_query->have_posts() ) : $th_query->the_post();\n $opts = get_post_meta( $th_query->post->ID, 'slider-data', true );\n if( ! isset( $opts ) || ! is_array( $opts ) ) continue;\n $type = $opts[\"type\"];\n $slider_ids[ $th_query->post->ID ] = '['.$type.' ] '. get_the_title();\n unset( $args, $opts, $type );\n endwhile; endif;\n wp_reset_postdata();\n\n\n // Get all revslider aliases----------------------------------------\n\n if ( class_exists('RevSlider') ) { // if revSlider is active\n\n $slider = new RevSlider();\n $arrSliders = $slider->getArrSliders();\n\n foreach ($arrSliders as $slider) {\n $slider_ids[ $slider->getAlias() ] = '[revo ] '.$slider->getTitle();\n }\n\n unset( $slider, $arrSliders );\n }\n\n // Get all layeslider items ----------------------------------------\n\n // Check if the file is available to prevent warnings\n if( class_exists('LS_Sliders') ) {\n\n // Get WPDB Object\n global $wpdb;\n\n // Table name\n $table_name = $wpdb->prefix . \"layerslider\";\n\n // Get sliders\n $sliders = $wpdb->get_results( \"SELECT * FROM $table_name\n WHERE flag_hidden = '0' AND flag_deleted = '0'\n ORDER BY date_c ASC LIMIT 100\" );\n\n // Iterate over the sliders\n foreach($sliders as $key => $item) {\n $slider_ids['ls_'.$item->id] = '[layer] '. $item->name;\n }\n\n }\n\n // Get all cute slider items ---------------------------------------\n\n // Check if the file is available to prevent warnings\n if( function_exists('cuteslider_init') ) {\n\n // Get WPDB Object\n global $wpdb;\n\n // Table name\n $table_name = $wpdb->prefix . \"cuteslider\";\n\n // Get sliders\n $sliders = $wpdb->get_results( \"SELECT * FROM $table_name\n WHERE flag_hidden = '0' AND flag_deleted = '0'\n ORDER BY date_c ASC LIMIT 100\" );\n\n // Iterate over the sliders\n foreach($sliders as $key => $item) {\n $slider_ids['cs_'.$item->id] = '[cute ] '. $item->name;\n }\n\n }\n\n if ( defined( 'MSWP_AVERTA_VERSION' ) ) {\n\n $ms_sliders = get_masterslider_names( true );\n foreach ($ms_sliders as $ms_id => $ms_label ) {\n $slider_ids['ms_'.$ms_id] = '[Master] '. $ms_label;\n }\n }\n\n $slider_ids = apply_filters( 'auxin_page_header_slider_ids', $slider_ids );\n\n /*==================================================================================================\n\n Add Page Option meta box\n\n *=================================================================================================*/\n\n $model = new Auxin_Metabox_Model();\n $model->title = __( 'Slider Options', 'phlox');\n $model->type = array('page');\n $model->fields= array(\n\n array(\n 'title' => __('Page Slider', 'phlox'),\n 'description' => __('Please select the slider you want to display at top of the page.', 'phlox'),\n 'id' => 'top_slider_id',\n 'id_deprecated' => 'top_slider_id',\n 'type' => 'select',\n 'choices' => $slider_ids\n ),\n array(\n 'title' => __('Slider top margin', 'phlox'),\n 'description' => __('The height of empty space above page slider in pixel.', 'phlox'),\n 'id' => 'top_slider_margin_top',\n 'type' => 'text',\n 'default' =>''\n ),\n array(\n 'title' => __('Slider bottom margin', 'phlox'),\n 'description' => __('The height of empty space below page slider in pixel.', 'phlox'),\n 'id' => 'top_slider_margin_bottom',\n 'type' => 'text',\n 'default' =>''\n )\n // array(\n // 'title' => __('Slider Width', 'phlox'),\n // 'description' => __('If you choose \"Full\", the slider fits to the page width.<br/>', 'phlox'),\n // 'id' => 'top_slider_width',\n // 'id_deprecated' => 'top_slider_width',\n // 'type' => 'select',\n // 'default' => 'full',\n // 'choices' => array(\n // 'full' => __('Full' , 'phlox'),\n // 'boxed' => __('Boxed', 'phlox')\n // )\n // ),\n );\n\n return $model;\n}",
"function nirvana_ppslider_output( $slides ) {\n\t$nirvanas = nirvana_get_theme_options();\n\textract($nirvanas);\n\n\tif (count($slides)>0): ?>\n\t<div class=\"slider-wrapper theme-default <?php if($nirvana_fpsliderarrows==\"Visible on Hover\") echo \"slider-navhover\"; ?> slider-<?php echo preg_replace(\"/[^a-z0-9]/i\",\"\", strtolower($nirvana_fpslidernav)); ?>\">\n\t\t <div class=\"ribbon\"></div>\n\t\t <div id=\"slider\" class=\"nivoSlider\">\n\t\t<?php foreach( $slides as $id => $slide ):\n\t\t\t\tif ( $slide['image'] ) { ?>\n\t\t\t\t<a href=\"<?php echo ($slide['link'] ? $slide['link'] : '#'); ?>\">\n\t\t\t\t\t<img src=\"<?php echo $slide['image']; ?>\" data-thumb=\"<?php echo $slide['image']; ?>\" alt=\"<?php echo ( $slide['title'] ? esc_attr($slide['title']) : '' ); ?>\" <?php if ($slide['title'] || $slide['text']) : ?>title=\"#caption<?php echo $id;?>\" <?php endif; ?> />\n\t\t\t\t</a><?php } ?>\n\t\t <?php endforeach; ?>\n\t\t </div>\n\t\t <?php foreach( $slides as $id => $slide ): ?>\n\t\t\t\t<div id=\"caption<?php echo $id;?>\" class=\"nivo-html-caption\">\n\t\t\t\t\t<h2> <?php echo $slide['title'] ?></h2>\n\t\t\t\t\t<div class=\"slider-text-separator\"></div>\n\t\t\t\t\t<div class=\"slide-text\"> <div class=\"inline-slide-text\"> <?php echo $slide['text'] ?></div> </div>\n\t\t\t\t\t<?php if($nirvana_slidereadmore && $slide['link'] ) { ?>\n\t\t\t\t\t<div class=\"readmore\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url($slide['link']) ?>\"><?php echo esc_attr($nirvana_slidereadmore) ?> <i class=\"column-arrow\"></i> </a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</div>\n\n\t\t<?php endforeach; ?>\n\t\t </div>\n\t<?php endif;\n}",
"function getbanners()\n\t\t{\n\t\t\t$banners = $this->manage_content->getValue('banner_info','*');\n\t\t\techo '<div id=\"add_space\">';\n\t\t\tforeach($banners as $banner)\n\t\t\t{\n\t\t\t\tif($banner['banner_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$banner['banner_link'].'\">';\n\t\t\t\t\techo '<div class=\"add_section\"><img src=\"images/'.$banner['banner_image'].'\" style=\"height:'.$banner['banner_height'].'px;width:'.$banner['banner_width'].'px;float:left;\"/></div></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}",
"static public function slider_config() {\n ?>\n\n /**\n * J'ai simplement recopié le script du plugin pour pouvoir modifier les\n * caractéristiques du slider car aucun moyen de le configurer n'est \n * mis à dispo dans le backoffice...\n *\n * source https://github.com/sayful1/filterable-portfolio/blob/master/assets/src/frontend/slider.js\n */\n if (tns) {\n var sliders,\n i,\n slider,\n sliderOuter,\n controls,\n showDots,\n showArrows,\n autoplay,\n autoplayHoverPause,\n autoplayTimeout,\n speed,\n gutter,\n loop,\n lazyload,\n slideBy,\n mobile,\n tablet,\n desktop,\n wideScreen,\n fullHD,\n highScreen;\n\n sliders = document.querySelectorAll('.fp-tns-slider');\n for(i=0;i<sliders.length;i++){\n slider=sliders[i];\n\n sliderOuter = slider.parentNode;\n controls = sliderOuter.querySelector('.fp-tns-slider-controls');\n\n mobile = parseInt(slider.getAttribute('data-mobile'));\n tablet = parseInt(slider.getAttribute('data-tablet'));\n desktop = parseInt(slider.getAttribute('data-desktop'));\n wideScreen = parseInt(slider.getAttribute('data-wide-screen'));\n fullHD = parseInt(slider.getAttribute('data-full-hd'));\n highScreen = parseInt(slider.getAttribute('data-high-screen'));\n\n showDots = slider.getAttribute('data-dots') === 'true';\n showArrows = slider.getAttribute('data-arrows') === 'true';\n\n autoplay = slider.getAttribute('data-autoplay') === 'true';\n autoplayHoverPause = slider.getAttribute('data-autoplay-hover-pause') === 'true';\n // Default is 5000\n autoplayTimeout = 10000;\n // Default is 500\n speed = 1000;\n\n gutter = parseInt(slider.getAttribute('data-gutter'));\n loop = slider.getAttribute('data-loop') === 'true';\n lazyload = slider.getAttribute('data-lazyload') === 'true';\n\n slideBy = slider.getAttribute('data-slide-by');\n slideBy = (slideBy === 'page') ? 'page' : parseInt(slideBy);\n\n tns({\n container: slider,\n slideBy: slideBy,\n loop: loop,\n lazyload: lazyload,\n autoplay: autoplay,\n autoplayTimeout: autoplayTimeout,\n autoplayHoverPause: autoplayHoverPause,\n speed: speed,\n gutter: gutter,\n nav: showDots,\n controls: showArrows,\n controlsContainer: controls ? controls : false,\n edgePadding: 0,\n items: mobile,\n responsive: {\n 600: {items: tablet},\n 1000: {items: desktop},\n 1200: {items: wideScreen},\n 1500: {items: fullHD},\n 1921: {items: highScreen}\n }\n });\n }\n }\n\n\n <?php\n }",
"function cs_get_home_slider(){\n global $cs_theme_option;\n\tif($cs_theme_option['show_slider'] ==\"on\"){\n\t\tif($cs_theme_option['slider_type'] <> \"Revolution Slider\"){?>\n\t\t <div id=\"banner\" class=\"fullwidth\">\n\t\t\t<div class=\"fullwidth\" id=\"bannerwrapp\">\n\t\t\t <?php \n\t\t\t\t if($cs_theme_option['layout_option']== \"wrapper\"){\n\t\t\t\t\t\t $width = 1270;\n\t\t\t\t\t\t $height = 500;\n\t\t\t\t } else {\n\t\t\t\t\t\t $width = 1170;\n\t\t\t\t\t\t $height = 430;\n\t\t\t\t }\n\t\t\t\t $slider_slug = $cs_theme_option['slider_name'];\n\t\t\t\t if($slider_slug <> ''){\n\t\t\t\t\t $args=array(\n\t\t\t\t\t\t'name' => $slider_slug,\n\t\t\t\t\t\t'post_type' => 'cs_slider',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'showposts' => 1,\n\t\t\t\t\t );\n\t\t\t\t\t $get_posts = get_posts($args);\n\t\t\t\t\t if($get_posts){\n\t\t\t\t\t\t $slider_id = $get_posts[0]->ID;\n\t\t\t\t\t\t if($cs_theme_option['slider_type'] == 'Flex Slider'){\n\t\t\t\t\t\t\tcs_flex_slider($width,$height,$slider_id);\n\t\t\t\t\t\t }\n\t\t\t\t\t } else {\n\t\t\t\t\t\t $slider_id = '';\n\t\t\t\t\t\t echo '<div class=\"box-small no-results-found heading-color\"> <h5>';\n\t\t\t\t\t\t\t\t _e(\"No results found.\",'Rocky');\n\t\t\t\t\t\t echo ' </h5></div>';\n\t\t\t\t\t }\n\t\t\t\t }\n \t\t\t\t?>\n\t\t\t</div>\n\t\t </div>\n\t\t<?php \n\t\t}else{\n\t\t\techo do_shortcode(htmlspecialchars_decode($cs_theme_option['slider_id']));\t\n\t\t}\n\t}\n}",
"function wpsight_sylt_image_slider( $post_id = '', $args = array() ) {\n\techo wpsight_sylt_get_image_slider( $post_id, $args );\n}",
"public function show(Slider $slider)\n {\n //\n }",
"function nirvana_pp_slider() {\n\t$nirvanas = nirvana_get_theme_options(); ?>\n\t<script type=\"text/javascript\">\n\tjQuery(document).ready(function() {\n\t\tjQuery('#slider').nivoSlider({\n\t\t\teffect: '<?php echo esc_html($nirvanas['nirvana_fpslideranim']); ?>',\n\t\t\tanimSpeed: <?php echo esc_html($nirvanas['nirvana_fpslidertime']); ?>,\n\t\t\t<?php if ($nirvanas['nirvana_fpsliderarrows']==\"Hidden\"): ?>directionNav: false,<?php endif;\n\t\t\tif ($nirvanas['nirvana_fpsliderarrows']==\"Always Visible\"): ?>directionNavHide: false,<?php endif; ?>\n\t\t\t//controlNavThumbs: true,\n\t\t\tbeforeChange: function(){\n\t\t\t\tjQuery('.nivo-caption h2').addClass('nivo-caption-mate');\n\t\t\t\tjQuery('.inline-slide-text').fadeOut(500);\n\t\t\t\tjQuery('.inline-slide-text').css({'opacity':'100','display':'inline'});\n\t\t\t\tjQuery('.readmore').fadeOut(500);\n\t\t\t\tjQuery('.readmore').css({'opacity':'100','display':'table'});\n\t\t\t},\n\t\t\tpauseTime: <?php echo esc_html($nirvanas['nirvana_fpsliderpause']); ?>\n\t\t});\n\t});\n\t</script>\n\t<?php\n}",
"function carouf_show($limit = 10){\n\n wp_enqueue_script(\"jquery\", plugins_url(\"/carouF/js/jquery.js\"), null, \"3.4.1\", true);\n wp_enqueue_script(\"caroufredsel\", plugins_url(\"/carouF/js/jquery.carouFredSel-6.2.1.js\"), null, \"5.6.4\", true);\n\n add_action(\"wp_footer\", \"carrousel_script\", 30);\n\n $carrousel = new WP_Query(\"post_type='slide&post_per_page=$limit\");\n ?>\n <div id=\"Mon-carrousel\">\n <?php\n while ($carrousel->have_posts()){\n $carrousel->the_post();\n global $post;\n the_post_thumbnail(\"Caroussel\", array(\"style\" => \"width:1000px !important\"));\n }\n ?>\n </div>\n <?php\n}",
"function template_preprocess_views_lazy_slider(&$variables) {\n $options = $variables['options'] = $variables['view']->style_plugin->options;\n $page = 0;\n $col = 0;\n $items = [];\n $page_attributes_status = TRUE;\n foreach ($variables['rows'] as $result_index => $item) {\n $items[$page]['content'][$col]['content'] = $item;\n if ($page_attributes_status) {\n $page_attributes = [];\n if ($options['page_class_custom']) {\n $page_attributes['class'][] = $options['page_class_custom'];\n }\n $items[$page]['attributes'] = new Attribute($page_attributes);\n $page_attributes_status = FALSE;\n }\n $col_attributes = [];\n if ($options['col_class_custom']) {\n $col_attributes['class'][] = $options['col_class_custom'];\n }\n $items[$page]['content'][$col]['attributes'] = new Attribute($col_attributes);\n if ($col + 1 >= $options['items_per_page']) {\n $col = 0;\n $page_attributes_status = TRUE;\n $page++;\n }\n else {\n $col++;\n }\n }\n if (count($variables['rows']) % $options['items_per_page']) {\n $page++;\n }\n $roles = \\Drupal::currentUser()->getRoles();\n if ($options['page_block'] && (empty($roles) || array_intersect($roles, $variables['options']['show_page_block_roles']))) {\n /** @var \\Drupal\\Core\\Block\\BlockPluginInterface $block_instance */\n $block_instance = $variables['view']->style_plugin->getBlockInstance($options['page_block']);\n if ($block_instance && $block_instance->access(\\Drupal::currentUser())) {\n $items[$page]['content'][0]['content'] = [\n '#theme' => 'block',\n '#attributes' => [],\n '#configuration' => $block_instance->getConfiguration(),\n '#plugin_id' => $block_instance->getPluginId(),\n '#base_plugin_id' => $block_instance->getBaseId(),\n '#derivative_plugin_id' => $block_instance->getDerivativeId(),\n '#id' => $options['page_block'],\n 'content' => $block_instance->build(),\n ];\n $page_attributes = [];\n $page_block_attributes = [];\n if ($options['page_class_custom']) {\n $page_attributes['class'][] = $options['page_class_custom'];\n }\n if ($options['page_block_class_custom']) {\n $page_block_attributes['class'][] = $options['page_block_class_custom'];\n }\n $items[$page]['attributes'] = new Attribute($page_attributes);\n $items[$page]['content'][0]['attributes'] = new Attribute($page_block_attributes);\n }\n }\n $variables['items'] = $items;\n}",
"public function getSlider() {\n\t\treturn($this->slider);\n\t}",
"function _cute_slider($options)\n\t{\n\t\tglobal $meta_fields;\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\n\t?>\n\t\t<div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\t\t<div class=\"container zn_slideshow\">\n\t\t\t\t\t<?php echo do_shortcode('[cuteslider id=\"'.$options['cuteslider_id'].'\"]'); ?>\n\t\t\t\t</div>\n\t\t\t<div class=\"zn_header_bottom_style\"></div>\n\t\t</div><!-- end page_header -->\n\t<?php\t\n\t}",
"function civ_slider(){\n // to use in the WP_Query loop\n global $wpdb;\n $table_name = $wpdb->prefix . 'civ_slider';\n $slides = $wpdb->get_results( \"select * from $table_name order by img_order asc\", 'object');\n\n $f_slide = array();\n $num_slides = count($slides);\n\n foreach ($slides as $slide) {\n array_push($f_slide, $slide->post_id);\n }\n$args = array('post_type' => 'post',\n 'post__in' => $f_slide,\n 'orderby' => 'post__in',\n 'ignore_sticky_posts' => '1'\n);\n\n $slider = new WP_Query($args);\n\n\n while ( $slider->have_posts() ) :\n $slider->the_post(); ?> \n<?php \n //Get the Thumbnail URL\n $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), /*array( 720,405 ),*/ false, '' );\n ?>\n <div class=\"slide\" style=\"background-image:url('<?php echo $src[0]; ?>');\">\n <h2>\n <a href=\"<?php the_permalink(); ?>\">\n <?php the_title(); ?>\n </a>\n </h2>\n <span><?php the_excerpt(); ?></span>\n </div>\n <?php endwhile;\n $wpdb->flush();\nwp_reset_postdata();\n}",
"function wpcoupon_register_slider_widget() {\r\n register_widget( 'WPCoupon_Slider_Widget' );\r\n}",
"public function sliders()\n {\n $this->authCheck();\n\n $sliderData = DB::table('image_sliders')\n ->get();\n \n $sliders=view('admin.slider_list')\n ->with('sliderData',$sliderData);\n\n return view('admin.master')\n ->with('main_content',$sliders);\n }",
"function __construct() {\r\n parent::__construct(\r\n 'st_slider', // Base ID\r\n esc_html__( 'WPCoupon Slider', 'wp-coupon' ), // Name\r\n array(\r\n 'description' => esc_html__( 'Display a Slider', 'wp-coupon' ),\r\n 'classname' => 'st-slider-widget'\r\n ), // Args\r\n array(\r\n 'width' => 530\r\n )\r\n );\r\n }",
"function jdi_slider() {\n\treturn Jet_Data_Importer_Slider::get_instance();\n}",
"function add_slider_settings() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tw-sliders-gallery-settings\">\n\t\t\t<div class=\"tw-sliders-slider-settings\">\n\t\t\t\t<h3><?php _e('Slider Settings','tw-sliders'); ?></h3>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\t\t\t\t\t\n\t\t\t\t\t<input type=\"hidden\" class=\"uid\" data-setting=\"uid\" value=\"0\" />\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Image width','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"width\" data-setting=\"width\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-image-width'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Image height','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"height\" data-setting=\"height\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-image-height'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<?php if($this->transitions) { ?>\n\t\t\t\t\t<label class=\"setting\">\n\n\t\t\t\t\t\t<span><?php _e('Transition','tw-sliders'); ?></span>\n\n\t\t\t\t\t\t<select class=\"transition\" data-setting=\"transition\">\n\t\t\t\t\t\t\t<option value=\"inherit\" selected><?php _e( 'Current setting', 'tw-sliders' ); ?></option>\n\n\t\t\t\t\t\t\t<?php foreach( $this->transitions as $transition => $label ) { ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $transition; ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo $label; ?>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t\t</select>\n\n\t\t\t\t\t</label>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Speed (ms)','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"speed\" data-setting=\"speed\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-speed'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Timeout (ms)','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"timeout\" data-setting=\"timeout\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-timeout'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<?php if($this->navigation) : ?>\n\t\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t\t<span><?php _e('Navigation','tw-sliders'); ?></span>\n\t\t\t\t\t\t<select class=\"navigation\" data-setting=\"navigation\">\n\t\t\t\t\t\t\t<option value=\"inherit\" selected><?php _e('Current setting','tw-sliders'); ?></option>\n\t\t\t\t\t\t\t<?php foreach($this->navigation as $navigate=>$meta) : ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $navigate; ?>\"><?php echo $meta['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</label>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t</script>\n\t\t<?php\n\t}",
"protected function _construct()\n {\n $this->_controller = 'adminhtml_slider';\n $this->_blockGroup = 'Baniwal_OwlCarouselSlider';\n $this->_headerText = __('Sliders');\n $this->_addButtonLabel = __('Add New Slider');\n \n parent::_construct();\n }",
"function header_container_start() { ?>\n\t<!--#slider-container-->\n\t<div id=\"slider-container\">\n<?php\n}",
"function display_slider($args) {\n\t\tglobal $post_id;\n\t\t\n\t\tif(isset($args['ids'])) : //Shortcode based on IDs\n\t\t\t$ids = $args['ids'];\n\t\t\t$images = explode(',',$ids);\n\t\t\t\n\t\t\tif(is_admin()) :\n\t\t\t\tif(!isset($_POST['action']) || $_POST['action'] != 'tw_update_slider') :\n\t\t\t\t\t//A slider is displayed in the back-end. Create the right image sizes.\n\t\t\t\t\t$width = $args['width'];\n\t\t\t\t\t$height = $args['height'];\n\t\t\t\t\tif(!$width) $width = get_option('tw-sliders-image-width');\n\t\t\t\t\tif(!$height) $height = get_option('tw-sliders-image-height');\n\t\t\t\t\t\n\t\t\t\t\tforeach($images as $image_id) :\n\t\t\t\t\t\t$url = wp_get_attachment_url($image_id);\t\t\t\t\t\t\n\t\t\t\t\t\t$this->create_image($url,$width,$height);\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t//Init variables\n\t\t\t\t$shortcode_args = $args;\n\t\t\t\tunset($shortcode_args['ids']);\n\t\t\t\t$shortcode_args['post_id'] = $post_id;\n\t\t\t\t\n\t\t\t\t//Back-end\n\t\t\t\tob_start();\n\t\t\t\tinclude('assets/views/admin-slider.php');\n\t\t\t\treturn ob_get_clean();\n\t\t\telse :\n\t\t\t\t//Init variables\t\t\t\t\n\t\t\t\t$transition = $args['transition'];\n\t\t\t\tif(!$transition || $transition == 'inherit') $transition = get_option('tw-sliders-transition');\n\t\t\t\t\n\t\t\t\t$speed = $args['speed'];\n\t\t\t\tif(!$speed) $speed = get_option('tw-sliders-speed');\n\t\t\t\t\n\t\t\t\t$timeout = $args['timeout'];\n\t\t\t\tif(!$timeout) $timeout = get_option('tw-sliders-timeout');\n\t\t\t\t\n\t\t\t\t$navigation = $args['navigation'];\n\t\t\t\tif(!$navigation || $navigation == 'inherit') $navigation = get_option('tw-sliders-navigation');\n\t\t\t\t\n\t\t\t\t//Image sizes\n\t\t\t\t$width = $args['width'];\n\t\t\t\t$height = $args['height'];\n\t\t\t\tif(!$width) $width = get_option('tw-sliders-image-width');\n\t\t\t\tif(!$height) $height = get_option('tw-sliders-image-height');\n\t\t\t\t\n\t\t\t\t//Collect images\n\t\t\t\t$args['images'] = array();\n\t\t\t\tforeach(explode(',',$ids) as $id) :\n\t\t\t\t\t$image = wp_get_attachment_image_src( $id, 'full');\n\t\t\t\t\t$args['images'][$id] = $this->get_image($image[0],$width,$height);\n\t\t\t\tendforeach;\n\n\t\t\t\t$images = $args['images'];\n\n\t\t\t\textract( apply_filters( 'tw-sliders-args', compact( 'transition', 'speed', 'timeout', 'navigation', 'images' ) ) );\n\n\t\t\t\t$args['images' ] = $images;\n\t\t\t\t\n\t\t\t\t//Front-end\n\t\t\t\tob_start();\n\t\t\t\tinclude('assets/views/slider.php');\n\t\t\t\treturn apply_filters('tw-sliders-output',ob_get_clean(),$args);\n\t\t\tendif;\n\t\telseif($uid = $args['uid']) : //Shortcode based on UID\n\t\t\tif($post_id = $args['post_id']) :\n\t\t\t\t$sliders = get_post_meta($post_id,'_tw-sliders',true);\n\t\t\t\t\n\t\t\t\tif($slider = $sliders[$uid]) return do_shortcode($slider);\n\t\t\tendif;\n\t\tendif;\n\t}",
"function wpzh_load_widget() {\n register_widget( 'sliderHTML2' ); \n}",
"function wpb_carousel_widget() {\n\t register_widget( 'wpb_widget' );\n\t}",
"function setFrontend(){\n\n $base_url = \"http://\".$_SERVER['SERVER_NAME'] . base_path();\n $res = getFilesArray();\n\n $style = \".imgStyle\n\t{\n\t\tborder : 10px solid orange;\n\t}\";\n\n $jquery = 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js';\n drupal_add_js($jquery);\n $bannersArray = \"\";\n\n foreach ($res as $resu) {\n # code...\n $bannersArray =$bannersArray.\"'\".$resu->id.\"'\".\" : \".\"'\".$resu->status.\"'\".\" , \";\n }\n\n /* The following is the javascript to handle ajax calls to set the banners active and inactive */\n\n $js=\"\n //var bannersArray = new Array();\n\tvar bannersArray = {\".$bannersArray.\"};\n\tconsole.log(bannersArray);\n\n\t(function($) {\n\t\t$.fn.myJavascriptFunction = function(data) {\n\t\t\talert(data);\n\t\t};\n\t})(jQuery);\n\n\tfunction imageClicked(param){\n\t\tconsole.log(bannersArray);\n\t\tchangeCaller(param);\n\t}\n\n\tfunction changeCaller(param) {\n\n\t\tif(bannersArray[param.id] == \\\"active\\\"){\n\t\t\tsetBannerInctiveAjaxCall(param);\n\t\t} else {\n\t\t\tsetBannerActiveAjaxCall(param);\n\t\t}\n\n\t}\n\n\tfunction setBannerActiveAjaxCall(param){\n\t\t$.get(\\\"\".$base_url.\"fossee-site-banner/set-banner-active/\\\"+param.id+'/arg'+Math.random()).success(function(data){ \n\t\t\tif(data.result == 'success'){\n\t\t\t\tsetBannerSelected(data.data);\n\t\t\t}\n\n\t\t});\n\n\t}\n\n\tfunction setBannerSelected(id){\n\t onSuccess();\n\t\t//document.getElementById(id).style.border = \\\"10px solid orange\\\";\n\t\t//bannersArray[id] = \\\"active\\\";\n\t}\n\n\tfunction setBannerInctiveAjaxCall(param){\n\t\t$.get(\\\"\".$base_url.\"fossee-site-banner/set-banner-inactive/\\\"+param.id+'/arg'+Math.random()).success(function(data){ \n\t\t\tif(data.result == 'success'){\n\t\t\t\tsetBannerUnselected(data.data);\n\t\t\t}\n\t\t});\n\n\t}\n\n\tfunction setBannerUnselected(id){\n\t onSuccess();\n\t\t//document.getElementById(id).style.border = \\\"0px solid orange\\\";\n\t\t//bannersArray[id] = \\\"inactive\\\";\n\t}\n\n function onSuccess(){\n console.log('Onsuccess called');\n location.reload();\n }\n\n\tfunction changeImage(param) {\n\t\tif(bannersArray[param.id] == \\\"active\\\"){\n\t\t\tparam.style.border = \\\"0px solid orange\\\";\n\t\t\tbannersArray[param.id] = \\\"inactive\\\";\n\t\t} else {\n\t\t\tparam.style.border = \\\"10px solid orange\\\";\n\t\t\tbannersArray[param.id] = \\\"active\\\";\n\t\t}\n\t}\n\n\t\";\n\n drupal_add_js($js, 'inline', 'header');\n}",
"public function GetSliderNews() {\n $model = new News(Database::instance());\n $slider = $model->GetSliderPosts();\n $recent = $model->GetRecentPosts();\n\n $this->data['slider'] = $slider;\n $this->data['recent'] = $recent;\n\n $this->loadView('home', $this->data);\n $this->getLogInfo();\n }",
"function __construct() {\n\n\t\t\t$slider_data = jdi()->get_setting( array( 'slider' ) );\n\n\t\t\tif ( empty( $slider_data ) || empty( $slider_data['path'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->data = $slider_data;\n\n\t\t\tif ( ! $this->get_slides() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}",
"public function createSlider() {\r\n $centerId = $this->centerId;\r\n $sliderSectionsId = 1;\r\n $query = \"SELECT id FROM centers_content_details WHERE center_id=$centerId AND section_id=$sliderSectionsId\";\r\n $sliderContentIdQuery = mysql_query($query, $this->connection);\r\n if (mysql_num_rows($sliderContentIdQuery) > 0) {\r\n $asso = mysql_fetch_assoc($sliderContentIdQuery);\r\n $id = $asso['id'];\r\n $sectionsContent = ' <section class=\"content\">\r\n <section class=\"clearfix\" id=\"homeCorpo\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"span12\">\r\n <div class=\"flexslider flexFullScreen mb40 \">\r\n <ul class=\"slides\">';\r\n $masterQuery = \"SELECT * FROM slider_content_list WHERE slider_id=$id ORDER BY slidePriority\";\r\n $slides = mysql_query($masterQuery, $this->connection);\r\n if (mysql_num_rows($slides) > 0) {\r\n $slideNumber = mysql_num_rows($slides);\r\n if ($slideNumber > 0) {\r\n for ($i = 0; $i <= $slideNumber; $i++) {\r\n while ($sectionResult = mysql_fetch_assoc($slides)) {\r\n\r\n\r\n $j = $i + 1;\r\n $k = $j + 1;\r\n $sectionsContent .=\"<li class='slideN$i'>\r\n <img src='./images/slider/super/$sectionResult[slide_img_Title]' alt='$sectionResult[slide_img_alt]' style='width:100%;height: 420px; padding-bottom: 1px;'/>\r\n <div class='caption $sectionResult[caption]'>\r\n <div class='element$j-$j' data-animation='$sectionResult[animatingTypeBig]'>\r\n <h1>$sectionResult[slide_big_title]</h1>\r\n </div>\r\n <div class='element$j-$k' data-animation='$sectionResult[animatingTypeSmall]'>\r\n <h2>$sectionResult[slide_small_title]</h2>\r\n </div>\r\n </li> \";\r\n $i++;\r\n }\r\n }\r\n\r\n $sectionsContent .='</ul> ';\r\n }\r\n\r\n return $sectionsContent .='</div>\r\n </div>\r\n </div>\r\n </div></section>';\r\n }\r\n }\r\n }",
"function aurum_slick_carousel_mobile_indicator() {\n\n\t?><script>\n\t\tjQuery( document ).ready( jQuery.debounce( 200, function( $ ) {\n\t\t\t$( '.slick-initialized' ).each( function( i, slick ) {\n\t\t\t\tif ( slick.slick.slideCount > 1 ) {\n\t\t\t\t\tvar watcher = scrollMonitor.create( slick, -jQuery( slick ).height() * -0.7 );\n\t\t\t\t\twatcher.enterViewport( function() {\n\t\t\t\t\t\t$( slick ).addClass( 'slick-swipe-sample' );\n\t\t\t\t\t\twatcher.destroy();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t} ) );\n\t</script><?php\n}",
"public function get_slides_for_slider() {\n return $this->slides_to_include;\n }",
"function slide_show()\n \t{\n // Setup show\n $show = ( $this->ipsclass->input['show'] == 'first' ) ? 0 : $this->ipsclass->input['show'];\n\n // Figure out if the user has chosen a value, or if we should go with a default\n $sort_key = ( $this->ipsclass->input['sort_key'] ) ? $this->ipsclass->input['sort_key'] : 'date';\n $order_key = ( $this->ipsclass->input['order_key'] ) ? $this->ipsclass->input['order_key'] : 'DESC';\n $prune_key = ( $this->ipsclass->input['prune_key'] ) ? $this->ipsclass->input['prune_key'] : '30';\n\n if( ! empty( $this->ipsclass->input['cat'] ) )\n {\n $where = \"category_id=\". intval( $this->ipsclass->input['cat'] );\n }\n else\n {\n $where = \"album_id=\". intval( $this->ipsclass->input['album'] );\n }\n\n // Get the picture\n $this->ipsclass->DB->cache_add_query( 'slideshow_image', \n\t\t\t\t\t\t\t array( 'where' => $where,\n\t\t\t\t\t\t\t\t\t 'prune' => $prune,\n 'sort_key' => $sort_key,\n 'order_key' => $order_key,\n 'show' => $show,\n\t\t\t\t\t\t\t), 'gallery_sql_queries' );\t\t\t\t\t\t\t\t\t \n $this->ipsclass->DB->simple_exec();\n \n // Show it\n $i = $this->ipsclass->DB->fetch_row();\n\n if( $this->ipsclass->DB->get_num_rows() )\n {\n $show++;\n $photo = $this->glib->make_image_link( $i );\n $type = ( $this->ipsclass->input['cat'] ) ? \"&cat={$this->ipsclass->input['cat']}\" : \"&album={$this->ipsclass->input['album']}&mid={$i['mid']}\";\n $hfoff = ( $this->ipsclass->input['hfoff'] ) ? \"&hfoff=1\" : \"\";\n\t\t\t\t$close = ( $this->ipsclass->input['closewindow'] ) ? \"&closewindow=1\" : \"\";\n\t\t\t\t$url = \"{$this->ipsclass->base_url}automodule=gallery&cmd=slideshow&show={$show}&duration={$this->ipsclass->input['duration']}&sort_key={$this->ipsclass->input['sort_key']}&order_key={$this->ipsclass->input['order_key']}&prune_key={$this->ipsclass->input['prune_key']}{$type}{$hfoff}{$close}\";\n $this->output .= $this->html->ss_slide( $photo, $url, $i['id'] );\n }\n else\n {\n if( ! empty( $this->ipsclass->input['cat'] ) )\n {\n $url = \"automodule=gallery&cmd=sc&cat={$this->ipsclass->input['cat']}\";\n }\n else\n {\n $url = \"automodule=gallery&cmd=user&user={$this->ipsclass->input['mid']}&op=view_album&album={$this->ipsclass->input['album']}\";\n }\n\n\t\t\t\tif( $this->ipsclass->input['closewindow'] )\n\t\t\t\t{\n\t\t\t\t\techo '<html><body onload=\"javascript:window.close();\"></html>';\n\t\t\t\t\tdie();\n\t\t\t\t}\n \n $this->ipsclass->print->redirect_screen( $this->ipsclass->lang['ss_end'], $url );\n }\n\n // Page Info\n $this->title = $this->ipsclass->vars['board_name'].$this->ipsclass->lang['sep'].$this->ipsclass->lang['gallery'];\n $this->nav[] = \"<a href='\".$this->ipsclass->base_url.\"automodule=gallery'>Gallery</a>\";\n $this->nav[] = $i['caption'];\n\t\t\t\n // -------------------------------------------------------\n // Stat Update!\n // -------------------------------------------------------\n $this->ipsclass->DB->simple_update( 'gallery_images', 'views=views+1', \"id={$i['id']}\", 1 );\n $this->ipsclass->DB->simple_exec();\n\n\t\t\tif( $this->ipsclass->input['hfoff'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->print->pop_up_window( $this->title, $this->output );\n\t\t\t}\n }",
"function tmpl_tevolution_single_slider_script(){\r\n\t$is_edit=(isset($_REQUEST['action']) && $_REQUEST['action']=='edit')?'1':'';\t\r\n\tif(is_single() && $is_edit==''){\r\n\t\tglobal $post;\r\n\t\t$post_id = $post->ID;\r\n\t\tif(get_post_meta($post_id,'_event_id',true)){\r\n\t\t\t$post_id=get_post_meta($post_id,'_event_id',true);\r\n\t\t}\r\n\t\t$slider_more_listing_img = bdw_get_images_plugin($post_id,'tevolution_thumbnail');\r\n\t\t\r\n\t\t/*get the theme setting option*/\r\n\t\t$supreme2_theme_settings = (function_exists('supreme_prefix')) ? get_option(supreme_prefix().'_theme_settings'):'';\r\n\t\t\r\n\t\t/*Slider div id */\r\n\t\t$silde_gallery_id=apply_filters('tmpl_detail_slider_gallery_id','silde_gallery');\r\n\t\t$slider_id=apply_filters('tmpl_detail_slider_id','slider');\r\n\t\t/*tmpl_detail_slider_options filter hook for change any slider option */\r\n\t\t$slider_options = apply_filters('tmpl_detail_slider_options',array('animation'=>'slide','slideshow'=>'false','direction'=>'horizontal','slideshowSpeed'=>7000,'animationLoop'=>'true','startAt'=> 0,'smoothHeight'=> 'true','easing'=> \"swing\",'pauseOnHover'=> 'true','video'=> 'true','controlNav'=> 'true','directionNav'=> 'true','prevText'=> '','nextText'=> '','animationLoop'=>'true','itemWidth'=>'60','itemMargin'=>'20'));\r\n\t\t?>\r\n <script type=\"text/javascript\" async >\r\n\t\t\tjQuery(window).load(function()\r\n\t\t\t{ \r\n\t\t\t\tjQuery('#<?php echo $silde_gallery_id?>').flexslider({\r\n\t\t\t\t\tanimation: '<?php echo $slider_options['animation'];?>',\r\n\t\t\t\t\t<?php if(!empty($slider_more_listing_img) && (count($slider_more_listing_img) < apply_filters('tmpl_slider_image_count',4))):?>\r\n\t\t\t\t\tcontrolNav: false,\r\n\t\t\t\t\tdirectionNav: false,\r\n\t\t\t\t\tprevText: '<?php echo $slider_options['prevText'];?>',\r\n\t\t\t\t\tnextText: '<?php echo $slider_options['nextText'];?>',\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\telse: ?>\r\n\t\t\t\t\tcontrolNav: <?php echo $slider_options['controlNav'];?>,\r\n\t\t\t\t\tdirectionNav: <?php echo $slider_options['directionNav'];?>,\r\n\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\tanimationLoop: false,\r\n\t\t\t\t\tslideshow: <?php echo $slider_options['slideshow'];?>,\r\n\t\t\t\t\titemWidth: <?php echo $slider_options['itemWidth'];?>,\r\n\t\t\t\t\titemMargin: <?php echo $slider_options['itemMargin'];?>,\r\n\t\t\t\t\t <?php if($supreme2_theme_settings['rtlcss'] ==1 || is_rtl() || (isset($_SESSION['rtlcss']) && $_SESSION['rtlcss']==1)){ ?>\r\n\t\t\t\t\trtl: true,\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\ttouch:true,\r\n\t\t\t\t\tasNavFor: '#slider'\r\n\t\t\t\t });\r\n\t\t\t\tjQuery('#<?php echo $slider_id;?>').flexslider(\r\n\t\t\t\t{\r\n\t\t\t\t\tanimation: '<?php echo $slider_options['animation'];?>',\r\n\t\t\t\t\tslideshow: <?php echo $slider_options['slideshow'];?>,\r\n\t\t\t\t\tdirection: '<?php echo $slider_options['direction'];?>',\r\n\t\t\t\t\tslideshowSpeed: 7000,\r\n\t\t\t\t\tanimationLoop: <?php echo $slider_options['animationLoop'];?>,\r\n\t\t\t\t\tstartAt: 0,\r\n\t\t\t\t\tsmoothHeight: <?php echo $slider_options['smoothHeight'];?>,\r\n\t\t\t\t\teasing: '<?php echo $slider_options['easing'];?>',\r\n\t\t\t\t\tpauseOnHover: <?php echo $slider_options['pauseOnHover'];?>,\r\n\t\t\t\t\tvideo: <?php echo $slider_options['video'];?>,\r\n\t\t\t\t\tcontrolNav: <?php echo $slider_options['controlNav'];?>,\r\n\t\t\t\t\tdirectionNav: <?php echo $slider_options['directionNav'];?>,\t\r\n\t\t\t\t\ttouch:true,\t\t\t\t\t\r\n\t\t\t\t\tstart: function(slider)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tjQuery('body').removeClass('loading');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t <?php if($supreme2_theme_settings['rtlcss'] ==1 || is_rtl() || (isset($_SESSION['rtlcss']) && $_SESSION['rtlcss']==1)){ ?>\r\n\t\t\t\t\t,rtl: true,\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/*FlexSlider: Default Settings*/\r\n\t\t</script>\r\n <?php\r\n\t\t\r\n\t}\r\n}",
"function __construct() {\n parent::__construct( false, 'GE Custom Slider Widget' );\n }",
"function create_bootstrap_carousel($string)\n{\n# Nur zum Debug:\n# return \"hier soll mal ein Slider rein\";\n# enthaelt teilweise noch Code, der aktuell nicht benötigt wird, ggf fuer Ausbau\n global $settings, $template;\n $page = isset($GLOBALS['parent_page']) && $GLOBALS['parent_page'] ? $GLOBALS['parent_page'] : PAGE;\n $template->assign('contains_thumbnails', true);\n $template->assign('page', $page);\n $string = explode('|',$string[1]);\n $bootstrap_carousel = $string[0];\n #if(isset($string[1])) $img_class = $string[1];\n $bootstrap_carousel = new Gallery($bootstrap_carousel);\n if($bootstrap_carousel->photos)\n {\n $template->assign('number_of_photos', $bootstrap_carousel->number_of_photos);\n $template->assign('photos', $bootstrap_carousel->photos);\n }\n #$template->assign('lang', Localization::$lang);\n $bootstrap_carousel = $template->fetch(BASE_PATH.'cms/templates/subtemplates/bootstrap-carousel.inc.tpl');\n return $bootstrap_carousel;\n}",
"public function show_slider_detail()\n\t{\n\t\t$sql=\"select * from slider\";\n\t\t$result=$this->db->query($sql);\n\t\twhile($data=$result->fetch_array())\n\t\t{\n\t\t\techo \"<li><h3>$data[title]</h3><p>$data[description]</p></li>\";\n\t\t}\n\t}",
"function thirdtheme_blog_slider()\n {\n add_theme_support('post-thumbnails');\n add_image_size('small',102,102);\n $args = array(\n 'labels' => array('name' =>__('blog slider'),\n 'add_new' =>__('add new blog')),\n \n 'public' => true,\n 'menu_icon' =>'dashicons-buddicons-buddypress-logo',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor','thumbnail',)); \n register_post_type('blogslider',$args);\n }",
"function slider_settings(){\n?>\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_slider]\">Use slider in homepage?</label><br />\n <select name=\"calibrefx-settings[use_slider]\" id=\"calibrefx-settings[use_slider]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_slider')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_slider')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Please select 'Yes' if you want to include slider in homepage. The slider will be placed under primary menu. Leave it to 'No' if you dont want to include slider or want to include slider manually.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_category]\">Slider Category</label><br />\n <select name=\"calibrefx-settings[slider_category]\" id=\"calibrefx-settings[slider_category]\">\n <option value=\"\"><?php _e('All Categories', 'calibrefx'); ?></option>\n <?php\n $terms = get_terms('slidercat', 'hide_empty=0');\n\n foreach($terms as $term){\n echo '<option value=\"'.$term->term_id.'\"'.selected($term->term_id, calibrefx_get_option('slider_category'), false).'>'.$term->name.'</option>';\n }\n ?>\n </select>\n <p class=\"description\"><?php _e(\"This will display slider based on a category. Leave it 'All' if you want to display all slider items.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_num]\">Number of Slider Images</label><br />\n <input type=\"text\" name=\"calibrefx-settings[slider_num]\" id=\"calibrefx-settings[slider_num]\" value=\"<?php echo esc_attr(calibrefx_get_option('slider_num')); ?>\" />\n <p class=\"description\"><?php _e('Please enter number of slider images to be displayed. Enter -1 if you want to display all slider images.'); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_speed]\">Slide Speed</label><br />\n <input type=\"text\" name=\"calibrefx-settings[slider_speed]\" id=\"calibrefx-settings[slider_speed]\" value=\"<?php echo esc_attr(calibrefx_get_option('slider_speed')); ?>\" />\n <p class=\"description\"><?php _e('Please enter your slideshow speed, eg. 700'); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_pause]\">Slide Interval</label><br />\n <input type=\"text\" name=\"calibrefx-settings[slider_pause]\" id=\"calibrefx-settings[slider_pause]\" value=\"<?php echo esc_attr(calibrefx_get_option('slider_pause')); ?>\" />\n <p class=\"description\"><?php _e('The duration between each slide transition'); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_effect]\">Slide Effect</label><br />\n <select name=\"calibrefx-settings[slider_effect]\" id=\"calibrefx-settings[slider_effect]\">\n <?php \n $order_params = array(\n 'fade' => __('Fade', 'calibrefx'),\n 'fadeOut' => __('Fade Out', 'calibrefx'),\n 'scrollHorz' => __('Scroll Horizontal', 'calibrefx'),\n 'none' => __('None', 'calibrefx'),\n );\n\n foreach ($order_params as $value => $name)\n echo '<option value=\"' . esc_attr($value) . '\"' . selected(calibrefx_get_option('slider_effect'), esc_attr($value), false) . '>' . esc_html($name) . '</option>' . \"\\n\";\n ?>\n </select>\n <p class=\"description\"><?php _e('Please select transition types for your slideshow translation effect.'); ?></p>\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_paging]\">Use pagination?</label><br />\n <select name=\"calibrefx-settings[use_paging]\" id=\"calibrefx-settings[use_paging]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_paging')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_paging')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Select 'Yes' if you want to include paging in your slider.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_nav]\">Use navigation?</label><br />\n <select name=\"calibrefx-settings[use_nav]\" id=\"calibrefx-settings[use_nav]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_nav')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_nav')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Select 'Yes' if you want to include previous & next navigation in your slider.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_caption]\">Use caption?</label><br />\n <select name=\"calibrefx-settings[use_caption]\" id=\"calibrefx-settings[use_caption]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_caption')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_caption')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Select 'Yes' if you want to include caption in your slider.\"); ?></p>\n</div>\n<?php \n}",
"function drubo_brand_slider_func($atts,$content){\nob_start();\n $drubo_shortcode_atts = shortcode_atts(array(\n 'slide' => '',\n // css\n 'custom_css' => '',\n 'custom_css_class' => '',\n ),$atts); \n extract($drubo_shortcode_atts);\n\n //custom class\t\t\n\t$wrap_class = apply_filters( 'kc-el-class', $atts );\n\tif( !empty( $custom_class ) ):\n\t \t$wrap_class[] = $custom_class;\n endif;\n\t$extra_class = implode( ' ', $wrap_class );\t\n?>\n<div class=\"<?php echo $extra_class; ?> <?php echo $custom_css_class; ?>\">\n\n\n\t<div class=\"brand-carsoul\">\n\n<?php foreach ($slide as $key => $value) { ?>\n\t\t<!-- Brand Single -->\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"brand-single\">\n\t\t\t\t<a href=\"<?php echo empty($value->url) ? '#' : $value->url; ?>\">\n\t\t\t<img src=\"<?php \n\t\t\t$image_size = apply_filters('','large');\n\t\t\t$img_src = wp_get_attachment_image_src($value->image , $image_size)[0]; \n\t\t\techo $img_src;\n\n\t\t\t?>\" alt=\"\" /></a>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- Brand Single -->\n<?php } ?>\n\n\n\n\t</div>\n\n</div>\n<?php\n return ob_get_clean();\n}",
"function _circ1($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"container zn_slideshow\">\n\n\t\t\t\t<div id=\"ca-container\" class=\"ca-container\">\n <div class=\"ca-wrapper\">\n <?php\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset ( $options['single_circ1'] ) && is_array ( $options['single_circ1'] ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t$thumbs = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $options['single_circ1'] as $slide ) {\t\t\t\t\t\n\n\t\t\t\t\t\t\t\techo '<div class=\"ca-item ca-item-'.$i.'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-item-main\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"background\"></div><!-- background color -->';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_image'] ) && !empty ( $slide['ww_slide_image'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-icon\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '',$slide['ww_slide_image'] , '336','200', true );\n\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" />';\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// TITle\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title'] ) && !empty ( $slide['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h3>'. $slide['ww_slide_title'].'</h3>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc'] ) && !empty ( $slide['ww_slide_desc'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h4>'. $slide['ww_slide_desc'].'</h4>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text'] ) && !empty ( $slide['ww_slide_read_text'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-more\">'.$slide['ww_slide_read_text'].' <span class=\"icon-chevron-right icon-white\"></span></a>';\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Bottom Title\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_bottom_title'] ) && !empty ( $slide['ww_slide_bottom_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<span class=\"ca-starting\">'. $slide['ww_slide_bottom_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-wrapper\">';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content Title\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_content_title'] ) && !empty ( $slide['ww_slide_content_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<h6>'.$slide['ww_slide_content_title'].'</h6>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-close\"><span class=\"icon-remove\"></span></a>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content description\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc_full'] ) && !empty ( $slide['ww_slide_desc_full'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-text\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\techo $slide['ww_slide_desc_full'];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Link\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text_content'] ) && !empty ( $slide['ww_slide_read_text_content'] ) && isset ( $slide['ww_slide_link']['url'] ) && !empty ( $slide['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$slide['ww_slide_link']['url'].'\" target=\"'.$slide['ww_slide_link']['target'].'\">'.$slide['ww_slide_read_text_content'].'</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</div><!-- end ca-item -->';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$i++;\n\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?>\n\n </div><!-- end ca-wrapper -->\n </div><!-- end circular content carousel -->\n\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}",
"public function index()\n {\n $sliders = PhotoSliders::all();\n return view('pages.manageSlider.slider_index',['sliders' => $sliders]);\n }",
"function etheme_create_slider($args, $title = false, $image_width = 215, $image_height = 215, $crop = false, $enable_slider_from = 4, $last_offset = 3){\n\tglobal $wpdb;\n\n\t$product_per_row = etheme_get_option('prodcuts_per_row');\n\t$box_id = rand(1000,10000);\n\t$multislides = new WP_Query( $args );\n\n\tif ( $multislides->have_posts() ) :\n\t\tif ($title) {\n\t\t\t$title_output = '<h4 class=\"slider-title\">'.$title.'</h4>';\n\t\t}\n\t\techo '<div class=\"home-product-grid slider\">';\n\t\t\techo $title_output;\n\t\t\techo '<div>';\n\n\t\t\t$_i=0;\n\n\t\t\twhile ($multislides->have_posts()) : $multislides->the_post();\n\t\t\t\t\t$_i++;\n\n\t\t\t\t\tif(class_exists('Woocommerce')) {\n\t\t\t\t\t\t\tglobal $product;\n\t\t\t\t\t\t\tif (!$product->is_visible()) continue;\n\t\t\t\t\t\t\twoocommerce_get_template_part( 'content', 'product' );\n\t\t\t\t\t}\n\t\t\tendwhile;\n\n\t\t\techo '</div><!-- carousel -->';\n\n\t\t\tif($_i > $enable_slider_from):\n\t\t\t\techo '<div class=\"prev arrow'.$box_id.'\" style=\"cursor: pointer; \"> </div>';\n\t\t\t\techo '<div class=\"next arrow'.$box_id.'\" style=\"cursor: pointer; \"> </div>';\n\t\t\tendif;\n\t\techo '</div><!-- product-slider -->';\n\tendif;\n\n\twp_reset_query();\n\n\tif ($_i>$enable_slider_from) {\n\n\t\tif(etheme_get_option('touch_carusels')) {\n\t\t\t\t$desktopClickDrag = 'true';\n\t\t} else {\n\t\t\t\t$desktopClickDrag = 'false';\n\t\t}\n\n\t\techo '\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.prev\").addClass(\"disabled\");\n\t\t\t\t\t\t\t\tjQuery(\".slider-'.$box_id.'\").iosSlider({\n\t\t\t\t\t\t\t\t\t\tdesktopClickDrag: '.$desktopClickDrag.',\n\t\t\t\t\t\t\t\t\t\tsnapToChildren: true,\n\t\t\t\t\t\t\t\t\t\tinfiniteSlider: false,\n\t\t\t\t\t\t\t\t\t\tnavNextSelector: \".arrow'.$box_id.'.next\",\n\t\t\t\t\t\t\t\t\t\tnavPrevSelector: \".arrow'.$box_id.'.prev\",\n\t\t\t\t\t\t\t\t\t\tlastSlideOffset: '.$last_offset.',\n\t\t\t\t\t\t\t\t\t\tonFirstSlideComplete: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.prev\").addClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonLastSlideComplete: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.next\").addClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonSlideChange: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.next\").removeClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.prev\").removeClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t';\n\t}\n}",
"public function inject_banner() {\n\t\t$this->banner_settings = get_option( 'cookieproCCPASettings' );\n\t\t$this->behavior_settings = get_option( 'cookieproCCPABehaviorSettings' );\n\t\t$this->floatingdata = get_option( 'CookieProCCPAButtonFloatings' );\n\t\tif( ! empty( $this->floatingdata ) ){\n\t\t\t$this->linkenable = $this->floatingdata;\n\t\t} else {\n\t\t\t$this->linkenable = $this->banner_settings;\n\t\t}\n\t\tinclude_once WP_PLUGIN_DIR . '/' . $this->plugin->name . '/assets/html/banner.php';\n\t}",
"function wpsight_sylt_listings_slider( $listings = array(), $args = array() ) {\n\techo wpsight_sylt_get_listings_slider( $listings, $args );\n}",
"private function putResponsitiveStyles() {\n\n\t\t$bannerWidth = $this->slider->getParam( 'width' );\n\t\t$bannerHeight = $this->slider->getParam( 'height' );\n\n\t\t$arrItems = $this->getResponsitiveValues();\n\n\t\t?>\n\t\t<style type='text/css'>\n\t\t\t#<?php echo $this->sliderHtmlID?>, #<?php echo $this->sliderHtmlID_wrapper?> { width:<?php echo $bannerWidth?>px; height:<?php echo $bannerHeight?>px;}\n\t\t\t<?php\n\t\t\tforeach ( $arrItems as $item ) :\n\t\t\t\t$strMaxWidth = '';\n\n\t\t\t\tif ( $item['maxWidth'] >= 0 ) {\n\t\t\t\t\t$strMaxWidth = 'and (max-width: ' . $item['maxWidth'] . 'px)'; }\n\n\t\t\t?>\n\n\t\t\t @media only screen and (min-width: <?php echo $item['minWidth']?>px) <?php echo $strMaxWidth?> {\n\t\t\t \t\t #<?php echo $this->sliderHtmlID?>, #<?php echo $this->sliderHtmlID_wrapper?> { width:<?php echo $item['sliderWidth']?>px; height:<?php echo $item['sliderHeight']?>px;}\n\t\t\t }\n\n\t\t\t<?php\n\t\t\tendforeach;\n\t\t\techo '</style>';\n\t}",
"function redart_slider( $id = false ){\r\n\r\n\t$slider = false;\r\n\r\n\tif( $id || is_home() || get_post_type() == 'page' ) {\r\n\r\n\t\tif( is_home() ) $id = get_option('page_for_posts');\r\n\t\telseif( is_page() ) $id = redart_ID();\r\n\r\n\t\t$slider_key = get_post_meta( $id, '_tpl_default_settings', true );\r\n\t\t\r\n\t\tif( is_array( $slider_key) && array_key_exists('slider_type', $slider_key) ) {\r\n\t\t\t\r\n\t\t\tif( ( $slider_key['slider_type'] == 'revolutionslider' ) && ( array_key_exists( 'revolutionslider_id', $slider_key ) ) && ( array_key_exists( 'show_slider', $slider_key ) ) ) {\r\n\t\t\t\t\r\n\t\t\t\t// revolution slider\r\n\t\t\t\t$slider = '<div id=\"slider\"><div class=\"dt-sc-main-slider\" id=\"dt-sc-rev-slider\">';\r\n\t\t\t\t\t$slider .= do_shortcode('[rev_slider '. $slider_key['revolutionslider_id'] .']');\r\n\t\t\t\t$slider .= '</div></div>';\r\n\t\t\t\r\n\t\t\t} elseif( ( $slider_key['slider_type'] == 'layerslider' ) && ( array_key_exists('layerslider_id', $slider_key) ) && ( array_key_exists( 'show_slider', $slider_key ) ) ) {\r\n\r\n\t\t\t\t// layer slider\r\n\t\t\t\t$slider = '<div id=\"slider\"><div class=\"dt-sc-main-slider\" id=\"dt-sc-layer-slider\">';\r\n\t\t\t\t\t$slider .= do_shortcode('[layerslider id=\"'. $slider_key['layerslider_id'] .'\"]');\r\n\t\t\t\t$slider .= '</div></div>';\r\n\r\n\t\t\t} elseif( ( $slider_key['slider_type'] == 'customslider' ) && ( array_key_exists('customslider_sc', $slider_key) ) && ( array_key_exists( 'show_slider', $slider_key ) ) ) {\r\n\t\r\n\t\t\t\t// Custom Slider\r\n\t\t\t\t$slider = '<div id=\"slider\"><div class=\"dt-sc-main-slider\" id=\"dt-sc-custom-slider\">';\r\n\t\t\t\t\t$slider .= redart_wp_kses(do_shortcode( $slider_key['customslider_sc'] ));\r\n\t\t\t\t$slider .= '</div></div>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $slider;\r\n}",
"function triumph_hero(){\n global $homepage_metabox;\n $id = 'homepage';\n print '<div id=\"hp-top\">';\n print '<div class=\"hp-top-background-block\"></div>';\n $i = 0;\n while($homepage_metabox->have_fields('sliders')):\n $active = $i==0?' active':'';\n $indicators .= '<li data-target=\"#myCarousel_'.$id.'\" data-slide-to=\"'.$i.'\" class=\"'.$active.'\"></li>';\n $items .= '\n <div class=\"item'.$active.'\">\n <div class=\"image_block_wrapper\">\n <div class=\"image_block\" style=\"background: url('.$homepage_metabox->get_the_value('image').') center top no-repeat #000000;background-size: cover;\">\n <div class=\"quote_block\">\n <div class=\"wrap\">\n <div class=\"quote\">'.apply_filters('the_content',$homepage_metabox->get_the_value('quote')).'</div>\n <div class=\"attribution\">'.$homepage_metabox->get_the_value('attribution').'</div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"wrap\">\n <div class=\"content-sidebar-wrap row\">\n <main itemprop=\"mainContentOfPage\" role=\"main\" class=\"content col-md-8 col-sm-12\">\n <article itemtype=\"http://schema.org/CreativeWork\" itemscope=\"itemscope\" class=\"page entry\">\n <header class=\"entry-header\">\n <h1 itemprop=\"headline\" class=\"entry-title\">'.$homepage_metabox->get_the_value('title').'</h1> \n </header>\n <div itemprop=\"text\" class=\"entry-content\">\n '.apply_filters('the_content',$homepage_metabox->get_the_value('content')).'\n </div>\n </article>\n </main>\n <aside itemtype=\"http://schema.org/WPSideBar\" itemscope=\"itemscope\" role=\"complementary\" class=\"sidebar sidebar-primary widget-area col-md-4 hidden-sm hidden-xs\">\n '.apply_filters('the_content',$homepage_metabox->get_the_value('sidebar')).'\n </aside>\n </div>\n </div>\n </div>';\n $i++;\n endwhile;\n print msd_carousel_wrapper($items,array('id' => $id,'indicators' => $indicators));\n print '</div>';\n}",
"public function HomeSlider(){\n $slider = app_home_slider::all();\n return view('app.homeSlider',compact('slider'));\n }",
"function show_slider(){\n ?>\n <section \n id=\"featured\" \n class=\"cycle-slideshow\" \n data-cycle-slides=\"div\"\n data-cycle-fx=\"fade\"\n data-cycle-manual-speed=\"200\" \n data-pause-on-hover=\"true\">\n <?php civ_slider(); ?>\n </section>\n <?php\n}",
"function getDefaultSlideshow($width, $height) \n {\n $options = $this->_options['slideshow']['advanced'];\n $options['slideshow'] = get_option('home').'/?theme-constructor=slideshow&w='.$width.'&h='.$height;\n// $options['thumbPath'] = CONSTRUCTOR_DIRECTORY_URI.\"/libs/timthumb.php?src=\";\n $options = json_encode($options);\n \n echo '<div class=\"wp-sl\"></div>';\n wp_enqueue_script('constructor-slideshow', CONSTRUCTOR_DIRECTORY_URI.'/js/jquery.wp-slideshow.js', array('jquery'));\n wp_print_scripts('constructor-slideshow');\n echo \"\n <script type='text/javascript'>\n /* <![CDATA[ */\n var wpSl = $options;\n /* ]]> */\n </script>\";\n }",
"function wpvideocoach_dashboard_slider_content() {\r\n // Content of our Dashboard slider module\r\n\t$adminurl = admin_url('admin.php?page=wpvideocoach');\r\n\techo \"<div id='logo-slider-wrapper'><ul id='logo-slider'>\";\r\n echo wpvideocoach_videos_slider();\r\n\techo \"</ul></div><div id='dashboard-intro'><p>\" . wpvideocoach_dashboard_slider_introduction() . \"</p><p><a class='button' href='\" . $adminurl . \"'>Watch all videos</a></p></div>\";\r\n\techo wpvideocoach_video_link_color_slider();\r\n\techo \"<div class='clear'></div>\";\r\n}",
"function lucid_slider_get( $id ) {\n\t$slider = new Lucid_Slider( $id );\n\n\treturn $slider->get_slider();\n}",
"public function htheme_lookbooks(){\r\n\r\n\t\t//SETUP VC MAP\r\n\t\tvc_map(\r\n\t\t\tarray(\r\n\t\t\t\t\"name\" => esc_html__( \"Lookbooks Slider\", \"js_composer\" ),\r\n\t\t\t\t\"base\" => \"htheme_lookbooks_slug\",\r\n\t\t\t\t\"class\" => \"\",\r\n\t\t\t\t'icon' => 'htheme_lookbooks_icon',\r\n\t\t\t\t\"category\" => esc_html__( \"Content\", \"js_composer\"),\r\n\t\t\t\t'description' => esc_html__( \"Multiple lookbooks in a slider.\", \"js_composer\" ),\r\n\t\t\t\t\"params\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'type' => 'autocomplete',\r\n\t\t\t\t\t\t'heading' => esc_html__( 'Lookbook collection', 'js_composer' ),\r\n\t\t\t\t\t\t'param_name' => 'htheme_lookbooks',\r\n\t\t\t\t\t\t'settings' => array(\r\n\t\t\t\t\t\t\t'multiple' => true,\r\n\t\t\t\t\t\t\t'sortable' => true,\r\n\t\t\t\t\t\t\t'values' => $this->htheme_get_post_lookbook_autocomplete(),\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'save_always' => true,\r\n\t\t\t\t\t\t'description' => esc_html__( 'List of Lookbooks', 'js_composer' ),\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}",
"function safed_widgets_init() {\n \n register_sidebar( array(\n 'name' => __( 'Widget Banner 1', 'safed' ),\n 'id' => 'banner_area_1',\n 'description' => __( 'Appears with [banner_one]', 'safed' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s safed__dynamic-module\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n \n register_sidebar( array(\n 'name' =>__( 'Widget Banner 2', 'safed'),\n 'id' => 'banner_area_2',\n 'description' => __( 'Appears with [banner_two]', 'safed' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s safed__dynamic-module\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n }",
"public function getFlexSliderHtmlId()\n {\n return 'acx-brandslider-brandslider';\n }",
"function template_preprocess_views_view_multibanner(&$variables) {\n $handler = $variables['view']->style_plugin;\n\n // Fetch classes from handler options.\n if ($handler->options['class']) {\n $class = explode(' ', $handler->options['class']);\n $class = array_map('\\Drupal\\Component\\Utility\\Html::cleanCssIdentifier', $class);\n $variables['list']['attributes'] = new Attribute(array('class' => $class));\n }\n\n // Fetch wrapper classes from handler options.\n if ($handler->options['wrapper_class']) {\n $wrapper_class = explode(' ', $handler->options['wrapper_class']);\n $variables['attributes']['class'] = array_map('\\Drupal\\Component\\Utility\\Html::cleanCssIdentifier', $wrapper_class);\n } else {\n $variables['attributes']['class'] = array();\n }\n\n // Banner layout vars.\n $variables['layout'] = 'default';\n if ($node = \\Drupal::routeMatch()->getParameter('node')) {\n if ($node->hasField('field_multibanner_layout')) {\n $variables['layout'] = $node->get('field_multibanner_layout')->getValue()[0]['value'];\n }\n }\n\n // Banner count class vars.\n $banner_count = count($variables['view']->result);\n $variables['banner_count'] = $banner_count;\n $variables['attributes']['class'][] = 'multibanner';\n $variables['attributes']['class'][] = 'multibanner-total-'. $banner_count;\n\n // Finish rendering.\n template_preprocess_views_view_unformatted($variables);\n}",
"static function add_slides(): void {\r\n self::add_acf_field(self::slides, [\r\n 'label' => 'Slides',\r\n 'min' => 1,\r\n 'max' => 4,\r\n 'layout' => 'row',\r\n 'collapsed' => '',\r\n 'type' => 'repeater',\r\n 'instructions' => 'These are the slides on the front page. These will only display if the slider is set to Medium Big Grid Slide. You can choose one or two slides.',\r\n 'required' => 1,\r\n 'conditional_logic' => 0,\r\n 'button_label' => 'Add slide',\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }",
"public function SliderDpto()\t\n\t{\n\t\t//Muestra todos los departamentos que tienen imagen en el Slider departamental\n\t\t$depto=DB::table('deptos')->get();\n\n\t\t$Slider=DB::table('detalleslider')->get();\n\n\t\t$conteo=1;\n\n\t\treturn View::make('Administrador.SliderDpto.show', array('depto'=>$depto, 'Slider'=>$Slider));\n\t}",
"function nbabanner_block_view($delta = '')\n{\n $block = array();\n \n switch($delta) {\n case 'nbabanner_block': \n $block['subject'] = t('NBA Banners: Block');\n $block['content'] = array(\n 'container' => array(\n '#type' => 'fieldset',\n '#title' => 'NBA Banners: Block',\n '#attributes' => array(\n 'class' => array(\n 'nbabanners'\n )\n )\n )\n );\n \n foreach (_nbabanner_get_banners((variable_get('nbabanner_randomise', 0) == '1')) as $index => $banner) {\n $term = taxonomy_term_view($banner);\n $block['content']['container']['nbabanner' . $index] = array(\n '#markup' => render($term)\n );\n }\n \n \n $block['content']['#attached']['css'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/vendor/flickity.css';\n $block['content']['#attached']['css'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/css/nbabanner.css';\n \n $block['content']['#attached']['js'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/vendor/flickity.js';\n $block['content']['#attached']['js'][] = array(\n 'data' => array(\n 'nbabanner' => array(\n 'autoplay' => variable_get('nbabanner_autoplay', 0),\n 'autoplay_duration' => (float) variable_get('nbabanner_autoplay_duration', 5000)\n )\n ),\n 'type' => 'setting'\n );\n $block['content']['#attached']['js'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/js/nbabanner.js';\n \n break;\n }\n \n return $block;\n}",
"protected function getSmallSlider()\n {\n return array(\n 'first' => $this->getUrlRange(1, $this->lastPage()),\n 'slider' => null,\n 'last' => null,\n );\n }",
"function the1slider_fetch_slider($id){\n\t\t\n\t\t# check if this is a Themes1_Slider post\n\t\tif ( get_post_type($id) !== 'the1_slider' ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t# get slides from post\n\t\t$slides = get_post_meta($id,'slides',true);\n\t\t\n\t\t# if no slides available, stop the function\n\t\tif ( !is_array($slides) || empty($slides) ) return false;\n\t\t\n\t\t# get slider settings. If any option not set, default will be used\n\t\t$settings_defaults = array(\n\t\t\t'width' \t\t=> '',\n\t\t\t'height'\t\t=> '',\n\t\t\t'overlayer-use'\t=> '',\n\t\t\t'fx'\t\t\t=> '',\n\t\t\t'autoplay'\t\t=> '',\n\t\t\t'autoplay_delay'=> '',\n\t\t\t'arrows'\t\t=> '',\n\t\t\t'bottom_bar'\t=> '',\n\t\t\t'thumb_width'\t=> '',\n\t\t\t'thumb_height'\t=> '',\n\t\t\t'tabs_color'\t=> '',\n\t\t);\n\t\t$settings = get_post_meta($id,'settings',true);\n\t\t$settings = ( is_array($settings) ? array_merge($settings_defaults,$settings) : $settings_defaults );\n\t\t\n\t\t# merge $slides and $settings in a single array\n\t\t$slider = array(\n\t\t\t'settings' \t=> $settings,\n\t\t\t'slides' \t=> $slides,\n\t\t);\n\t\t\n\t\t# return $slider\n\t\treturn $slider;\n\t\t\n\t}",
"public static function banner() {?>\n \n <section class=\"container-fluid st-banner\" data-aos=\"fade-up\" data-aos-duration=\"800\">\n \t<div class=\"row container\">\n \t\t<div class=\"col-md-12\">\n \t\t\t<h3 class=\"hero-title-w text-center\">Nos adaptamos a ti</h3>\n \t\t\t<ul>\n \t\t\t\t<li><i class=\"far fa-clock\"></i> <span>Elige tu horario</span></li>\n \t\t\t\t<li><i class=\"far fa-heart\"></i><span>Tarifa plana</span></li>\n \t\t\t\t<li><i class=\"far fa-calendar-check\"></i><span>Empieza cuando\n \t\t\t\t\t\tquieras</span></li>\n \t\t\t</ul>\n \t\t\t<ul>\n \t\t\t\t<li><i class=\"fas fa-university\"></i> <span>Clases en la academia y\n \t\t\t\t\t\ten videoconferencia</span></li>\n \t\t\t\t<li><i class=\"fas fa-edit\"></i><span>Tutorías personalizadas con tu\n \t\t\t\t\t\tCoach de Idioma</span></li>\n \t\t\t</ul>\n \t\t</div>\n \t</div>\n </section>\n \n\t<?php }",
"function smooth_slider_create_multiple_sliders() {\nglobal $smooth_slider;\n?>\n\n<div class=\"wrap\" style=\"clear:both;\">\n <div style=\"margin:10px auto;clear:left;\">\n <a href=\"http://slidervilla.com/\" title=\"Premium WordPress Slider Plugins\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/slidervilla-728.jpg');?>\" alt=\"Premium WordPress Slider Plugins\" /></a>\n </div>\n<h2 style=\"float:left;\"><?php _e('Sliders Created','smooth-slider'); ?></h2>\n<form style=\"float:left;\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\n<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"8046056\">\n<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>\n\n<?php \nif ($_POST['remove_posts_slider']) {\n if ( $_POST['slider_posts'] ) {\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n\t $current_slider = $_POST['current_slider_id'];\n\t foreach ( $_POST['slider_posts'] as $post_id=>$val ) {\n\t\t $sql = \"DELETE FROM $table_name WHERE post_id = '$post_id' AND slider_id = '$current_slider' LIMIT 1\";\n\t\t $wpdb->query($sql);\n\t }\n }\n if ($_POST['remove_all'] == __('Remove All at Once','smooth-slider')) {\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n\t $current_slider = $_POST['current_slider_id'];\n\t if(is_slider_on_slider_table($current_slider)) {\n\t\t $sql = \"DELETE FROM $table_name WHERE slider_id = '$current_slider';\";\n\t\t $wpdb->query($sql);\n\t }\n }\n if ($_POST['remove_all'] == __('Delete Slider','smooth-slider')) {\n $slider_id = $_POST['current_slider_id'];\n global $wpdb, $table_prefix;\n $slider_table = $table_prefix.SLIDER_TABLE;\n $slider_meta = $table_prefix.SLIDER_META;\n\t $slider_postmeta = $table_prefix.SLIDER_POST_META;\n\t if(is_slider_on_slider_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_table WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n\t if(is_slider_on_meta_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_meta WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n\t if(is_slider_on_postmeta_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_postmeta WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n }\n}\nif ($_POST['create_new_slider']) {\n $slider_name = $_POST['new_slider_name'];\n global $wpdb,$table_prefix;\n $slider_meta = $table_prefix.SLIDER_META;\n $sql = \"INSERT INTO $slider_meta (slider_name) VALUES('$slider_name');\";\n $result = $wpdb->query($sql);\n}\nif ($_POST['reorder_posts_slider']) {\n $i=1;\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n foreach ($_POST['order'] as $slide_order) {\n $slide_order = intval($slide_order);\n $sql = 'UPDATE '.$table_name.' SET slide_order='.$i.' WHERE post_id='.$slide_order.'';\n $wpdb->query($sql);\n $i++;\n }\n}\n?>\n<div style=\"clear:both\"></div>\n<?php $url = sslider_admin_url( array( 'page' => 'smooth-slider-settings' ) );?>\n<a href=\"<?php echo $url; ?>\" title=\"<?php _e('Settings Page for Smooth Slider where you can change the color, font etc. for the sliders','smooth-slider'); ?>\"><?php _e('Go to Smooth Slider Settings page','smooth-slider'); ?></a>\n<?php $sliders = ss_get_sliders(); ?>\n\n<div id=\"slider_tabs\">\n <ul class=\"ui-tabs\">\n <?php foreach($sliders as $slider){?>\n <li><a href=\"#tabs-<?php echo $slider['slider_id'];?>\"><?php echo $slider['slider_name'];?></a></li>\n <?php } ?>\n <?php if($smooth_slider['multiple_sliders'] == '1') {?>\n <li><a href=\"#new_slider\"><?php _e('Create New Slider','smooth-slider'); ?></a></li>\n <?php } ?>\n </ul>\n\n<?php foreach($sliders as $slider){?>\n<div id=\"tabs-<?php echo $slider['slider_id'];?>\">\n<form action=\"\" method=\"post\">\n<?php settings_fields('smooth-slider-group'); ?>\n\n<input type=\"hidden\" name=\"remove_posts_slider\" value=\"1\" />\n<div id=\"tabs-<?php echo $slider['slider_id'];?>\">\n<h3><?php _e('Posts/Pages Added To','smooth-slider'); ?> <?php echo $slider['slider_name'];?><?php _e('(Slider ID','smooth-slider'); ?> = <?php echo $slider['slider_id'];?>)</h3>\n<p><em><?php _e('Check the Post/Page and Press \"Remove Selected\" to remove them From','smooth-slider'); ?> <?php echo $slider['slider_name'];?>. <?php _e('Press \"Remove All at Once\" to remove all the posts from the','smooth-slider'); ?> <?php echo $slider['slider_name'];?>.</em></p>\n\n <table class=\"widefat\">\n <thead><tr><th><?php _e('Post/Page Title','smooth-slider'); ?></th><th><?php _e('Author','smooth-slider'); ?></th><th><?php _e('Post Date','smooth-slider'); ?></th><th><?php _e('Remove Post','smooth-slider'); ?></th></tr></thead><tbody>\n\n<?php \n\t/*global $wpdb, $table_prefix;\n\t$table_name = $table_prefix.SLIDER_TABLE;*/\n\t$slider_id = $slider['slider_id'];\n\t//$slider_posts = $wpdb->get_results(\"SELECT post_id FROM $table_name WHERE slider_id = '$slider_id'\", OBJECT); \n $slider_posts=get_slider_posts_in_order($slider_id); ?>\n\t\n <input type=\"hidden\" name=\"current_slider_id\" value=\"<?php echo $slider_id;?>\" />\n \n<?php $count = 0;\t\n\tforeach($slider_posts as $slider_post) {\n\t $slider_arr[] = $slider_post->post_id;\n\t $post = get_post($slider_post->post_id);\t \n\t if ( in_array($post->ID, $slider_arr) ) {\n\t\t $count++;\n\t\t $sslider_author = get_userdata($post->post_author);\n $sslider_author_dname = $sslider_author->display_name;\n\t\t echo '<tr' . ($count % 2 ? ' class=\"alternate\"' : '') . '><td><strong>' . $post->post_title . '</strong><a href=\"'.get_edit_post_link( $post->ID, $context = 'display' ).'\" target=\"_blank\"> '.__( '(Edit)', 'smooth-slider' ).'</a> <a href=\"'.get_permalink( $post->ID ).'\" target=\"_blank\"> '.__( '(View)', 'smooth-slider' ).' </a></td><td>By ' . $sslider_author_dname . '</td><td>' . date('l, F j. Y',strtotime($post->post_date)) . '</td><td><input type=\"checkbox\" name=\"slider_posts[' . $post->ID . ']\" value=\"1\" /></td></tr>'; \n\t }\n\t}\n\t\t\n\tif ($count == 0) {\n\t\techo '<tr><td colspan=\"4\">'.__( 'No posts/pages have been added to the Slider - You can add respective post/page to slider on the Edit screen for that Post/Page', 'smooth-slider' ).'</td></tr>';\n\t}\n\techo '</tbody><tfoot><tr><th>'.__( 'Post/Page Title', 'smooth-slider' ).'</th><th>'.__( 'Author', 'smooth-slider' ).'</th><th>'.__( 'Post Date', 'smooth-slider' ).'</th><th>'.__( 'Remove Post', 'smooth-slider' ).'</th></tr></tfoot></table>'; \n \n\techo '<div class=\"submit\">';\n\t\n\tif ($count) {echo '<input type=\"submit\" value=\"'.__( 'Remove Selected', 'smooth-slider' ).'\" onclick=\"return confirmRemove()\" /><input type=\"submit\" name=\"remove_all\" value=\"'.__( 'Remove All at Once', 'smooth-slider' ).'\" onclick=\"return confirmRemoveAll()\" />';}\n\t\n\tif($slider_id != '1') {\n\t echo '<input type=\"submit\" value=\"'.__( 'Delete Slider', 'smooth-slider' ).'\" name=\"remove_all\" onclick=\"return confirmSliderDelete()\" />';\n\t}\n\t\n\techo '</div>';\n?> \n </tbody></table>\n </form>\n \n \n <form action=\"\" method=\"post\">\n <input type=\"hidden\" name=\"reorder_posts_slider\" value=\"1\" />\n <h3><?php _e('Reorder the Posts/Pages Added To','smooth-slider'); ?> <?php echo $slider['slider_name'];?>(Slider ID = <?php echo $slider['slider_id'];?>)</h3>\n <p><em><?php _e('Click on and drag the post/page title to a new spot within the list, and the other items will adjust to fit.','smooth-slider'); ?> </em></p>\n <ul id=\"sslider_sortable_<?php echo $slider['slider_id'];?>\" style=\"color:#326078\"> \n <?php \n /*global $wpdb, $table_prefix;\n\t$table_name = $table_prefix.SLIDER_TABLE;*/\n\t$slider_id = $slider['slider_id'];\n\t//$slider_posts = $wpdb->get_results(\"SELECT post_id FROM $table_name WHERE slider_id = '$slider_id'\", OBJECT); \n $slider_posts=get_slider_posts_in_order($slider_id);?>\n \n <input type=\"hidden\" name=\"current_slider_id\" value=\"<?php echo $slider_id;?>\" />\n \n <?php $count = 0;\t\n foreach($slider_posts as $slider_post) {\n $slider_arr[] = $slider_post->post_id;\n $post = get_post($slider_post->post_id);\t \n if ( in_array($post->ID, $slider_arr) ) {\n $count++;\n $sslider_author = get_userdata($post->post_author);\n $sslider_author_dname = $sslider_author->display_name;\n echo '<li id=\"'.$post->ID.'\"><input type=\"hidden\" name=\"order[]\" value=\"'.$post->ID.'\" /><strong> » ' . $post->post_title . '</strong></li>'; \n }\n }\n \n if ($count == 0) {\n echo '<li>'.__( 'No posts/pages have been added to the Slider - You can add respective post/page to slider on the Edit screen for that Post/Page', 'smooth-slider' ).'</li>';\n }\n\t\t \n echo '</ul><div class=\"submit\">';\n \n if ($count) {echo '<input type=\"submit\" value=\"Save the order\" />';}\n \n echo '</div>';\n ?> \n </div> \n </form>\n</div> \n \n<?php } ?>\n\n<?php if($smooth_slider['multiple_sliders'] == '1') {?>\n <div id=\"new_slider\">\n <form action=\"\" method=\"post\" onsubmit=\"return slider_checkform(this);\" >\n <h3><?php _e('Enter New Slider Name','smooth-slider'); ?></h3>\n <input type=\"hidden\" name=\"create_new_slider\" value=\"1\" />\n \n <input name=\"new_slider_name\" class=\"regular-text code\" value=\"\" style=\"clear:both;\" />\n \n <div class=\"submit\"><input type=\"submit\" value=\"<?php _e('Create New','smooth-slider'); ?>\" name=\"create_new\" /></div>\n \n </form>\n </div>\n<?php }?> \n</div>\n\n<div style=\"margin:10px auto;clear:left;\">\n <a href=\"http://slidervilla.com/\" title=\"Premium WordPress Slider Plugins\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/slidervilla-728.jpg');?>\" alt=\"Premium WordPress Slider Plugins\" /></a>\n</div>\n\n<div id=\"poststuff\" class=\"metabox-holder has-right-sidebar\"> \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('About this Plugin:','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <ul>\n <li><a href=\"http://www.clickonf5.org/smooth-slider\" title=\"Smooth Slider Homepage\" ><?php _e('Plugin Homepage','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org\" title=\"Visit Internet Techies\" ><?php _e('Plugin Parent Site','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/phpbb/smooth-slider-f12/\" title=\"Support Forum for Smooth Slider\" ><?php _e('Support Forum','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/about/tejaswini\" title=\"Smooth Slider Author Page\" ><?php _e('About the Author','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/go/smooth-slider/\" title=\"<?php _e('Donate if you liked the plugin and support in enhancing Smooth Slider and creating new plugins','smooth-slider'); ?>\" ><?php _e('Donate with Paypal','smooth-slider'); ?></a></li>\n </ul> \n </div> \n\t\t\t</div> \n </div>\n \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Our Facebook Fan Page','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <script type=\"text/javascript\" src=\"http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_GB\"></script><script type=\"text/javascript\">FB.init(\"2aeebe9fb014836a6810ec4426d26f7e\");</script><fb:fan profile_id=\"127760528543\" stream=\"\" connections=\"8\" width=\"270\" height=\"250\"></fb:fan>\n </div> \n\t\t\t</div> \n </div>\n\n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('Credits:','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <ul>\n <li><a href=\"http://sorgalla.com/jcarousel/\" title=\"jCarousel jQuey plugin\" >Riding carousels with jQuery</a></li>\n <li><a href=\"http://acko.net/dev/farbtastic\" title=\"Farbtastic Color Picker by Steven Wittens\" >Farbtastic Color Picker</a></li>\n <li><a href=\"http://jquery.com/\" title=\"jQuery JavaScript Library - John Resig\" >jQuery JavaScript Library</a></li>\n </ul> \n </div> \n\t\t\t</div> \n </div>\n \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('Top Supporters','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <div id=\"smooth_sldr_donations\">\n\t\t\t\t\t <ul>\n <li><a href=\"http://www.jacobwiechman.com/wordpress//\" title=\"Visit Jacob Wiechman - $50\" >Jacob Wiechman - $50</a></li>\n <li><a href=\"http://malamedconsulting.com/\" title=\"Visit Connie Malamed - $25\" >Connie Malamed - $25</a></li>\n <li><a href=\"http://uwaterloo.ca/\" title=\"Visit Trevor Bain - $25\" >Trevor Bain - $25</a></li>\n <li><a href=\"http://www.whatsthebigidea.com/\" title=\"Visit WhatsTheBigIdea.com,Inc. - $20\" >WhatsTheBigIdea.com,Inc. - $20</a></li>\n </ul> \n </div>\n </div> \n\t\t\t</div> \n </div> \n <div style=\"clear:left;\"></div>\n\n <div id=\"side-info-column\" style=\"float:left;width:325px;\"> \n <div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Recommended WordPress Hosting','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <div style=\"margin:10px 5px\">\n <a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/hostgator.gif');?>\" alt=\"Recommended Web Hosting\" /></a>\n <p><a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\">HostGator</a> is one of the world's top 10 largest web hosting companies with more than 5,000,000 hosted domains. You can host your own WordPress installation with custom themes, plugins, and your own domain name with HostGator from only $3.96 a month.</p>\n <p><strong>Features: </strong>UNLIMITED Disk Space and Bandwidth, FREE Site Building Tools and Templates, 24/7/365 Award Winning Technical Support</p>\n <p>For more info visit <a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\">HostGator.com</a></p>\n </div>\n </div></div></div>\n \n \t\t<div id=\"side-info-column\" style=\"float:left;margin-left:1em;width:325px;\"> \n <div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Recommended Themes','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <div style=\"margin:10px 5px\">\n <a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/elegantthemes.gif');?>\" alt=\"Recommended WordPress Themes\" /></a>\n <p><a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\">Elegant Themes</a> are attractive, compatible, affordable, SEO optimized WordPress Themes and have best support in community.</p>\n <p><strong>Beautiful themes, Great support!</strong></p>\n <p><a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\">For more info visit ElegantThemes</a></p>\n </div>\n </div></div></div>\n \n \n <div style=\"clear:left;\"></div>\n </div> <!--end of poststuff --> \n\n\n</div> <!--end of float wrap -->\n<?php\t\n}",
"public function widget_scripts() {\n\t\t\n\t\twp_enqueue_style( 'elementor-main-style', plugins_url( '/assets/style.css', __FILE__ ) ); // Main Slider Main\n\t\twp_register_script( 'core-functions', plugins_url( '/assets/js/main-functions.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\t\n\t\twp_register_script( 'bx-main-slider', plugins_url( '/assets/bxslider/jquery.bxslider.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'bx-main-slider', plugins_url( '/assets/bxslider/bxslider.css', __FILE__ ) ); // BxSlider\n\t\t\n\t\twp_register_script( 'flex-main-slider-js', plugins_url( '/assets/flexslider/jquery_flexslider.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'flex-main-slider-css', plugins_url( '/assets/flexslider/flexslider.css', __FILE__ ) ); // Flexslider\n\t\t\n\t\twp_register_script( 'sliderresponsive-slider-js', plugins_url( '/assets/slider-responsive/sliderresponsive.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'sliderresponsive-slider-js', plugins_url( '/assets/slider-responsive/sliderresponsive.css', __FILE__ ) ); // sliderresponsive\n\t\t\n\t\t\n\t\twp_register_script( 'progressbar-script-js', plugins_url( '/assets/progress-bar/jQuery-plugin-progressbar.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'progressbar-script-css', plugins_url( '/assets/progress-bar/jQuery-plugin-progressbar.css', __FILE__ ) ); // sliderresponsive\n\t\t\n\t\twp_register_script( 'slick-slider-js', plugins_url( '/assets/slick/slick.min.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'slick-slider-css', plugins_url( '/assets/slick/slick.css', __FILE__ ) ); // Slick\n\t\twp_enqueue_style( 'slick-slider-theme', plugins_url( '/assets/slick/slick-theme.css', __FILE__ ) ); // Slick Theme\n\t\t\n\t\twp_register_script( 'owl-slider-js', plugins_url( '/assets/owl_carousel/owl_carousel.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'owl-slider-css', plugins_url( '/assets/owl_carousel/owl_carousel.css', __FILE__ ) ); // OWL\n\t\t\n\t\twp_register_script( 'prettyphoto-main', plugins_url( '/assets/prettyphoto/prettyphoto-main.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_register_script( 'prettyphoto-theme', plugins_url( '/assets/prettyphoto/prettyphoto.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_enqueue_style( 'prettyphoto-theme', plugins_url( '/assets/prettyphoto/prettyphoto.css', __FILE__ ) ); // PrettyPhoto Theme\n\t\t\n\t\twp_enqueue_style('chosen', plugins_url( '/assets/chosen/chosen.min.css', __FILE__ ) );\n\t\twp_enqueue_style('nice-select', plugins_url( '/assets/chosen/selectric.css', __FILE__ ) );\n\t\twp_register_script('chosen', plugins_url( '/assets/chosen/chosen-jquery-min.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_register_script('nice-select', plugins_url( '/assets/chosen/jquery.nice-select.min.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\t\n\n\t\twp_register_script('jplayer-jukebox', plugins_url( '/assets/jplayer/js/jplayer-jukebox.js', __FILE__ ), [ 'jquery' ], false, true );\n\t\twp_register_script('jplayer-playlist', plugins_url( '/assets/jplayer/js/jplayer-playlist-min.js', __FILE__ ), [ 'jquery' ], false, true );\t\t\n\t\twp_register_script('jplayer-core', plugins_url( '/assets/jplayer/js/jquery-jplayer-min.js', __FILE__ ), [ 'jquery' ], false, true );\t\t\n\t\t\n\t\twp_enqueue_style('jplayer-uno', plugins_url( '/assets/jplayer/css/jplayer-uno.css', __FILE__ ) );\n\t\twp_enqueue_style('jplayer-core', plugins_url( '/assets/jplayer/css/jplayer-core.css', __FILE__ ) );\n\t\t\n\t\t\n\t\t\n\t}",
"public function instagramSliderAction($id)\n\t{\n\t\t// get the specified feed\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t$feed = $em->getRepository('StemsSocialBundle:InstagramFeed')->find($id);\n\n\t return $this->render('StemsSocialBundle:Widget:instagramSlider.html.twig', array(\n\t\t\t'feed'\t\t\t=> $feed,\n\t\t));\n\t}",
"function custom_shortcode_slider() \n {\n require_once(TEMPLATEPATH.'/shortcode/shortcode.php');\n }",
"public function index()\n {\n $empt = Slider::all();\n return view('admin.slider.index',compact('empt'));\n }",
"public function getPicturesInSlider(): PictureCollection;",
"function _circ2($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"container zn_slideshow\">\n\n\t\t\t\t<div id=\"ca-container\" class=\"ca-container\">\n <div class=\"ca-wrapper\">\n <?php\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset ( $options['single_circ2'] ) && is_array ( $options['single_circ2'] ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t$thumbs = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $options['single_circ2'] as $slide ) {\t\t\t\t\t\n\n\t\t\t\t\t\t\t\techo '<div class=\"ca-item ca-item-'.$i.'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-item-main\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_image'] ) && !empty ( $slide['ww_slide_image'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-icon\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '',$slide['ww_slide_image'] , '376','440', true );\n\t\t\t\t\t\t\t\t\t\t\t\t$bg = 'style=\"background-image:url('.$image['url'].');\"';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"background\" '.$bg.'></div><!-- background color -->';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// TITle\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title'] ) && !empty ( $slide['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title_left'] ) && !empty ( $slide['ww_slide_title_left'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$title_pos_l = 'left:'.$slide['ww_slide_title_left'].'px;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title_top'] ) && !empty ( $slide['ww_slide_title_top'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$title_pos_t = 'top:'.$slide['ww_slide_title_top'].'px;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"title_circle\" style=\"'.$title_pos_t.' '.$title_pos_l.'\" data-size=\"'.$slide['ww_slide_title_size'].'\">';\n\t\t\t\t\t\t\t\t\t\t\t\techo '<span>'.$slide['ww_slide_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc'] ) && !empty ( $slide['ww_slide_desc'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h4>'. $slide['ww_slide_desc'].'</h4>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text'] ) && !empty ( $slide['ww_slide_read_text'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-more\">'.$slide['ww_slide_read_text'].' <span class=\"icon-chevron-right icon-white\"></span></a>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Bottom Title\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_bottom_title'] ) && !empty ( $slide['ww_slide_bottom_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<span class=\"ca-starting\">'. $slide['ww_slide_bottom_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-wrapper\">';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content Title\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_content_title'] ) && !empty ( $slide['ww_slide_content_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<h6>'.$slide['ww_slide_content_title'].'</h6>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-close\"><span class=\"icon-remove\"></span></a>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content description\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc_full'] ) && !empty ( $slide['ww_slide_desc_full'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-text\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\techo $slide['ww_slide_desc_full'];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Link\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text_content'] ) && !empty ( $slide['ww_slide_read_text_content'] ) && isset ( $slide['ww_slide_link']['url'] ) && !empty ( $slide['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$slide['ww_slide_link']['url'].'\" target=\"'.$slide['ww_slide_link']['target'].'\">'.$slide['ww_slide_read_text_content'].'</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</div><!-- end ca-item -->';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$i++;\n\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?>\n\n </div><!-- end ca-wrapper -->\n </div><!-- end circular content carousel -->\n\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}",
"public function __construct(Slider $slider)\n {\n $this->slider = $slider;\n\n $this->_config = request('_config');\n }",
"function get_main_slider($img)\n{\n$w=\"20\";\n$h=\"10\";\n if(file_exists(\"../banner/\".$img) && $img!='')\n\n$temp =\"<img src=\\\"../include/phpThumb.php?src=../banner/\".$img.\"\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='floatL mar12R'/>\";\nreturn $temp;\t\t\t\n}",
"public function index()\n {\n $p['title'] = 'Admin::Sliders';\n $p['site_branding']= SchoolBranding::all();\n $p['data'] = Slider::all();\n return view('admin.slider.index',$p);\n }",
"public function wd_slide_template_redirect(){\r\n\t\tglobal $wp_query,$post,$page_datas,$smof_data;\r\n\t\tif( $wp_query->is_page() || $wp_query->is_single() ){\r\n\t\t\tif ( has_shortcode( $post->post_content, 'slideshow' ) || has_shortcode( $post->post_content, 'slider' )) { \r\n\t\t\t\tadd_action('wp_enqueue_scripts',array($this,'init_script'));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"function vslider_defaults() {\r\n $default = array(\r\n 'slideNr' => 3,\r\n \t'width' => 630,\r\n \t'height' => 280,\r\n \t'spw' => 7,\r\n \t'sph' => 5,\r\n \t'delay' => 3000,\r\n \t'sDelay' => 30,\r\n \t'opacity' => '0.7',\r\n \t'titleSpeed' => 1500,\r\n \t'effect' => '',\r\n \t'navigation' => 'true',\r\n 'stickynav' => 'false',\r\n \t'links' => 'true',\r\n 'buttons' => 'true',\r\n \t'hoverPause' => 'false',\r\n \t'fontFamily' => 'Arial, Helvetica, sans-serif',\r\n \t'titleFont' => 16,\r\n \t'fontSize' => 12,\r\n \t'textColor' => 'FFFFFF',\r\n \t'bgColor' => '222222',\r\n \t'customImg' => 'true',\r\n 'catchimage' => 'true',\r\n \t'chars' => 200,\r\n \t'excerpt' => 'true',\r\n \t'slide1' => WP_PLUGIN_URL.'/vslider/images/slide1.jpg',\r\n \t'slide2' => WP_PLUGIN_URL.'/vslider/images/slide2.jpg',\r\n \t'slide3' => WP_PLUGIN_URL.'/vslider/images/slide3.jpg',\r\n 'target' => 'none',\r\n 'navstyle' => 'none',\r\n 'arrstyle' => 'none',\r\n 'navplace' => '10px 0 10px 100px',\r\n 'layout' => 'stripe-bottom',\r\n 'borderWidth' => '5',\r\n 'borderRadius' => '0',\r\n 'borderColor' => 'FFFFFF',\r\n 'holdermar' => '10px 10px 10px 10px',\r\n 'holderfloat' => 'none',\r\n 'timthumb' => 1,\r\n 'quality' => '80',\r\n 'vnavenable' => 0,\r\n 'randimg' => 0\r\n );\r\nreturn $default;\r\n}",
"function sl_cyclereact() {\n\t$output .=\"<script type=\\\"text/javascript\\\" src=\\\"\" . get_bloginfo('template_url') . \"/includes/gallery/js/matchmedia.js\\\"></script>\";\n\n\t$output .=\"<script type=\\\"text/javascript\\\" src=\\\"\" . get_bloginfo('template_url') . \"/includes/gallery/js/picturefill.js\\\"></script>\";\n\n\t$output .=\"<script type=\\\"text/javascript\\\" src=\\\"\" . get_bloginfo('template_url') . \"/includes/gallery/js/jquery.cycle2.min.js\\\"></script>\";\n\t\n\t// Make things fit nicely \n\t$output.=\"\n\t<script type=\\\"text/javascript\\\"> \n\t$(window).load(function(){\n\t\tvar setResponsive = function () {\n\t\t var pageHeight = jQuery(window).height();\n\t\t var barHeight = $(\\\"#solofolio-cyclereact-bar\\\").outerHeight();\n\t\t var wrapperWidth = $(\\\"#wrapper\\\").innerWidth();\n\t\t var imgWidth = $(\\\".cycle-slide-active div img\\\").outerWidth();\n\t\t $('img').css('max-height', pageHeight - barHeight - 70 - 0);\n\t\t $('img').css('max-width', wrapperWidth);\n\t\t}\n\t\t$(window).resize(setResponsive);\n\t\tsetResponsive();\n\t\t\n\t});</script>\";\n\t\n\t// Allow keyboard control\n\t$output.=\"<script type=\\\"text/javascript\\\">$(document.documentElement).keyup(function (e) {\n\t\tif (e.keyCode == 39)\n\t\t{ \n\t\t $('#solofolio-cyclereact-images').cycle('next');\n\t\t}\n\n\t\tif (e.keyCode == 37)\n\t\t{\n\t\t\t$('#solofolio-cyclereact-images').cycle('prev');\n\t\t}\n\n\t});</script>\";\n \n echo $output;\n \n}",
"function custom_shortcode_blogslider() \n {\n require_once(TEMPLATEPATH.'/shortcode/shortcode1.php');\n }",
"function rev_slider_shortcode($args, $mid_content = null){\n $zt_params = JComponentHelper::getParams('com_zt_layerslider');\n $js_defer = $zt_params->get('js_defer') ? 'defer=\"defer\"' : '';\n extract(shortcode_atts(array('alias' => ''), $args, 'zt_layerslider'));\n extract(shortcode_atts(array('settings' => ''), $args, 'zt_layerslider'));\n extract(shortcode_atts(array('order' => ''), $args, 'zt_layerslider'));\n\n if($settings !== '') $settings = json_decode(str_replace(array('({', '})', \"'\"), array('[', ']', '\"'), $settings) ,true);\n if($order !== '') $order = explode(',', $order);\n\n $sliderAlias = ($alias != '') ? $alias : ZTSliderFunctions::getVal($args,0);\n\n $gal_ids = check_for_shortcodes($mid_content); //check for example on gallery shortcode and do stuff\n\n ob_start();\n if(!empty($gal_ids)){ //add a gallery based slider\n $slider = ZTSliderOutput::putSlider($sliderAlias, '', $gal_ids);\n }else{\n $slider = ZTSliderOutput::putSlider($sliderAlias, '', array(), $settings, $order);\n }\n $content = ob_get_contents();\n ob_clean();\n ob_end_clean();\n\n if(!empty($slider)){\n // Do not output Slider if we are on mobile\n $disable_on_mobile = $slider->getParam(\"disable_on_mobile\",\"off\");\n if($disable_on_mobile == 'on'){\n $mobile = (strstr($_SERVER['HTTP_USER_AGENT'],'Android') || strstr($_SERVER['HTTP_USER_AGENT'],'webOS') || strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad') || strstr($_SERVER['HTTP_USER_AGENT'],'Windows Phone') || wp_is_mobile()) ? true : false;\n if($mobile) return false;\n }\n\n $show_alternate = $slider->getParam(\"show_alternative_type\",\"off\");\n\n if($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8'){\n if(strstr($_SERVER['HTTP_USER_AGENT'],'Android') || strstr($_SERVER['HTTP_USER_AGENT'],'webOS') || strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad') || strstr($_SERVER['HTTP_USER_AGENT'],'Windows Phone') || wp_is_mobile()){\n $show_alternate_image = $slider->getParam(\"show_alternate_image\",\"\");\n return '<img class=\"tp-slider-alternative-image\" src=\"'.$show_alternate_image.'\" data-no-retina>';\n }\n }\n\n //handle slider output types\n echo \"<link rel='stylesheet' type='text/css' href='\".JUri::root(true) . '/administrator/components/com_zt_layerslider/assets/css/settings.css'.\"'>\";\n echo \"<script type='text/javascript' src='\".JUri::root(true) . '/administrator/components/com_zt_layerslider/assets/js/jquery.themepunch.tools.min.js'.\"' \".$js_defer.\" ></script>\";\n echo \"<script type='text/javascript' src='\".JUri::root(true) . '/administrator/components/com_zt_layerslider/assets/js/jquery.themepunch.revolution.min.js'.\"' \".$js_defer.\" ></script>\";\n echo $content;\n }else\n echo $content; //normal output\n\n }",
"public function display()\n\t{\n\t\t// Check if we have multiple instances of the module running\n\t\t// If so, we only want to push the CSS and JS to the template once\n\t\tif (!self::$multiple_instances)\n\t\t{\n\t\t\t// Push some CSS to the template\n\t\t\t$this->css();\n\t\t\t$this->js();\n\t\t}\n\t\tself::$multiple_instances++;\n\n\t\t// Get the billboard slides\n\t\t$this->slides = $this->getList();\n\n\t\t// Get some parameters\n\t\t$transition = $this->params->get('transition', 'scrollHorz');\n\t\t$random = $this->params->get('random', 0);\n\t\t$timeout = $this->params->get('timeout', 5) * 1000;\n\t\t$speed = $this->params->get('speed', 1) * 1000;\n\t\t$this->collection = $this->params->get('collection', 1);\n\t\t$this->pager = $this->params->get('pager', 'pager');\n\n\t\t// Add the CSS to the template for each billboard\n\t\tforeach ($this->slides as $slide)\n\t\t{\n\t\t\t$background = $slide->background_img ? \"background-image: url('{$slide->background_img}');\" : '';\n\t\t\t$padding = $slide->padding ? \"padding: {$slide->padding};\" : '';\n\n\t\t\t$css =\n\t\t\t\t\"#{$slide->alias} {\n\t\t\t\t\t$background\n\t\t\t\t\t}\n\t\t\t\t#{$slide->alias} p {\n\t\t\t\t\t$padding\n\t\t\t\t\t}\";\n\t\t\t$this->css($css);\n\t\t\t$this->css($slide->css);\n\t\t}\n\n\t\t// Add the CSS to give the pager a unique ID per billboard collection\n\t\t// We need this to manage multiple buildboard pagers potentially moving at different speeds\n\t\t// @TODO: there should be a better way of doing this\n\t\tif ($this->pager != 'null')\n\t\t{\n\t\t\t$js_pager = \"'#{$this->pager}{$this->collection}'\";\n\t\t\t$this->pager = $this->pager . $this->collection;\n\t\t\t$pager =\n\t\t\t\t\".slider #{$this->pager} a.activeSlide {\n\t\t\t\t\topacity:1.0;\n\t\t\t\t\t}\";\n\t\t\t$this->css($pager);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$js_pager = $this->pager;\n\t\t}\n\n\t\t// Add the javascript ready function with variables based on this specific billboard\n\t\t// Pause: true - means the billbaord stops scrolling on hover\n\t\t$js = '\n\t\t\tjQuery(document).ready(function() {\n\t\t\t\t$(\\'#' . $this->collection . '\\').cycle({\n\t\t\t\t\tfx: \"' . $transition . '\",\n\t\t\t\t\ttimeout: ' . $timeout .',\n\t\t\t\t\tpager: ' . $js_pager . ',\n\t\t\t\t\tspeed: ' . $speed . ',\n\t\t\t\t\trandom: ' . $random . ',\n\t\t\t\t\tcleartypeNoBg: true,\n\t\t\t\t\tslideResize: 0,\n\t\t\t\t\tpause: true\n\t\t\t\t});\n\t\t\t});';\n\n\t\t$this->js($js);\n\n\t\trequire $this->getLayoutPath();\n\t}",
"function _static1($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n \n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"zn_slideshow\">\n <div class=\"container\">\n \t<div class=\"static-content default-style\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t// TITLE\n\t\t\t\t\t\tif ( isset ( $options['ww_slide_title'] ) && !empty ( $options['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\techo '<h2 class=\"centered\">'.do_shortcode($options['ww_slide_title']).'</h2>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// SUBTITLE\n\t\t\t\t\t\tif ( isset ( $options['ww_slide_subtitle'] ) && !empty ( $options['ww_slide_subtitle'] ) ) {\n\t\t\t\t\t\t\techo '<h3 class=\"centered\">'.do_shortcode($options['ww_slide_subtitle']).'</h3>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BUTTON\n\t\t\t\t\t\tif ( $options['ww_slide_m_button'] || $options['ww_slide_l_text'] ) {\n\t\t\t\t\t\t\techo '<div class=\"info_pop animated fadeBoxIn\" data-arrow=\"top\">';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( $options['ww_slide_l_text'] && isset ( $options['ww_slide_link']['url'] ) && !empty ( $options['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\techo '<a class=\"buyit\" href=\"'.$options['ww_slide_link']['url'].'\" target=\"'.$options['ww_slide_link']['target'].'\">'.$options['ww_slide_l_text'].'</a>';\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\t// BUTTON LEFT TEXT\n\t\t\t\t\t\t\t\tif ( isset ( $options['ww_slide_m_button'] ) && !empty ( $options['ww_slide_m_button'] ) ) {\n\t\t\t\t\t\t\t\t\techo '<h5 class=\"text\">'.$options['ww_slide_m_button'].'</h5>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '<div class=\"clear\"></div>';\n\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t\n \n </div>\n </div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}",
"public function slider(){\n $this->protect();\n $cavab=$this->dtbs->cedvel('slider');\n $data['melumat']=$cavab;\n $this->load->view('back/slider/anasehife',$data);\n}"
] | [
"0.6413027",
"0.6160981",
"0.6077368",
"0.6052392",
"0.6042752",
"0.6042281",
"0.60197663",
"0.6012841",
"0.5995799",
"0.5962827",
"0.5950274",
"0.5883838",
"0.58270055",
"0.5816112",
"0.5802227",
"0.5781496",
"0.5778411",
"0.57156",
"0.5710932",
"0.56792545",
"0.56592065",
"0.5632769",
"0.5625086",
"0.56216884",
"0.5592635",
"0.5571416",
"0.55677193",
"0.5547814",
"0.5538974",
"0.54957104",
"0.54920965",
"0.545065",
"0.5450474",
"0.5447518",
"0.54474425",
"0.5429515",
"0.54281527",
"0.54180914",
"0.5410406",
"0.54055285",
"0.54030895",
"0.5402773",
"0.5397928",
"0.5395792",
"0.5384456",
"0.53829664",
"0.5367073",
"0.53564316",
"0.53503335",
"0.5349463",
"0.5328153",
"0.5325666",
"0.5316147",
"0.5314839",
"0.5305357",
"0.528144",
"0.52603674",
"0.52566135",
"0.52490336",
"0.5242942",
"0.52348614",
"0.5224109",
"0.52142674",
"0.52047116",
"0.5204701",
"0.5201151",
"0.5190035",
"0.5185954",
"0.5183646",
"0.5183329",
"0.5177341",
"0.5177044",
"0.5175358",
"0.5174025",
"0.51578933",
"0.51465267",
"0.5146513",
"0.5134898",
"0.5133279",
"0.5130611",
"0.51128614",
"0.5106504",
"0.510128",
"0.5094325",
"0.5082809",
"0.5075129",
"0.50623864",
"0.50609773",
"0.5060373",
"0.505074",
"0.50482094",
"0.5045848",
"0.50370467",
"0.50345594",
"0.5029778",
"0.50193864",
"0.5017471",
"0.50165033",
"0.5005013",
"0.50032634",
"0.5001586"
] | 0.0 | -1 |
Get banner ids to which specified item is assigned | public function lookupProductsIds($sliderId)
{
$connection = $this->getConnection();
$select = $connection->select()->from(
$this->getTable('ibnab_owlslider_sliders_products'),
'product_id'
)->where(
'slider_id = ?',
(int)$sliderId
);
return $connection->fetchCol($select);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getItemIds();",
"public function itemids() {\n\t\t$q = SalesHistoryDetailQuery::create();\n\t\t$q->select(SalesHistoryDetail::get_aliasproperty('itemid'));\n\t\t$q->filterByOrdernumber($this->oehhnbr);\n\t\treturn $q->find()->toArray();\n\t}",
"public function getItemIds()\n {\n $this->loadItems();\n $items = [];\n foreach ($this->items as $item) {\n $items[] = $item->getId();\n }\n return $items;\n }",
"public function getItemIds(){\n\t return $this->getIds();\n\t}",
"public abstract function get_ids();",
"public function load_banner_ids_by_adzone( $aid ) \n\t{\t\n\t\t$args = array(\n\t\t\t'numberposts' => -1,\n\t\t\t'post_type' => 'banners'\n\t\t );\t\t\n\t\t$banners = get_posts( $args );\n\t\t$ids = array();\n\t\t\n\t\tforeach( $banners as $banner)\n\t\t{\n\t\t\t$links = get_post_meta($banner->ID, \"linked_adzones\", true);\n\t\t\t$res = !empty($links) ? in_array( $aid, $links ) ? $banner->ID : '' : '';\n\t\t\tif( !empty($res) )\n\t\t\t{\n\t\t\t\t$ids[] = $res;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ids;\n\t}",
"public function getBannerIds($blockName)\n {\n return $this->_bannerHelper->getBannerIds($blockName);\n }",
"public function getAllIds()\n {\n if (is_null($this->_itemIds)) {\n $this->_itemIds = parent::getAllIds();\n }\n return $this->_itemIds;\n }",
"public function get_content_item_ids() {\n\t\t$items = $this->get_content_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Map the IDs.\n\t\treturn array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn $item->get_data( 'post_id' );\n\t\t\t},\n\t\t\t$items\n\t\t);\n\t}",
"public function getIds();",
"public function getIds();",
"private function item_ids()\r\n {/*{{{*/\r\n\t\t$items = array();\r\n $ids = array(); \r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n foreach($items as $item)\r\n $ids[] = basename($item, '.xml');\r\n\t\tsort($ids);\r\n\t\treturn array_reverse($ids);\r\n\t}",
"protected function get_retrieved_ids() {\n $ids = $this->parse_ids($items);\n \n $sidx = $eidx = 0;\n if (is_array($this->page_size)) {\n $sidx = $this->page_size[0];\n $eidx = $this->page_size[1];\n if ($sidx < 0)\n $sidx = 0;\n if ($eidx < $sidx)\n $eidx = $sidx;\n if ($eidx >= count($ids))\n $eidx = count($ids) - 1;\n \n $len = $eidx - $sidx + 1;\n if ($sidx >= count($ids))\n $ids = array();\n else\n $ids = array_slice($ids, $sidx, $len);\n }\n\n list($start_count, $max_count) = $this->get_page_limit($this->page_size);\n $num_to_display = $max_count - $start_count + 1;\n $ids = array_slice($ids, $start_count, $num_to_display);\n\n // This is supposed to come at the end of the retrieval, but I don't know where to put it yet.\n // This is legacy code anyway and is going byebye soon.\n //$output[\"eod\"] = $start_count < $max_count;\n //$output[\"counts\"][\"displayed\"] = $start_count;\n //if (!$output[\"eod\"])\n // $output[\"counts\"][\"displayed\"]--;\n return $ids;\n }",
"public function getItemId();",
"public function getIdsForUser($user_id, $client_id);",
"function getUsedtagsIds($item_id=0)\r\n\t{\r\n\t\t\tstatic $tags = array();\r\n\t\t\tif (count($tags)>0) return $tags;\r\n\t\t\tif(!$item_id) $tags = array();\r\n\t\t\telse {\r\n\t\t\t\t$query \t= 'SELECT tid FROM #__flexicontent_tags_item_relations'\r\n\t\t\t\t\t. \" WHERE itemid ='$item_id'\"\r\n\t\t\t\t\t;\r\n\t\t\t\t$this->_db->setQuery($query);\r\n\t\t\t\t$tags = $this->_db->loadResultArray();\r\n\t\t\t}\r\n\t\treturn $tags;\r\n\t}",
"function _getIntLinks($a_item_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$q = \"SELECT * FROM map_area WHERE item_id = \".\n\t\t\t$ilDB->quote($a_item_id, \"integer\");\n\t\t$area_set = $ilDB->query($q);\n\n\t\t$links = array();\n\n\t\twhile ($area_rec = $ilDB->fetchAssoc($area_set))\n\t\t{\n\t\t\t$target = $area_rec[\"target\"];\n\t\t\t$type = $area_rec[\"type\"];\n\t\t\t$targetframe = $area_rec[\"target_frame\"];\n\n\t\t\tif (($area_rec[\"link_type\"] == IL_INT_LINK) && (is_int(strpos($target, \"__\"))))\n\t\t\t{\n\t\t\t\t$links[$target.\":\".$type.\":\".$targetframe] =\n\t\t\t\t\tarray(\"Target\" => $target, \"Type\" => $type,\n\t\t\t\t\t\t\"TargetFrame\" => $targetframe);\n\t\t\t}\n\t\t}\n\t\treturn $links;\n\t}",
"public function getId($item);",
"public static function getCartItemIds()\n\t{\n\t\t$ids = array();\n\n\t\tforeach (Data::getOrderItems(null) as $item) {\n\t\t\t$ids []= $item['PRODUCT_ID'];\n\t\t}\n\n\t\treturn $ids;\n\t}",
"function get_item_id($item_name) {\n $item_list = make_get_call(\"items\");\n \n foreach ($item_list as $key => $value) {\n if (strtolower($value) == $item_name) return $key;\n }\n \n return $item_list;\n }",
"public function getObjectIds();",
"public function getAllIds();",
"function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }",
"public function getUserServisesIds() {\n\t\t$userid = $_SESSION[ 'uid' ];\n\n\t\tif( ! isset( $userid ) || ! is_numeric( $userid ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sql = \"SELECT\n\t\t\t\t\th.id\n\t\t\t\tFROM\n\t\t\t\t\ttblhosting AS h\n\t\t\t\tLEFT JOIN\n\t\t\t\t\ttblproducts AS p ON h.packageid = p.id\n\t\t\t\tWHERE\n\t\t\t\t\th.userid = $userid AND\n\t\t\t\t\tp.servertype = 'onappcdn'\";\n\n\t\t$result = full_query( $sql );\n\n\t\tif( ! $result && mysql_num_rows( $result ) < 1 ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$servicesIds = array();\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\n\t\t\t$servicesIds[ ] = $row[ 'id' ];\n\t\t}\n\n\t\treturn $servicesIds;\n\t}",
"public function getAwardIdList()\n {\n $sql = \"SELECT id FROM casino_award \";\n return $this->_rdb->fetchAll($sql);\n }",
"public function getListItemIds() : array\n {\n return $this->listItemIds;\n }",
"public function getAllIdCurrentItems($itemQuote) {\r\n $arrIdItemCurrent = array();\r\n\r\n foreach ($itemQuote as $item) {\r\n $arrIdItemCurrent[] = $item->getId();\r\n }\r\n\r\n return $arrIdItemCurrent;\r\n }",
"public function getIdentifyingData(FeedItemBase $item);",
"public function getWishlistItemId();",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function getId_item()\n {\n return $this->id_item;\n }",
"public function getIdentifiers();",
"public function getIds()\n {\n\n }",
"public function getBusinessIds()\n {\n return $this->business_ids;\n }",
"function getIds( array $Objects );",
"public function lookupBannersIds($sliderId)\n {\n $connection = $this->getConnection();\n\n $select = $connection->select()->from(\n $this->getTable('ibnab_owlslider_sliders_banners'),\n 'banner_id'\n )->where(\n 'slider_id = ?',\n (int)$sliderId\n );\n\n return $connection->fetchCol($select);\n }",
"public function getAllIds(): array;",
"public function getUsableItems($server_ip) {\n\n return Hash::extract($this->find('all', array(\n 'fields' => 'server_item.item_id',\n 'conditions' => array(\n 'server_ip' => $server_ip\n ),\n 'joins' => array(\n array(\n 'table' => 'server_item',\n 'conditions' => array(\n 'OR' => array(\n 'server_item.server_id = Server.server_id',\n 'server_item.server_id = Server.parent_id'\n )\n )\n )\n ),\n )), '{n}.server_item.item_id');\n }",
"public function getItemId()\n {\n return $this->item_id;\n }",
"protected function getAvailableWebsiteIds()\n {\n $websiteIds = [];\n $websites = $this->storeManager->getWebsites();\n foreach ($websites as $website) {\n $websiteIds[] = $website->getId();\n }\n return $websiteIds;\n }",
"protected function getBannerItems()\n {\n $self = $this;\n\n return Cache::remember(\n 'home_banner_items',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n $recipes = Recipe::banner()->with('categories')->get();\n $articles = Article::banner()->published()->with('category')->get();\n $shows = Show::banner()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n\n if (0 == $banner->count()) {\n $recipes = Recipe::featured()->with('categories')->get();\n $articles = Article::featured()->published()->with('category')->get();\n $shows = Show::featured()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n }\n\n if (0 == $banner->count()) {\n $banner = Recipe::published()\n ->with('categories')\n ->take(config('kosher.pagination.home_banner_items'))\n ->get();\n $self->mergeReceivedRecipes($banner);\n } else {\n $recipes = collect();\n foreach ($banner as $item) {\n if ($item->isRecipe()) {\n $recipes->push($item);\n }\n }\n $self->mergeReceivedRecipes($recipes);\n }\n\n return $banner;\n }\n );\n }",
"public function getMultipleWishlistId();",
"public function getItemIdsCount()\n {\n return $this->count(self::_ITEM_IDS);\n }",
"public function getQueueableIds();",
"function _getAllexcutivesIds($userId) {\n\n $this->db->select('id');\n $this->db->from(TBL_USER);\n $this->db->where('approver_user_id', $userId);\n $query = $this->db->get();\n // echo $this->db->last_query(); die;\n $users = $query->result();\n $usersIDs = array();\n if($users) {\n foreach($users as $user) {\n $usersIDs[] = $user->id;\n }\n }\n return $usersIDs;\n }",
"public function getIds()\n {\n return $this->article_ids;\n }",
"public function getGoodsIds()\n {\n return $this->goods_ids;\n }",
"function getItemIdByWikiPageAndGroupId($wikipage, $group_id) {\n $ids = array();\n $sql = sprintf('SELECT item_id'.\n ' FROM plugin_docman_item i'.\n ' WHERE i.wiki_page = \\'%s\\''.\n ' AND i.group_id = %d'.\n ' AND '. Docman_ItemDao::getCommonExcludeStmt('i')\n , db_es($wikipage), db_ei($group_id) \n );\n $res = $this->retrieve($sql);\n if($res && !$res->isError()) {\n\t if($res->rowCount() > 1) {\n $res->rewind();\n while($res->valid()) {\n\t\t $row = $res->current();\n $ids[] = $row['item_id'];\n $res->next();\n }\n return $ids;\n }\n else {\n $res->rewind();\n if($res->valid()) {\n $row = $res->current();\n $id = $row['item_id'];\n return $id;\n }\n }\n }\n else {\n return null;\n }\n }",
"public function getPageEntryIds();",
"public function getDefinedObjectIds() {}",
"public function getReferenceIdsList(){\n return $this->_get(2);\n }",
"public function getDefinedObjectIds() {}",
"public function getDefinedObjectIds() {}",
"static function premise_grab_menu_items_ids() {\n\n\t\t$locations = get_nav_menu_locations();\n\n\t\t$menu_id = $locations['header-menu'];\n\n\t\t$menu = wp_get_nav_menu_items( $menu_id );\n\n\t\t$menu_ids = array();\n\n\t\tforeach ( $menu as $menu_item ) {\n\t\t\tarray_push( $menu_ids, $menu_item->object_id );\n\t\t}\n\n\t\tif( $menu_ids )\n\t\t\treturn $menu_ids;\n\n\t\treturn false;\n\t}",
"public function getAgentIds() {\n $retVal = [];\n foreach ($this->rAgents as $agent) {\n $retVal[] = $agent->id;\n }\n return $retVal;\n }",
"public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }",
"public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getItemStoreIds($item,$scope)\n\t{\n\t\tswitch($scope){\n\t\t\t//global scope\n\t\t\tcase 1:\n\t\t\t\t$bstore_ids=$this->getStoreIdsForStoreScope(\"admin\");\n\t\t\t\tbreak;\n\t\t\t\t//store scope\n\t\t\tcase 0:\n\t\t\t\t$bstore_ids=$this->getStoreIdsForStoreScope($item[\"store\"]);\n\t\t\t\tbreak;\n\t\t\t\t//website scope\n\t\t\tcase 2:\n\t\t\t\t$bstore_ids=$this->getStoreIdsForWebsiteScope($item[\"store\"]);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$itemstores=array_unique(array_merge($this->_dstore,$bstore_ids));\n\t\tsort($itemstores);\n\t\treturn $itemstores;\n\t}",
"public static function findAnnotationItemsUnder($item) {\n $elementTextTable = get_db()->getTable('ElementText');\n $uuid = raw_iiif_metadata($item, 'iiifitems_item_uuid_element');\n $onCanvasMatches = $elementTextTable->findBySql(\"element_texts.record_type = ? AND element_texts.element_id = ? AND element_texts.text = ?\", array(\n 'Item',\n get_option('iiifitems_annotation_on_element'),\n $uuid,\n ));\n $annoItems = array();\n foreach ($onCanvasMatches as $onCanvasMatch) {\n $annoItems[] = get_record_by_id('Item', $onCanvasMatch->record_id);\n }\n return $annoItems;\n }",
"public function arrayItems() {\r\n $quoteId = Mage::getSingleton('checkout/session')->getQuote()->getId();\r\n $session = Mage::getModel('giftwrap/selection')->getSelectionByQuoteId(\r\n $quoteId);\r\n $productIds = array();\r\n if ($session) {\r\n foreach ($session as $value) {\r\n $productIds[] = $value['itemId'];\r\n }\r\n }\r\n return $productIds;\r\n }",
"public function getIds()\n {\n return $this->restrictedCountryIds;\n }",
"protected function getNodeCatalogIds( \\Aimeos\\MShop\\Catalog\\Item\\Iface $catalogItem ) : array\n\t{\n\t\t$catalogIds = array( $catalogItem->getId() );\n\n\t\tforeach( $catalogItem->getChildren() as $childNode )\n\t\t{\n\t\t\tif( $childNode->getStatus() > 0 ) {\n\t\t\t\t$catalogIds = array_merge( $catalogIds, $this->getNodeCatalogIds( $childNode ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $catalogIds;\n\t}",
"public function ignoredActivityIDs() {\n\t\treturn $this->get('GARMIN_IGNORE_IDS');\n\t}",
"protected function getPreparedItemByItemId()\n {\n $order = $this->getOrder();\n $request = \\XLite\\Core\\Request::getInstance();\n $attributeValues = array();\n $item = $order->getItemByItemId($request->item_id);\n\n if (\n $item\n && !empty($request->order_items[$request->item_id])\n && !empty($request->order_items[$request->item_id]['attribute_values'])\n ) {\n $attributeValues = $request->order_items[$request->item_id]['attribute_values'];\n }\n\n return array($item, $attributeValues);\n }",
"public function getNewsletterRecipientIDs();",
"public function getCIDs()\n {\n $db = Loader::db();\n $ret = $db->query(\"SELECT * FROM btPagePickerCid WHERE bID=\" . intval($this->bID) );\n\n foreach($ret as $r){\n array_push($this->cids, $r[\"colID\"]);\n }\n\n return $this->cids;\n }",
"function getMonitorIds() {\n\t\t$MonitorElementObject = new MonitorElement('artifact');\n\t\treturn $MonitorElementObject->getMonitorUsersIdsInArray($this->getID());\n\t}",
"function kids(){\r\n\t\t// check if we need to generate the list\r\n\t\tif( $this->kids == null ){\r\n\t\t\t$this->kids = rsgGalleryManager::getList( $this->get('id') );\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->kids;\r\n\t}",
"public function getAssignedCompaniesIds()\n {\n $assignedCompanies = $this->getAssignedCompanies();\n $assignedIds = [];\n foreach ($assignedCompanies as $companyId => $isAssigned) {\n if ($isAssigned) {\n $assignedIds[] = $companyId;\n }\n }\n return $assignedIds;\n }",
"public function getIds(): array\n {\n return $this->ids;\n }",
"public function getFindingAids()\n {\n return $this->getFieldArray('555', ['a', 'u']);\n //return $this->getFieldArray('555');\n }",
"public function getImagesId()\n {\n $ids = array();\n foreach ($this->images as $image) {\n $ids[] = $image->getId();\n }\n return $ids;\n }",
"protected function get_site_ids()\n {\n }",
"function getIds($user = null) {\n return DB::executeFirstColumn('SELECT user_id FROM ' . TABLE_PREFIX . 'project_users WHERE project_id = ?', $this->object->getId());\n }",
"public static function getIdsInUse() {\n global $wpdb;\n $products = Cart66Common::getTableName('products');\n $sql = \"SELECT gravity_form_id as gfid from $products where gravity_form_id > 0\";\n $ids = $wpdb->get_col($sql);\n return $ids;\n }",
"public function getAllIds()\n {\n if (is_null($this->_allProductIds)) {\n if (!$this->isShuffled()) {\n $this->_allProductIds = array_keys($this->getItemCollection());\n return $this->_allProductIds;\n }\n\n $targetRuleProductIds = $this->_getTargetRuleProductIds();\n $linkProductCollection = $this->_getPreparedTargetLinkCollection();\n $linkProductIds = array();\n foreach ($linkProductCollection as $item) {\n $linkProductIds[] = $item->getEntityId();\n }\n $this->_allProductIds = array_unique(array_merge($targetRuleProductIds, $linkProductIds));\n shuffle($this->_allProductIds);\n }\n\n return $this->_allProductIds;\n }",
"public function getAllIdentifiers() {}",
"public function getMarketingCampaignsIdentifiers()\n {\n return $this->getItemIdentifiers('GetMarketingCampaignsIdentifiers');\n }",
"public static function getActiveBannerCampaigns()\n {\n return self::resultSetToObjArray(\n self::$db->fetchColumn(\n 'SELECT banner_campaign_id FROM website.banner_campaign\n WHERE effective_from < now()\n AND (effective_to IS NULL\n OR effective_to > now())'\n )\n );\n }",
"public function getInstitutionIds()\n {\n return $this->institutions->lists('id')->toArray();\n }",
"public function getIdsList() {\n return $this->_get(1);\n }",
"protected function getProductIds( \\Aimeos\\MShop\\Order\\Item\\Base\\Iface $basket ) : array\n\t{\n\t\t$productIds = [];\n\n\t\tforeach( $basket->getProducts() as $product ) {\n\t\t\t$productIds[] = $product->getProductId();\n\t\t}\n\n\t\treturn $productIds;\n\t}",
"protected function dbIatiIdentifiers()\n {\n $activities = $this->dbActivities();\n $identifiers = [];\n\n foreach ($activities as $index => $activity) {\n $identifiers[] = getVal($activity->identifier, ['iati_identifier_text']);\n }\n\n return $identifiers;\n }",
"public static function get_net_ids($conn, $user = '')\n {\n $user = (empty($user)) ? self::get_session_user() : $user;\n $nets = array();\n \n $query = 'SELECT HEX(asset_id) AS asset_id FROM alienvault.user_net_perm WHERE login = ?';\n $params = array($user);\n\n $rs = $conn->Execute($query, $params);\n\n if (!$rs)\n {\n Av_exception::throw_error(Av_exception::DB_ERROR, $conn->ErrorMsg());\n }\n\n while (!$rs->EOF)\n {\n $nets[] = $rs->fields['asset_id'];\n $rs->MoveNext();\n }\n \n return $nets;\n }",
"public function getBannedUids() {}",
"public function getStoreIds();",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}"
] | [
"0.69403785",
"0.64245325",
"0.6424303",
"0.62493527",
"0.62007415",
"0.6073584",
"0.6047857",
"0.5988404",
"0.5966535",
"0.59664315",
"0.59664315",
"0.58124655",
"0.57867604",
"0.57846314",
"0.57607144",
"0.5725071",
"0.57203573",
"0.57137054",
"0.5690318",
"0.5684902",
"0.5591753",
"0.5521741",
"0.5507832",
"0.5494351",
"0.54922247",
"0.54601705",
"0.54593885",
"0.5454778",
"0.5429522",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54054034",
"0.5399512",
"0.53863657",
"0.5365643",
"0.5352537",
"0.53465575",
"0.53464454",
"0.53429425",
"0.53341645",
"0.53293556",
"0.5326714",
"0.53267044",
"0.53202516",
"0.5304113",
"0.52801126",
"0.5274127",
"0.5258447",
"0.5255353",
"0.52516264",
"0.5245338",
"0.52452224",
"0.5244055",
"0.5244055",
"0.52426827",
"0.52423805",
"0.5241145",
"0.52360666",
"0.5229726",
"0.5229726",
"0.5227026",
"0.52249753",
"0.52209723",
"0.52204186",
"0.5218178",
"0.5195515",
"0.51951575",
"0.5189357",
"0.5182976",
"0.51812",
"0.51624167",
"0.5157831",
"0.5151515",
"0.51471835",
"0.5143405",
"0.5140052",
"0.5140048",
"0.51388454",
"0.51360726",
"0.51346606",
"0.512661",
"0.51194966",
"0.5116379",
"0.5113593",
"0.5111473",
"0.51093084",
"0.5107698",
"0.5098131",
"0.50941634",
"0.5093571",
"0.5093571",
"0.5093571",
"0.5093571",
"0.5093571",
"0.5090523"
] | 0.0 | -1 |
Get banner ids to which specified item is assigned | public function lookupBannersIds($sliderId)
{
$connection = $this->getConnection();
$select = $connection->select()->from(
$this->getTable('ibnab_owlslider_sliders_banners'),
'banner_id'
)->where(
'slider_id = ?',
(int)$sliderId
);
return $connection->fetchCol($select);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getItemIds();",
"public function itemids() {\n\t\t$q = SalesHistoryDetailQuery::create();\n\t\t$q->select(SalesHistoryDetail::get_aliasproperty('itemid'));\n\t\t$q->filterByOrdernumber($this->oehhnbr);\n\t\treturn $q->find()->toArray();\n\t}",
"public function getItemIds()\n {\n $this->loadItems();\n $items = [];\n foreach ($this->items as $item) {\n $items[] = $item->getId();\n }\n return $items;\n }",
"public function getItemIds(){\n\t return $this->getIds();\n\t}",
"public abstract function get_ids();",
"public function load_banner_ids_by_adzone( $aid ) \n\t{\t\n\t\t$args = array(\n\t\t\t'numberposts' => -1,\n\t\t\t'post_type' => 'banners'\n\t\t );\t\t\n\t\t$banners = get_posts( $args );\n\t\t$ids = array();\n\t\t\n\t\tforeach( $banners as $banner)\n\t\t{\n\t\t\t$links = get_post_meta($banner->ID, \"linked_adzones\", true);\n\t\t\t$res = !empty($links) ? in_array( $aid, $links ) ? $banner->ID : '' : '';\n\t\t\tif( !empty($res) )\n\t\t\t{\n\t\t\t\t$ids[] = $res;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ids;\n\t}",
"public function getBannerIds($blockName)\n {\n return $this->_bannerHelper->getBannerIds($blockName);\n }",
"public function getAllIds()\n {\n if (is_null($this->_itemIds)) {\n $this->_itemIds = parent::getAllIds();\n }\n return $this->_itemIds;\n }",
"public function get_content_item_ids() {\n\t\t$items = $this->get_content_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Map the IDs.\n\t\treturn array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn $item->get_data( 'post_id' );\n\t\t\t},\n\t\t\t$items\n\t\t);\n\t}",
"public function getIds();",
"public function getIds();",
"private function item_ids()\r\n {/*{{{*/\r\n\t\t$items = array();\r\n $ids = array(); \r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n foreach($items as $item)\r\n $ids[] = basename($item, '.xml');\r\n\t\tsort($ids);\r\n\t\treturn array_reverse($ids);\r\n\t}",
"protected function get_retrieved_ids() {\n $ids = $this->parse_ids($items);\n \n $sidx = $eidx = 0;\n if (is_array($this->page_size)) {\n $sidx = $this->page_size[0];\n $eidx = $this->page_size[1];\n if ($sidx < 0)\n $sidx = 0;\n if ($eidx < $sidx)\n $eidx = $sidx;\n if ($eidx >= count($ids))\n $eidx = count($ids) - 1;\n \n $len = $eidx - $sidx + 1;\n if ($sidx >= count($ids))\n $ids = array();\n else\n $ids = array_slice($ids, $sidx, $len);\n }\n\n list($start_count, $max_count) = $this->get_page_limit($this->page_size);\n $num_to_display = $max_count - $start_count + 1;\n $ids = array_slice($ids, $start_count, $num_to_display);\n\n // This is supposed to come at the end of the retrieval, but I don't know where to put it yet.\n // This is legacy code anyway and is going byebye soon.\n //$output[\"eod\"] = $start_count < $max_count;\n //$output[\"counts\"][\"displayed\"] = $start_count;\n //if (!$output[\"eod\"])\n // $output[\"counts\"][\"displayed\"]--;\n return $ids;\n }",
"public function getItemId();",
"public function getIdsForUser($user_id, $client_id);",
"function getUsedtagsIds($item_id=0)\r\n\t{\r\n\t\t\tstatic $tags = array();\r\n\t\t\tif (count($tags)>0) return $tags;\r\n\t\t\tif(!$item_id) $tags = array();\r\n\t\t\telse {\r\n\t\t\t\t$query \t= 'SELECT tid FROM #__flexicontent_tags_item_relations'\r\n\t\t\t\t\t. \" WHERE itemid ='$item_id'\"\r\n\t\t\t\t\t;\r\n\t\t\t\t$this->_db->setQuery($query);\r\n\t\t\t\t$tags = $this->_db->loadResultArray();\r\n\t\t\t}\r\n\t\treturn $tags;\r\n\t}",
"function _getIntLinks($a_item_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$q = \"SELECT * FROM map_area WHERE item_id = \".\n\t\t\t$ilDB->quote($a_item_id, \"integer\");\n\t\t$area_set = $ilDB->query($q);\n\n\t\t$links = array();\n\n\t\twhile ($area_rec = $ilDB->fetchAssoc($area_set))\n\t\t{\n\t\t\t$target = $area_rec[\"target\"];\n\t\t\t$type = $area_rec[\"type\"];\n\t\t\t$targetframe = $area_rec[\"target_frame\"];\n\n\t\t\tif (($area_rec[\"link_type\"] == IL_INT_LINK) && (is_int(strpos($target, \"__\"))))\n\t\t\t{\n\t\t\t\t$links[$target.\":\".$type.\":\".$targetframe] =\n\t\t\t\t\tarray(\"Target\" => $target, \"Type\" => $type,\n\t\t\t\t\t\t\"TargetFrame\" => $targetframe);\n\t\t\t}\n\t\t}\n\t\treturn $links;\n\t}",
"public function getId($item);",
"public static function getCartItemIds()\n\t{\n\t\t$ids = array();\n\n\t\tforeach (Data::getOrderItems(null) as $item) {\n\t\t\t$ids []= $item['PRODUCT_ID'];\n\t\t}\n\n\t\treturn $ids;\n\t}",
"function get_item_id($item_name) {\n $item_list = make_get_call(\"items\");\n \n foreach ($item_list as $key => $value) {\n if (strtolower($value) == $item_name) return $key;\n }\n \n return $item_list;\n }",
"public function getObjectIds();",
"public function getAllIds();",
"function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }",
"public function getUserServisesIds() {\n\t\t$userid = $_SESSION[ 'uid' ];\n\n\t\tif( ! isset( $userid ) || ! is_numeric( $userid ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sql = \"SELECT\n\t\t\t\t\th.id\n\t\t\t\tFROM\n\t\t\t\t\ttblhosting AS h\n\t\t\t\tLEFT JOIN\n\t\t\t\t\ttblproducts AS p ON h.packageid = p.id\n\t\t\t\tWHERE\n\t\t\t\t\th.userid = $userid AND\n\t\t\t\t\tp.servertype = 'onappcdn'\";\n\n\t\t$result = full_query( $sql );\n\n\t\tif( ! $result && mysql_num_rows( $result ) < 1 ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$servicesIds = array();\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\n\t\t\t$servicesIds[ ] = $row[ 'id' ];\n\t\t}\n\n\t\treturn $servicesIds;\n\t}",
"public function getAwardIdList()\n {\n $sql = \"SELECT id FROM casino_award \";\n return $this->_rdb->fetchAll($sql);\n }",
"public function getListItemIds() : array\n {\n return $this->listItemIds;\n }",
"public function getAllIdCurrentItems($itemQuote) {\r\n $arrIdItemCurrent = array();\r\n\r\n foreach ($itemQuote as $item) {\r\n $arrIdItemCurrent[] = $item->getId();\r\n }\r\n\r\n return $arrIdItemCurrent;\r\n }",
"public function getIdentifyingData(FeedItemBase $item);",
"public function getWishlistItemId();",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function getId_item()\n {\n return $this->id_item;\n }",
"public function getIdentifiers();",
"public function getIds()\n {\n\n }",
"public function getBusinessIds()\n {\n return $this->business_ids;\n }",
"function getIds( array $Objects );",
"public function getAllIds(): array;",
"public function getUsableItems($server_ip) {\n\n return Hash::extract($this->find('all', array(\n 'fields' => 'server_item.item_id',\n 'conditions' => array(\n 'server_ip' => $server_ip\n ),\n 'joins' => array(\n array(\n 'table' => 'server_item',\n 'conditions' => array(\n 'OR' => array(\n 'server_item.server_id = Server.server_id',\n 'server_item.server_id = Server.parent_id'\n )\n )\n )\n ),\n )), '{n}.server_item.item_id');\n }",
"public function getItemId()\n {\n return $this->item_id;\n }",
"protected function getAvailableWebsiteIds()\n {\n $websiteIds = [];\n $websites = $this->storeManager->getWebsites();\n foreach ($websites as $website) {\n $websiteIds[] = $website->getId();\n }\n return $websiteIds;\n }",
"protected function getBannerItems()\n {\n $self = $this;\n\n return Cache::remember(\n 'home_banner_items',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n $recipes = Recipe::banner()->with('categories')->get();\n $articles = Article::banner()->published()->with('category')->get();\n $shows = Show::banner()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n\n if (0 == $banner->count()) {\n $recipes = Recipe::featured()->with('categories')->get();\n $articles = Article::featured()->published()->with('category')->get();\n $shows = Show::featured()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n }\n\n if (0 == $banner->count()) {\n $banner = Recipe::published()\n ->with('categories')\n ->take(config('kosher.pagination.home_banner_items'))\n ->get();\n $self->mergeReceivedRecipes($banner);\n } else {\n $recipes = collect();\n foreach ($banner as $item) {\n if ($item->isRecipe()) {\n $recipes->push($item);\n }\n }\n $self->mergeReceivedRecipes($recipes);\n }\n\n return $banner;\n }\n );\n }",
"public function getMultipleWishlistId();",
"public function getItemIdsCount()\n {\n return $this->count(self::_ITEM_IDS);\n }",
"public function getQueueableIds();",
"function _getAllexcutivesIds($userId) {\n\n $this->db->select('id');\n $this->db->from(TBL_USER);\n $this->db->where('approver_user_id', $userId);\n $query = $this->db->get();\n // echo $this->db->last_query(); die;\n $users = $query->result();\n $usersIDs = array();\n if($users) {\n foreach($users as $user) {\n $usersIDs[] = $user->id;\n }\n }\n return $usersIDs;\n }",
"public function getIds()\n {\n return $this->article_ids;\n }",
"public function getGoodsIds()\n {\n return $this->goods_ids;\n }",
"function getItemIdByWikiPageAndGroupId($wikipage, $group_id) {\n $ids = array();\n $sql = sprintf('SELECT item_id'.\n ' FROM plugin_docman_item i'.\n ' WHERE i.wiki_page = \\'%s\\''.\n ' AND i.group_id = %d'.\n ' AND '. Docman_ItemDao::getCommonExcludeStmt('i')\n , db_es($wikipage), db_ei($group_id) \n );\n $res = $this->retrieve($sql);\n if($res && !$res->isError()) {\n\t if($res->rowCount() > 1) {\n $res->rewind();\n while($res->valid()) {\n\t\t $row = $res->current();\n $ids[] = $row['item_id'];\n $res->next();\n }\n return $ids;\n }\n else {\n $res->rewind();\n if($res->valid()) {\n $row = $res->current();\n $id = $row['item_id'];\n return $id;\n }\n }\n }\n else {\n return null;\n }\n }",
"public function getPageEntryIds();",
"public function getDefinedObjectIds() {}",
"public function getReferenceIdsList(){\n return $this->_get(2);\n }",
"public function getDefinedObjectIds() {}",
"public function getDefinedObjectIds() {}",
"static function premise_grab_menu_items_ids() {\n\n\t\t$locations = get_nav_menu_locations();\n\n\t\t$menu_id = $locations['header-menu'];\n\n\t\t$menu = wp_get_nav_menu_items( $menu_id );\n\n\t\t$menu_ids = array();\n\n\t\tforeach ( $menu as $menu_item ) {\n\t\t\tarray_push( $menu_ids, $menu_item->object_id );\n\t\t}\n\n\t\tif( $menu_ids )\n\t\t\treturn $menu_ids;\n\n\t\treturn false;\n\t}",
"public function getAgentIds() {\n $retVal = [];\n foreach ($this->rAgents as $agent) {\n $retVal[] = $agent->id;\n }\n return $retVal;\n }",
"public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }",
"public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getItemStoreIds($item,$scope)\n\t{\n\t\tswitch($scope){\n\t\t\t//global scope\n\t\t\tcase 1:\n\t\t\t\t$bstore_ids=$this->getStoreIdsForStoreScope(\"admin\");\n\t\t\t\tbreak;\n\t\t\t\t//store scope\n\t\t\tcase 0:\n\t\t\t\t$bstore_ids=$this->getStoreIdsForStoreScope($item[\"store\"]);\n\t\t\t\tbreak;\n\t\t\t\t//website scope\n\t\t\tcase 2:\n\t\t\t\t$bstore_ids=$this->getStoreIdsForWebsiteScope($item[\"store\"]);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$itemstores=array_unique(array_merge($this->_dstore,$bstore_ids));\n\t\tsort($itemstores);\n\t\treturn $itemstores;\n\t}",
"public static function findAnnotationItemsUnder($item) {\n $elementTextTable = get_db()->getTable('ElementText');\n $uuid = raw_iiif_metadata($item, 'iiifitems_item_uuid_element');\n $onCanvasMatches = $elementTextTable->findBySql(\"element_texts.record_type = ? AND element_texts.element_id = ? AND element_texts.text = ?\", array(\n 'Item',\n get_option('iiifitems_annotation_on_element'),\n $uuid,\n ));\n $annoItems = array();\n foreach ($onCanvasMatches as $onCanvasMatch) {\n $annoItems[] = get_record_by_id('Item', $onCanvasMatch->record_id);\n }\n return $annoItems;\n }",
"public function arrayItems() {\r\n $quoteId = Mage::getSingleton('checkout/session')->getQuote()->getId();\r\n $session = Mage::getModel('giftwrap/selection')->getSelectionByQuoteId(\r\n $quoteId);\r\n $productIds = array();\r\n if ($session) {\r\n foreach ($session as $value) {\r\n $productIds[] = $value['itemId'];\r\n }\r\n }\r\n return $productIds;\r\n }",
"public function getIds()\n {\n return $this->restrictedCountryIds;\n }",
"protected function getNodeCatalogIds( \\Aimeos\\MShop\\Catalog\\Item\\Iface $catalogItem ) : array\n\t{\n\t\t$catalogIds = array( $catalogItem->getId() );\n\n\t\tforeach( $catalogItem->getChildren() as $childNode )\n\t\t{\n\t\t\tif( $childNode->getStatus() > 0 ) {\n\t\t\t\t$catalogIds = array_merge( $catalogIds, $this->getNodeCatalogIds( $childNode ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $catalogIds;\n\t}",
"public function ignoredActivityIDs() {\n\t\treturn $this->get('GARMIN_IGNORE_IDS');\n\t}",
"protected function getPreparedItemByItemId()\n {\n $order = $this->getOrder();\n $request = \\XLite\\Core\\Request::getInstance();\n $attributeValues = array();\n $item = $order->getItemByItemId($request->item_id);\n\n if (\n $item\n && !empty($request->order_items[$request->item_id])\n && !empty($request->order_items[$request->item_id]['attribute_values'])\n ) {\n $attributeValues = $request->order_items[$request->item_id]['attribute_values'];\n }\n\n return array($item, $attributeValues);\n }",
"public function getNewsletterRecipientIDs();",
"public function getCIDs()\n {\n $db = Loader::db();\n $ret = $db->query(\"SELECT * FROM btPagePickerCid WHERE bID=\" . intval($this->bID) );\n\n foreach($ret as $r){\n array_push($this->cids, $r[\"colID\"]);\n }\n\n return $this->cids;\n }",
"function getMonitorIds() {\n\t\t$MonitorElementObject = new MonitorElement('artifact');\n\t\treturn $MonitorElementObject->getMonitorUsersIdsInArray($this->getID());\n\t}",
"function kids(){\r\n\t\t// check if we need to generate the list\r\n\t\tif( $this->kids == null ){\r\n\t\t\t$this->kids = rsgGalleryManager::getList( $this->get('id') );\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->kids;\r\n\t}",
"public function getAssignedCompaniesIds()\n {\n $assignedCompanies = $this->getAssignedCompanies();\n $assignedIds = [];\n foreach ($assignedCompanies as $companyId => $isAssigned) {\n if ($isAssigned) {\n $assignedIds[] = $companyId;\n }\n }\n return $assignedIds;\n }",
"public function getIds(): array\n {\n return $this->ids;\n }",
"public function getFindingAids()\n {\n return $this->getFieldArray('555', ['a', 'u']);\n //return $this->getFieldArray('555');\n }",
"public function getImagesId()\n {\n $ids = array();\n foreach ($this->images as $image) {\n $ids[] = $image->getId();\n }\n return $ids;\n }",
"protected function get_site_ids()\n {\n }",
"function getIds($user = null) {\n return DB::executeFirstColumn('SELECT user_id FROM ' . TABLE_PREFIX . 'project_users WHERE project_id = ?', $this->object->getId());\n }",
"public static function getIdsInUse() {\n global $wpdb;\n $products = Cart66Common::getTableName('products');\n $sql = \"SELECT gravity_form_id as gfid from $products where gravity_form_id > 0\";\n $ids = $wpdb->get_col($sql);\n return $ids;\n }",
"public function getAllIds()\n {\n if (is_null($this->_allProductIds)) {\n if (!$this->isShuffled()) {\n $this->_allProductIds = array_keys($this->getItemCollection());\n return $this->_allProductIds;\n }\n\n $targetRuleProductIds = $this->_getTargetRuleProductIds();\n $linkProductCollection = $this->_getPreparedTargetLinkCollection();\n $linkProductIds = array();\n foreach ($linkProductCollection as $item) {\n $linkProductIds[] = $item->getEntityId();\n }\n $this->_allProductIds = array_unique(array_merge($targetRuleProductIds, $linkProductIds));\n shuffle($this->_allProductIds);\n }\n\n return $this->_allProductIds;\n }",
"public function getAllIdentifiers() {}",
"public function getMarketingCampaignsIdentifiers()\n {\n return $this->getItemIdentifiers('GetMarketingCampaignsIdentifiers');\n }",
"public static function getActiveBannerCampaigns()\n {\n return self::resultSetToObjArray(\n self::$db->fetchColumn(\n 'SELECT banner_campaign_id FROM website.banner_campaign\n WHERE effective_from < now()\n AND (effective_to IS NULL\n OR effective_to > now())'\n )\n );\n }",
"public function getInstitutionIds()\n {\n return $this->institutions->lists('id')->toArray();\n }",
"public function getIdsList() {\n return $this->_get(1);\n }",
"protected function getProductIds( \\Aimeos\\MShop\\Order\\Item\\Base\\Iface $basket ) : array\n\t{\n\t\t$productIds = [];\n\n\t\tforeach( $basket->getProducts() as $product ) {\n\t\t\t$productIds[] = $product->getProductId();\n\t\t}\n\n\t\treturn $productIds;\n\t}",
"protected function dbIatiIdentifiers()\n {\n $activities = $this->dbActivities();\n $identifiers = [];\n\n foreach ($activities as $index => $activity) {\n $identifiers[] = getVal($activity->identifier, ['iati_identifier_text']);\n }\n\n return $identifiers;\n }",
"public static function get_net_ids($conn, $user = '')\n {\n $user = (empty($user)) ? self::get_session_user() : $user;\n $nets = array();\n \n $query = 'SELECT HEX(asset_id) AS asset_id FROM alienvault.user_net_perm WHERE login = ?';\n $params = array($user);\n\n $rs = $conn->Execute($query, $params);\n\n if (!$rs)\n {\n Av_exception::throw_error(Av_exception::DB_ERROR, $conn->ErrorMsg());\n }\n\n while (!$rs->EOF)\n {\n $nets[] = $rs->fields['asset_id'];\n $rs->MoveNext();\n }\n \n return $nets;\n }",
"public function getBannedUids() {}",
"public function getStoreIds();",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }",
"public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}"
] | [
"0.69403785",
"0.64245325",
"0.6424303",
"0.62493527",
"0.62007415",
"0.6073584",
"0.6047857",
"0.5988404",
"0.5966535",
"0.59664315",
"0.59664315",
"0.58124655",
"0.57867604",
"0.57846314",
"0.57607144",
"0.5725071",
"0.57203573",
"0.57137054",
"0.5690318",
"0.5684902",
"0.5591753",
"0.5521741",
"0.5507832",
"0.5494351",
"0.54922247",
"0.54601705",
"0.54593885",
"0.5454778",
"0.5429522",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54212105",
"0.54054034",
"0.5399512",
"0.53863657",
"0.5365643",
"0.5352537",
"0.53464454",
"0.53429425",
"0.53341645",
"0.53293556",
"0.5326714",
"0.53267044",
"0.53202516",
"0.5304113",
"0.52801126",
"0.5274127",
"0.5258447",
"0.5255353",
"0.52516264",
"0.5245338",
"0.52452224",
"0.5244055",
"0.5244055",
"0.52426827",
"0.52423805",
"0.5241145",
"0.52360666",
"0.5229726",
"0.5229726",
"0.5227026",
"0.52249753",
"0.52209723",
"0.52204186",
"0.5218178",
"0.5195515",
"0.51951575",
"0.5189357",
"0.5182976",
"0.51812",
"0.51624167",
"0.5157831",
"0.5151515",
"0.51471835",
"0.5143405",
"0.5140052",
"0.5140048",
"0.51388454",
"0.51360726",
"0.51346606",
"0.512661",
"0.51194966",
"0.5116379",
"0.5113593",
"0.5111473",
"0.51093084",
"0.5107698",
"0.5098131",
"0.50941634",
"0.5093571",
"0.5093571",
"0.5093571",
"0.5093571",
"0.5093571",
"0.5090523"
] | 0.53465575 | 42 |
Process slider data before deleting | protected function _beforeDelete(\Magento\Framework\Model\AbstractModel $object)
{
$condition = ['slider_id = ?' => (int)$object->getId()];
$this->getConnection()->delete($this->getTable('ibnab_owlslider_sliders_banners'), $condition);
return parent::_beforeDelete($object);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove()\n {\n $id = $this->input->post('id_slider'); // menangkap post dari form.php ketika edit data, dengan properties namenya adalah id_size\n $this->slider->delete($id); /* mengakses model size, lalu ke fungsi delete dengan parameter sebuah id */\n\n /* membuat array, yang akan dikonversi menjadi json untuk kebutuhan ajax */\n $jsonmsg = array(\n \"msg\" => 'Delete Data Succces',\n \"hasil\" => true\n );\n\n /* konversi array json, yang akan terkirim ke form.php */\n echo json_encode($jsonmsg);\n }",
"function delete_slider($id_slider)\n\t\t{\n\t\t\t$this->db->where('id_slider',$id_slider);\n\t\t\t$this->db->delete('slider');\n\t\t}",
"public function afterDelete()\n {\n if ($this->image) $this->image->delete();\n if ($this->reindex) Slide::reindex();\n }",
"function delete_slider($pid) {\n $sql = \"DELETE FROM slider WHERE id='$pid'\";\n $this->mysqli->query($sql);\n }",
"function cs_pb_slider($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$slider_element_size = '50';\n\t\t$cs_slider_header_title_db = '';\n\t\t$cs_slider_type_db = '';\n\t\t$cs_slider_db = '';\n\t\t$cs_slider_width_db = '';\n\t\t$cs_slider_height_db = '';\n\t\t$slider_view= '';\n\t\t$slider_id ='';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$slider_element_size = $cs_node->slider_element_size;\n\t\t\t$cs_slider_header_title_db = $cs_node->slider_header_title;\n\t\t\t$cs_slider_type_db = $cs_node->slider_type;\n\t\t\t$cs_slider_db = $cs_node->slider;\n\t\t\t$slider_view= $cs_node->slider_view;\n\t\t\t$slider_id = $cs_node->slider_id;\n\t\t\t$cs_slider_width_db = $cs_node->width;\n\t\t\t$cs_slider_height_db = $cs_node->height;\n\t\t\t\t$counter = $post->ID.$count_node;\n\t}\n?>\n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $slider_element_size?>\" item=\"slider\" data=\"<?php echo element_size_data_array_index($slider_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"slider_element_size[]\" class=\"item\" value=\"<?php echo $slider_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a>\n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n <div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Slider Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\"> </a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Slider Header Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_slider_header_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_slider_header_title_db)?>\" />\n <p>Please enter slider header title.</p>\n </li> \n </ul>\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose SliderType</label></li>\n <li class=\"to-field\">\n <select name=\"cs_slider_type[]\" class=\"dropdown\" onchange=\"cs_toggle_height(this.value,'cs_slider_height<?php echo $name.$counter?>')\">\n <option <?php if($cs_slider_type_db==\"Flex Slider\"){echo \"selected\";}?> >Flex Slider</option>\n <option <?php if($cs_slider_type_db==\"Custom Slider\"){echo \"selected\";}?> >Custom Slider</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" id=\"choose_slider\" style=\"display:<?php if($cs_slider_type_db == \"Custom Slider\")echo \"none\"; else echo \"inline\"; ?>\">\n <li class=\"to-label\"><label>Choose Slider</label></li>\n <li class=\"to-field\">\n <select name=\"cs_slider[]\" class=\"dropdown\">\n <?php\n $query = array( 'posts_per_page' => '-1', 'post_type' => 'cs_slider', 'orderby'=>'ID', 'post_status' => 'publish' );\n $wp_query = new WP_Query($query);\n while ($wp_query->have_posts()) : $wp_query->the_post();\n ?>\n <option <?php if($post->post_name==$cs_slider_db)echo \"selected\";?> value=\"<?php echo $post->post_name; ?>\"><?php the_title()?></option>\n <?php\n endwhile;\n ?>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" >\n <li class=\"to-label\"><label>Slider View</label></li>\n <li class=\"to-field\">\n <select name=\"slider_view[]\" class=\"dropdown\" >\n <option <?php if($slider_view==\"content\")echo \"selected\";?> >content</option>\n <option <?php if($slider_view==\"header\")echo \"selected\";?> >header</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" id=\"layer_slider\" style=\"display:<?php if($cs_slider_type_db == \"Custom Slider\")echo \"inline\"; else echo \"none\"; ?>\" >\n <li class=\"to-label\">\n <label>Use Short Code</label>\n </li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_slider_id[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($slider_id);?>\" />\n </li>\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n <p>Please enter the Revolution Slider Short Code like [rev_slider rocky]</p>\n </li> \n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"slider\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}",
"function delete_slider($slider_id)\n {\n $this->db->update('tbl_slider',$this,array('slider_id'=>$slider_id));\n //echo $this->db->last_query();\n }",
"public function deleteSlider($type, $id)\n {\n try{\n $slider = $this->model->where('type','=',$type)->where('uniqueId','=',$id)->first();\n\n $slider->delete();\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function pre_delete()\r\n\t{\r\n\t\tparent::pre_delete();\r\n\t\t$Change = App::make('Change');\r\n\t\t$Change::where('fmodel', 'GalleryItem')\r\n\t\t\t ->where('fid', $this->id)\r\n\t\t\t ->delete();\r\n\t\t\t \r\n\t\t// Thumbs\r\n\t\t/*if($this->file) {\r\n\t\t\t# Should really check if these are used anywhere else, but no easy way to do that in other modules yet so just leaving them for now\r\n\t\t\t\r\n\t\t\t// Name\r\n\t\t\t$name = basename(public_path().$this->file);\r\n\t\t\t\r\n\t\t\t// Thumbs\r\n\t\t\t$thumbs = Config::get('galleries::thumbs');\r\n\t\t\tforeach($thumbs as $k => $v) {\r\n\t\t\t\tif(file_exists(public_path().$v['path'].$name)) unlink(public_path().$v['path'].$name);\r\n\t\t\t}\r\n\t\t}*/\r\n\t}",
"public function deleteSlider($id)\n {\n $image = Slider::find($id);\n $old_image = $image->image;\n unlink($old_image);\n\n Slider::find($id)->delete();\n\n return redirect()->back()->with('success','slider Delete successfully');\n }",
"public function deleteSlider($id)\n {\n if ($this->admin_m->deleteSlid($id))\n {\n $this->session->set_flashdata('success', 'Slider Deleted!');\n\n } else {\n $this->session->set_flashdata('failed', 'Failed to delete the Slider, Try again!');\n\n }\n\n $data['sliders'] = $this->admin_m->geAlltSliders();\n $data['content'] = 'admin/sliderread';\n $this->load->view('components/template', $data);\n }",
"function smooth_slider_create_multiple_sliders() {\nglobal $smooth_slider;\n?>\n\n<div class=\"wrap\" style=\"clear:both;\">\n <div style=\"margin:10px auto;clear:left;\">\n <a href=\"http://slidervilla.com/\" title=\"Premium WordPress Slider Plugins\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/slidervilla-728.jpg');?>\" alt=\"Premium WordPress Slider Plugins\" /></a>\n </div>\n<h2 style=\"float:left;\"><?php _e('Sliders Created','smooth-slider'); ?></h2>\n<form style=\"float:left;\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\n<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"8046056\">\n<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>\n\n<?php \nif ($_POST['remove_posts_slider']) {\n if ( $_POST['slider_posts'] ) {\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n\t $current_slider = $_POST['current_slider_id'];\n\t foreach ( $_POST['slider_posts'] as $post_id=>$val ) {\n\t\t $sql = \"DELETE FROM $table_name WHERE post_id = '$post_id' AND slider_id = '$current_slider' LIMIT 1\";\n\t\t $wpdb->query($sql);\n\t }\n }\n if ($_POST['remove_all'] == __('Remove All at Once','smooth-slider')) {\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n\t $current_slider = $_POST['current_slider_id'];\n\t if(is_slider_on_slider_table($current_slider)) {\n\t\t $sql = \"DELETE FROM $table_name WHERE slider_id = '$current_slider';\";\n\t\t $wpdb->query($sql);\n\t }\n }\n if ($_POST['remove_all'] == __('Delete Slider','smooth-slider')) {\n $slider_id = $_POST['current_slider_id'];\n global $wpdb, $table_prefix;\n $slider_table = $table_prefix.SLIDER_TABLE;\n $slider_meta = $table_prefix.SLIDER_META;\n\t $slider_postmeta = $table_prefix.SLIDER_POST_META;\n\t if(is_slider_on_slider_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_table WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n\t if(is_slider_on_meta_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_meta WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n\t if(is_slider_on_postmeta_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_postmeta WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n }\n}\nif ($_POST['create_new_slider']) {\n $slider_name = $_POST['new_slider_name'];\n global $wpdb,$table_prefix;\n $slider_meta = $table_prefix.SLIDER_META;\n $sql = \"INSERT INTO $slider_meta (slider_name) VALUES('$slider_name');\";\n $result = $wpdb->query($sql);\n}\nif ($_POST['reorder_posts_slider']) {\n $i=1;\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n foreach ($_POST['order'] as $slide_order) {\n $slide_order = intval($slide_order);\n $sql = 'UPDATE '.$table_name.' SET slide_order='.$i.' WHERE post_id='.$slide_order.'';\n $wpdb->query($sql);\n $i++;\n }\n}\n?>\n<div style=\"clear:both\"></div>\n<?php $url = sslider_admin_url( array( 'page' => 'smooth-slider-settings' ) );?>\n<a href=\"<?php echo $url; ?>\" title=\"<?php _e('Settings Page for Smooth Slider where you can change the color, font etc. for the sliders','smooth-slider'); ?>\"><?php _e('Go to Smooth Slider Settings page','smooth-slider'); ?></a>\n<?php $sliders = ss_get_sliders(); ?>\n\n<div id=\"slider_tabs\">\n <ul class=\"ui-tabs\">\n <?php foreach($sliders as $slider){?>\n <li><a href=\"#tabs-<?php echo $slider['slider_id'];?>\"><?php echo $slider['slider_name'];?></a></li>\n <?php } ?>\n <?php if($smooth_slider['multiple_sliders'] == '1') {?>\n <li><a href=\"#new_slider\"><?php _e('Create New Slider','smooth-slider'); ?></a></li>\n <?php } ?>\n </ul>\n\n<?php foreach($sliders as $slider){?>\n<div id=\"tabs-<?php echo $slider['slider_id'];?>\">\n<form action=\"\" method=\"post\">\n<?php settings_fields('smooth-slider-group'); ?>\n\n<input type=\"hidden\" name=\"remove_posts_slider\" value=\"1\" />\n<div id=\"tabs-<?php echo $slider['slider_id'];?>\">\n<h3><?php _e('Posts/Pages Added To','smooth-slider'); ?> <?php echo $slider['slider_name'];?><?php _e('(Slider ID','smooth-slider'); ?> = <?php echo $slider['slider_id'];?>)</h3>\n<p><em><?php _e('Check the Post/Page and Press \"Remove Selected\" to remove them From','smooth-slider'); ?> <?php echo $slider['slider_name'];?>. <?php _e('Press \"Remove All at Once\" to remove all the posts from the','smooth-slider'); ?> <?php echo $slider['slider_name'];?>.</em></p>\n\n <table class=\"widefat\">\n <thead><tr><th><?php _e('Post/Page Title','smooth-slider'); ?></th><th><?php _e('Author','smooth-slider'); ?></th><th><?php _e('Post Date','smooth-slider'); ?></th><th><?php _e('Remove Post','smooth-slider'); ?></th></tr></thead><tbody>\n\n<?php \n\t/*global $wpdb, $table_prefix;\n\t$table_name = $table_prefix.SLIDER_TABLE;*/\n\t$slider_id = $slider['slider_id'];\n\t//$slider_posts = $wpdb->get_results(\"SELECT post_id FROM $table_name WHERE slider_id = '$slider_id'\", OBJECT); \n $slider_posts=get_slider_posts_in_order($slider_id); ?>\n\t\n <input type=\"hidden\" name=\"current_slider_id\" value=\"<?php echo $slider_id;?>\" />\n \n<?php $count = 0;\t\n\tforeach($slider_posts as $slider_post) {\n\t $slider_arr[] = $slider_post->post_id;\n\t $post = get_post($slider_post->post_id);\t \n\t if ( in_array($post->ID, $slider_arr) ) {\n\t\t $count++;\n\t\t $sslider_author = get_userdata($post->post_author);\n $sslider_author_dname = $sslider_author->display_name;\n\t\t echo '<tr' . ($count % 2 ? ' class=\"alternate\"' : '') . '><td><strong>' . $post->post_title . '</strong><a href=\"'.get_edit_post_link( $post->ID, $context = 'display' ).'\" target=\"_blank\"> '.__( '(Edit)', 'smooth-slider' ).'</a> <a href=\"'.get_permalink( $post->ID ).'\" target=\"_blank\"> '.__( '(View)', 'smooth-slider' ).' </a></td><td>By ' . $sslider_author_dname . '</td><td>' . date('l, F j. Y',strtotime($post->post_date)) . '</td><td><input type=\"checkbox\" name=\"slider_posts[' . $post->ID . ']\" value=\"1\" /></td></tr>'; \n\t }\n\t}\n\t\t\n\tif ($count == 0) {\n\t\techo '<tr><td colspan=\"4\">'.__( 'No posts/pages have been added to the Slider - You can add respective post/page to slider on the Edit screen for that Post/Page', 'smooth-slider' ).'</td></tr>';\n\t}\n\techo '</tbody><tfoot><tr><th>'.__( 'Post/Page Title', 'smooth-slider' ).'</th><th>'.__( 'Author', 'smooth-slider' ).'</th><th>'.__( 'Post Date', 'smooth-slider' ).'</th><th>'.__( 'Remove Post', 'smooth-slider' ).'</th></tr></tfoot></table>'; \n \n\techo '<div class=\"submit\">';\n\t\n\tif ($count) {echo '<input type=\"submit\" value=\"'.__( 'Remove Selected', 'smooth-slider' ).'\" onclick=\"return confirmRemove()\" /><input type=\"submit\" name=\"remove_all\" value=\"'.__( 'Remove All at Once', 'smooth-slider' ).'\" onclick=\"return confirmRemoveAll()\" />';}\n\t\n\tif($slider_id != '1') {\n\t echo '<input type=\"submit\" value=\"'.__( 'Delete Slider', 'smooth-slider' ).'\" name=\"remove_all\" onclick=\"return confirmSliderDelete()\" />';\n\t}\n\t\n\techo '</div>';\n?> \n </tbody></table>\n </form>\n \n \n <form action=\"\" method=\"post\">\n <input type=\"hidden\" name=\"reorder_posts_slider\" value=\"1\" />\n <h3><?php _e('Reorder the Posts/Pages Added To','smooth-slider'); ?> <?php echo $slider['slider_name'];?>(Slider ID = <?php echo $slider['slider_id'];?>)</h3>\n <p><em><?php _e('Click on and drag the post/page title to a new spot within the list, and the other items will adjust to fit.','smooth-slider'); ?> </em></p>\n <ul id=\"sslider_sortable_<?php echo $slider['slider_id'];?>\" style=\"color:#326078\"> \n <?php \n /*global $wpdb, $table_prefix;\n\t$table_name = $table_prefix.SLIDER_TABLE;*/\n\t$slider_id = $slider['slider_id'];\n\t//$slider_posts = $wpdb->get_results(\"SELECT post_id FROM $table_name WHERE slider_id = '$slider_id'\", OBJECT); \n $slider_posts=get_slider_posts_in_order($slider_id);?>\n \n <input type=\"hidden\" name=\"current_slider_id\" value=\"<?php echo $slider_id;?>\" />\n \n <?php $count = 0;\t\n foreach($slider_posts as $slider_post) {\n $slider_arr[] = $slider_post->post_id;\n $post = get_post($slider_post->post_id);\t \n if ( in_array($post->ID, $slider_arr) ) {\n $count++;\n $sslider_author = get_userdata($post->post_author);\n $sslider_author_dname = $sslider_author->display_name;\n echo '<li id=\"'.$post->ID.'\"><input type=\"hidden\" name=\"order[]\" value=\"'.$post->ID.'\" /><strong> » ' . $post->post_title . '</strong></li>'; \n }\n }\n \n if ($count == 0) {\n echo '<li>'.__( 'No posts/pages have been added to the Slider - You can add respective post/page to slider on the Edit screen for that Post/Page', 'smooth-slider' ).'</li>';\n }\n\t\t \n echo '</ul><div class=\"submit\">';\n \n if ($count) {echo '<input type=\"submit\" value=\"Save the order\" />';}\n \n echo '</div>';\n ?> \n </div> \n </form>\n</div> \n \n<?php } ?>\n\n<?php if($smooth_slider['multiple_sliders'] == '1') {?>\n <div id=\"new_slider\">\n <form action=\"\" method=\"post\" onsubmit=\"return slider_checkform(this);\" >\n <h3><?php _e('Enter New Slider Name','smooth-slider'); ?></h3>\n <input type=\"hidden\" name=\"create_new_slider\" value=\"1\" />\n \n <input name=\"new_slider_name\" class=\"regular-text code\" value=\"\" style=\"clear:both;\" />\n \n <div class=\"submit\"><input type=\"submit\" value=\"<?php _e('Create New','smooth-slider'); ?>\" name=\"create_new\" /></div>\n \n </form>\n </div>\n<?php }?> \n</div>\n\n<div style=\"margin:10px auto;clear:left;\">\n <a href=\"http://slidervilla.com/\" title=\"Premium WordPress Slider Plugins\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/slidervilla-728.jpg');?>\" alt=\"Premium WordPress Slider Plugins\" /></a>\n</div>\n\n<div id=\"poststuff\" class=\"metabox-holder has-right-sidebar\"> \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('About this Plugin:','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <ul>\n <li><a href=\"http://www.clickonf5.org/smooth-slider\" title=\"Smooth Slider Homepage\" ><?php _e('Plugin Homepage','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org\" title=\"Visit Internet Techies\" ><?php _e('Plugin Parent Site','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/phpbb/smooth-slider-f12/\" title=\"Support Forum for Smooth Slider\" ><?php _e('Support Forum','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/about/tejaswini\" title=\"Smooth Slider Author Page\" ><?php _e('About the Author','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/go/smooth-slider/\" title=\"<?php _e('Donate if you liked the plugin and support in enhancing Smooth Slider and creating new plugins','smooth-slider'); ?>\" ><?php _e('Donate with Paypal','smooth-slider'); ?></a></li>\n </ul> \n </div> \n\t\t\t</div> \n </div>\n \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Our Facebook Fan Page','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <script type=\"text/javascript\" src=\"http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_GB\"></script><script type=\"text/javascript\">FB.init(\"2aeebe9fb014836a6810ec4426d26f7e\");</script><fb:fan profile_id=\"127760528543\" stream=\"\" connections=\"8\" width=\"270\" height=\"250\"></fb:fan>\n </div> \n\t\t\t</div> \n </div>\n\n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('Credits:','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <ul>\n <li><a href=\"http://sorgalla.com/jcarousel/\" title=\"jCarousel jQuey plugin\" >Riding carousels with jQuery</a></li>\n <li><a href=\"http://acko.net/dev/farbtastic\" title=\"Farbtastic Color Picker by Steven Wittens\" >Farbtastic Color Picker</a></li>\n <li><a href=\"http://jquery.com/\" title=\"jQuery JavaScript Library - John Resig\" >jQuery JavaScript Library</a></li>\n </ul> \n </div> \n\t\t\t</div> \n </div>\n \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('Top Supporters','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <div id=\"smooth_sldr_donations\">\n\t\t\t\t\t <ul>\n <li><a href=\"http://www.jacobwiechman.com/wordpress//\" title=\"Visit Jacob Wiechman - $50\" >Jacob Wiechman - $50</a></li>\n <li><a href=\"http://malamedconsulting.com/\" title=\"Visit Connie Malamed - $25\" >Connie Malamed - $25</a></li>\n <li><a href=\"http://uwaterloo.ca/\" title=\"Visit Trevor Bain - $25\" >Trevor Bain - $25</a></li>\n <li><a href=\"http://www.whatsthebigidea.com/\" title=\"Visit WhatsTheBigIdea.com,Inc. - $20\" >WhatsTheBigIdea.com,Inc. - $20</a></li>\n </ul> \n </div>\n </div> \n\t\t\t</div> \n </div> \n <div style=\"clear:left;\"></div>\n\n <div id=\"side-info-column\" style=\"float:left;width:325px;\"> \n <div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Recommended WordPress Hosting','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <div style=\"margin:10px 5px\">\n <a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/hostgator.gif');?>\" alt=\"Recommended Web Hosting\" /></a>\n <p><a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\">HostGator</a> is one of the world's top 10 largest web hosting companies with more than 5,000,000 hosted domains. You can host your own WordPress installation with custom themes, plugins, and your own domain name with HostGator from only $3.96 a month.</p>\n <p><strong>Features: </strong>UNLIMITED Disk Space and Bandwidth, FREE Site Building Tools and Templates, 24/7/365 Award Winning Technical Support</p>\n <p>For more info visit <a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\">HostGator.com</a></p>\n </div>\n </div></div></div>\n \n \t\t<div id=\"side-info-column\" style=\"float:left;margin-left:1em;width:325px;\"> \n <div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Recommended Themes','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <div style=\"margin:10px 5px\">\n <a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/elegantthemes.gif');?>\" alt=\"Recommended WordPress Themes\" /></a>\n <p><a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\">Elegant Themes</a> are attractive, compatible, affordable, SEO optimized WordPress Themes and have best support in community.</p>\n <p><strong>Beautiful themes, Great support!</strong></p>\n <p><a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\">For more info visit ElegantThemes</a></p>\n </div>\n </div></div></div>\n \n \n <div style=\"clear:left;\"></div>\n </div> <!--end of poststuff --> \n\n\n</div> <!--end of float wrap -->\n<?php\t\n}",
"public function handleDeleteImage(){\n\n $session = $this->hlp->sess(\"images\");\n $img = $session->toDelete;\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n $imgs = $this->listings->getListingImages($listingID);\n \n unset($imgs[$img]);\n\n //reindexed array after unset\n $newArray = array();\n \n foreach ($imgs as $image){\n array_push($newArray, $image);\n }\n \n unset($imgs);\n \n //final array - updated - without deleted images to store in db\n $images = serialize($newArray);\n \n $this->listings->updateListingImages($listingID, $images);\n $this->redirect(\"Listings:editListing\", $listingID);\n }",
"function remove() {\n\n\t\t$this->readychk();\n\n\t\t// Remove slide from its queue.\n\t\t$queue = $this->get_queue();\n\t\t$queue->remove_slide($this);\n\t\t$queue->write();\n\n\t\t// Remove slide data files.\n\t\tif (!empty($this->dir_path)) {\n\t\t\trmdir_recursive($this->dir_path);\n\t\t}\n\t}",
"public function destroy($id)\r\n {\r\n SliderModel::find($id)->delete();\r\n \r\n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"function delete_multiple_text_image_slider()\n\t{\n\t\t$page_id = $this->input->post('page_id');\n\t\t$this->form_validation->set_rules('table_records[]', 'Row', 'required', array(\n\t\t\t'required' => 'You must select at least one row!'\n\t\t));\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$this->session->set_flashdata('error', validation_errors());\n\t\t\tredirect('text_image_slider/text_image_slider_index/' . $page_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->Text_image_slider_model->delete_multiple_text_image_slider();\n\t\t\t$this->session->set_flashdata('success', 'Successfully Deleted');\n\t\t\tredirect('text_image_slider/text_image_slider_index/' . $page_id);\n\t\t}\n\t}",
"public function beforeDelete()\n {\n // Find the related custom value\n $customValues = CustomValueModel::where('product_id', '=', $this->id)->get();\n\n $customValues->each(function ($value) {\n // Delete relation\n $relation = DB::table('tiipiik_catalog_csf_csv')\n ->where('custom_value_id', '=', $value->id)\n ->delete();\n\n // Delete custom value\n CustomValueModel::find($value->id)->delete();\n });\n\n // Detach properties\n $this->properties()->detach();\n }",
"public function removeAction() {\r\n //DELETE SLIDE DURING THE UPLOAD\r\n $is_ajax = (int) $this->_getParam('is_ajax');\r\n if (!empty($is_ajax)) {\r\n\r\n //GET IMAGE ID AND IT'S OBJECT\r\n $image_id = (int) $this->_getParam('image_id');\r\n $image = Engine_Api::_()->getItem('advancedslideshow_image', $image_id);\r\n\r\n $db = $image->getTable()->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $image->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n //@unlink(APPLICATION_PATH . \"/public/advancedslideshow/1000000/1000/5/\" . $image_id . 't.' . $image->extension);\r\n }\r\n\r\n //GET SLIDESHOW ID AND IT'S OBJECT\r\n $advancedslideshow_id = (int) $this->_getParam('advancedslideshow_id');\r\n $this->view->advancedslideshow = $advancedslideshow = Engine_Api::_()->getItem('advancedslideshow', $advancedslideshow_id);\r\n\r\n if ($this->getRequest()->isPost() && $this->getRequest()->getPost('confirm') == true) {\r\n\r\n //GET IMAGE ID AND IT'S OBJECT\r\n $image_id = (int) $this->_getParam('image_id');\r\n $image = Engine_Api::_()->getItem('advancedslideshow_image', $image_id);\r\n\r\n if (empty($image)) {\r\n return;\r\n }\r\n\r\n $db = $image->getTable()->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $image->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //@unlink(APPLICATION_PATH . \"/public/advancedslideshow/1000000/1000/5/\" . $image_id . 't.' . $image->extension);\r\n\r\n //GET TOTAL SLIDES COUNT\r\n $total_images = Engine_Api::_()->getDbTable('images', 'advancedslideshow')->getTotalSlides($advancedslideshow_id);\r\n\r\n $start_index = $advancedslideshow->start_index;\r\n\r\n if ($start_index > $total_images - 1) {\r\n if ($total_images != 0) {\r\n $advancedslideshow->start_index = $total_images - 1;\r\n $advancedslideshow->save();\r\n } else {\r\n $advancedslideshow->start_index = 0;\r\n $advancedslideshow->save();\r\n }\r\n }\r\n\r\n $parentRedirect = 'admin/advancedslideshow/slides/manage/advancedslideshow_id/' . $advancedslideshow_id;\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => 10,\r\n 'parentRedirect' => $parentRedirect,\r\n 'messages' => Zend_Registry::get('Zend_Translate')->_('You have successfully deleted the slide.')\r\n ));\r\n }\r\n }",
"function callbackRowDelete() {\n $this->deleted = true;\n foreach(array_keys($this->widgets) as $w) {\n $this->widgets[$w]->hide();\n $this->table->table->remove($this->widgets[$w]);\n $this->widgets[$w]->destroy();\n }\n $this->deleteMenuItem->hide();\n \n $this->table->deleteMenu->remove($this->deleteMenuItem);\n $this->deleteMenuItem->destroy();\n $this->table->frame->hide();\n $this->table->frame->show();\n }",
"function qform_remove_item($def, $cfg)\n{\n global $config, $db_prefix;\n\n // do\n $primary_val = get_param('primary_val');\n $idx = get_param('idx');\n\n // remove_item can also remove multiple items, simple use: $_GET['primary_val'] = '1,2,3,4,5,6...';\n $pv_arr = explode(',', $primary_val);\n if (empty($pv_arr)) {\n $pv_arr = array($primary_val);\n }\n\n // get data\n foreach ($pv_arr as $primary_val) {\n $res = sql_query(\"SELECT * FROM $cfg[table] WHERE $cfg[primary_key] = '$primary_val' LIMIT 1\");\n $old_values = $row = sql_fetch_array($res);\n\n // remove files\n foreach ($def as $key=>$val) {\n @$fn = $row[$val['field']];\n if ($val['type'] == 'file') {\n @unlink($cfg['file_folder'].'/'.$fn);\n }\n if (($val['type'] == 'img') || ($val['type'] == 'image') || ($val['type'] == 'img_resize') || ($val['type'] == 'image_resize')) {\n @unlink($cfg['img_folder'].'/'.$fn);\n }\n if ($val['type'] == 'thumb') {\n @unlink($cfg['img_folder'].'/'.$fn);\n @unlink($cfg['thumb_folder'].'/'.$fn);\n }\n if (($val['type'] == 'img_series') || ($val['type'] == 'img_set')) {\n $ok = false;\n $i = 0;\n while (!$ok) {\n $i++;\n $fn = $val['prefix'].'_'.$primary_val.'_'.$i;\n if (!file_exists(\"$cfg[img_folder]/$fn.jpg\")) {\n $ok = true;\n } else {\n unlink(\"$cfg[img_folder]/$fn.jpg\");\n unlink(\"$cfg[thumb_folder]/$fn.jpg\");\n }\n }\n }\n }\n\n // remove from table...\n $old = sql_qquery(\"SELECT * FROM $cfg[table] WHERE $cfg[primary_key]='$primary_val' LIMIT 1\");\n\n if (!empty($cfg['enable_log'])) {\n $log_info = sql_qquery(\"SELECT $cfg[log_title] FROM $cfg[table] WHERE $cfg[primary_key] = '$primary_val' LIMIT 1\");\n }\n sql_query(\"DELETE FROM $cfg[table] WHERE $cfg[primary_key] = '$primary_val' LIMIT 1\");\n if (!empty($cfg['enable_log'])) {\n $new = array();\n qform_log($primary_val, $log_info[0], LOG_DEL, $old, $new, $cfg['table']);\n }\n\n // remove permalink\n if (!empty($cfg['permalink_script'])) {\n sql_query(\"DELETE FROM \".$db_prefix.\"permalink WHERE target_script='$cfg[permalink_script]' AND target_idx='$primary_val' LIMIT 1\");\n }\n }\n\n // cache\n if (!empty($cfg['auto_recache']) || !empty($cfg['recache']) || !empty($cfg['rebuild_cache'])) {\n qcache_clear();\n }\n\n // hurray! done!\n $strip = array('qform_cmd', 'id', 'primary_val');\n $url = str_replace('&', '&', urldecode(clean_get_query($strip)));\n\n if (empty($cfg['post_process'])) {\n msg_die($cfg['msg']['ok'], $url);\n } else {\n if (function_exists($cfg['post_process'])) {\n call_user_func($cfg['post_process'], $cfg['cmd'], $primary_val, false, $old_values, $old_values, false);\n } else {\n redir($cfg['post_process'].\"&qform_cmd=$cfg[cmd]&qform_id=$primary_val\");\n }\n }\n}",
"function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}",
"function deleteDataInfo()\n {\n $formPost=array();\n $formPost[deleted]=1;\n \n foreach($this->piVars['selectionList'] as $idVal)\n {\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery($this->tableName,'uid='.$idVal,$formPost);\n }\n return $this->showListings();\n }",
"function del()\n {\n $id = $this->uri->rsegment(3);\n $this->_del($id);\n \n //tạo ra nội dung thông báo\n $this->session->set_flashdata('message', 'Xóa slide thành công');\n redirect(admin_url('slide'));\n }",
"public function destroy($id)\n {\n \n $sliders = DB::table('sliders')->where('id',$id)->get();\n foreach ($sliders as $slider) {\n Storage::delete('public/upload/'.$slider->name);\n }\n Slider::where('id',$id)->delete();\n return redirect()->back();\n\n \n //dd(Storage::delete('public/upload/'.$img));\n //return redirect()->back();\n \n }",
"public function EliminarSlider($slider_id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $this->getDoctrine()->getRepository('IcanBundle:Slider')\n ->find($slider_id);\n\n if ($entity != null) {\n\n $pos_elimnar = $entity->getPosicion();\n\n //Eliminar foto\n $foto_eliminar = $entity->getImagen();\n if ($foto_eliminar != \"\") {\n $dir = 'uploads/sliders/';\n if (is_file($dir . $foto_eliminar)) {\n unlink($dir . $foto_eliminar);\n }\n }\n $em->remove($entity);\n\n //Actualizar posiciones\n $sliders = $this->getDoctrine()->getRepository('IcanBundle:Slider')\n ->ListarSliderMayorPosision($pos_elimnar);\n foreach ($sliders as $slider) {\n $slider->setPosicion($slider->getPosicion() - 1);\n }\n\n $em->flush();\n $resultado['success'] = true;\n } else {\n $resultado['success'] = false;\n $resultado['error'] = \"No existe el registro solicitado\";\n }\n\n return $resultado;\n }",
"protected function _postDelete()\n\t{\n\t}",
"public function onRemove();",
"protected function _delete()\r\n\t{\r\n\t\t$oFlexSliderSlider = new FlexSliderSlider($this -> _iId);\r\n\t\t$mStatus = $oFlexSliderSlider -> delete();\r\n\t\t//$this -> _removeSlides($this -> _iId);\r\n\t\t$this -> _aRedirect['id'] = false;\r\n\t\t$this -> _aRedirect['action'] = false;\r\n\t\t\t\r\n\t\tif (is_string($mStatus))\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = $mStatus;\r\n\t\t}\r\n\t\telse if ($mStatus === true)\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = 'removed';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = 'error';\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"protected function postDelSlider(Slider $sliderModel, Request $request){\n\n $data['id'] = $request->input('del_slider_id');\n\n $del = $sliderModel->delSlider($data);\n\n if($del)\n return redirect()->back()->with('successadmin', 'Delete image slider!');\n else\n return redirect()->back()->with('errorsadmin', 'Error!');\n }",
"function removeFromSlideshow()\r\n\t{\r\n\t\t$art_object_id = $this->input->post('art_object_id');\r\n\t\t\r\n\t\t$result = $this->artobject_model->deleteFromSlideshow($art_object_id);\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t$url = base_url('admin/manageArt/0/slideshowDeleted');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$url = base_url('admin/manageArt/0/slideshowDeletedFailed');\r\n\t\t}\r\n\t\tredirect($url);\r\n\t}",
"protected function _afterLoad()\r\n {\r\n if ($this->_previewFlag) {\r\n $items = $this->getColumnValues('slider_id');\r\n if (count($items)) {\r\n $select = $this->getConnection()->select()->from(\r\n $this->getTable('slider_store')\r\n )->where(\r\n $this->getTable('slider_store') . '.slider_id IN (?)',\r\n $items\r\n );\r\n if ($result = $this->getConnection()->fetchPairs($select)) {\r\n foreach ($this as $item) {\r\n if (!isset($result[$item->getData('slider_id')])) {\r\n continue;\r\n }\r\n if ($result[$item->getData('slider_id')] == 0) {\r\n $stores = Mage::app()->getStores(false, true);\r\n $storeId = current($stores)->getId();\r\n $storeCode = key($stores);\r\n }\r\n else {\r\n $storeId = $result[$item->getData('slider_id')];\r\n $storeCode = Mage::app()->getStore($storeId)->getCode();\r\n }\r\n $item->setData('_first_store_id', $storeId);\r\n $item->setData('store_code', $storeCode);\r\n }\r\n }\r\n }\r\n }\r\n\r\n parent::_afterLoad();\r\n }",
"function deleteData()\n{\n global $myDataGrid;\n global $f;\n global $tbl;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n if ($tbl->deleteMultiple($arrKeys)) {\n $myDataGrid->message = $tbl->strMessage;\n $f->setValues('step', getDataListRecruitmentProcessTypeStep(null, true));\n } else {\n $myDataGrid->errorMessage = \"Failed to delete data \" . $tbl->strEntityName;\n }\n}",
"protected function _preDelete() {}",
"function remove($aws_data_object) {\n\t\t}",
"function deleteValue() {\r\n $val_id = JRequest::getVar('val_id', '', '', 'array');\r\n $value = & JTable::getInstance('cpvalue', 'Table');\r\n foreach ($val_id as $value_id) {\r\n $value->load($value_id);\r\n $value->delete();\r\n }\r\n }",
"public function afterDelete()\n {\n foreach (static::find()->where(['parent_id' => $this->id])->all() as $item) {\n $item->delete();\n }\n }",
"public function onAfterDelete()\n {\n if (!$this->hasAssets()) {\n return;\n }\n\n // Prepare blank manipulation\n $manipulations = new AssetManipulationList();\n\n // Add all assets for deletion\n $this->addAssetsFromRecord($manipulations, $this->owner, AssetManipulationList::STATE_DELETED);\n\n // Whitelist assets that exist in other stages\n $this->addAssetsFromOtherStages($manipulations);\n\n // Apply visibility rules based on the final manipulation\n $this->processManipulation($manipulations);\n }",
"protected function beforeDelete($data)\n {\n $this->cleanFiles($data);\n }",
"public function destroy(Slider $slider)\n {\n \n $slider->delete();\n \n return back()->with('info','Eliminado Correctamente');\n }",
"public function processDeletePlaceholder() {}",
"protected function afterRemoving()\n {\n }",
"public function sliderRestore()\n {\n $slider = Image::where('imageable_type','=','App\\SiteSettings')->get();\n if ($slider->count() ==0)\n return redirect(\"/\");\n $this->delete($slider[0]->image_url);\n $this->removeUrl($slider[0]);\n return redirect(\"/\");\n }",
"public function delete_gallery_item() {\n\t\n\t\t\t// Delete attachment\n\t\t\twp_delete_attachment( intval( $_POST[ 'attachment_id' ] ) );\n\t\n\t\t\t// Return the updated gallery\n\t\t\t$this->draw_gallery_items( intval( $_POST[ 'gallery_id' ] ) );\n\t\n\t\t\texit;\n\t\t}",
"function after_delete() {}",
"public function after_delete() {}",
"public function destroy($id)\n {\n $this->slider->delete();\n \\Storage::delete($this->slider->imagen);\n Session::flash('message','slider eliminado correctamente');\n return Redirect::to('/slider');\n }",
"public function onDeletePages($data) {\n return $this->worker()->onDeletePages($data);\n }",
"public function deleteall()\n\t{\n\t\t$ids = $this->input->post('records');\n\t\t$slider_cat = $this->SqlModel->getSingleField('slider_cat','slider',array('slider_id'=>$ids[0]));\n\t\tif(!empty($ids))\n\t\t{\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t$this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\t\n\t\t\t}\n\t\t}\n\t\tredirect(base_url().'manage/'.$this->controller.'/index/deletesuccess/'.$slider_cat,'location');\t\t\n\t\t\n\t}",
"public function onBeforeDelete(){\n\t\tparent::onBeforeDelete();\n\n\t\tif($this->Images() && $images = $this->Images()){\n\t\t\tforeach($images as $image){\n\t\t\t\tif($image->exists()){\n\t\t\t\t\t$image->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n {\n DB::table('sliders')->delete();\n for ($i = 0; $i < 3; $i ++) {\n $slider = new Slider();\n $slider->fill([\n 'title' => 'مؤسسة تربوية + حواس= قمم تربوية عالية',\n 'description' => 'معا ننهض بمؤسستكم نحو قمم المهارات, الصحية والحياتية المجتمعية اكثر من عقد من الزمان ومؤسستنا تساهم بدمج برامج ابداعية وتفاعليه للمؤسسات التربوية وجميعها من خارج الصندوق',\n 'image' => 'dummy/slider.png'\n ])->save();\n }\n }",
"function ondelete(){\n\t\tforeach($this->get_sections() as $one){\n\t\t\t$one->dbdelete();\n\t\t}\n\t\treturn true;\n\t}",
"public function afterDelete() {\n $this->deleteMeta();\n parent::afterDelete();\n }",
"function deleteItemFromDB()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->carousel_model->delete($result);\n }\n }",
"public function remove_dynamic_pricing_data( LaterPay_Core_Event $event ) {\n $event->set_result(\n array(\n 'success' => false,\n )\n );\n\n if ( ! isset( $_POST['post_id'] ) || empty( $_POST['post_id'] ) ) { // phpcs:ignore\n throw new LaterPay_Core_Exception_InvalidIncomingData( 'post_id' );\n }\n\n $post_id = absint( $_POST['post_id'] ); // phpcs:ignore\n $post_price = get_post_meta( $post_id, LaterPay_Helper_Pricing::META_KEY, true );\n\n $keys_to_unset = [\n 'price_range_type',\n 'start_price',\n 'end_price',\n 'reach_end_price_after_days',\n 'change_start_price_after_days',\n 'transitional_period_end_after_days',\n ];\n\n foreach ( $keys_to_unset as $key ) {\n if ( isset( $post_price[ $key ] ) ) {\n unset( $post_price[ $key ] );\n }\n }\n\n $this->set_post_meta(\n 'laterpay_post_prices',\n $post_price,\n $post_id\n );\n\n $event->set_result(\n array(\n 'success' => true,\n )\n );\n return;\n }",
"protected function _postDelete()\n {\n $this->clearResources();\n }",
"function preDelete()\n {\n }",
"public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }",
"public function destroy(Slider $slider)\n {\n $slider->delete();\n toastr()->success('اسلاید با موفقیت حذف شد');\n return back();\n }",
"protected function afterDelete()\r\n {\r\n }",
"public function preDelete() { }",
"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 }",
"function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }",
"public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }",
"public function destroy($id)\n\t{\n\t\tif(!User::hasPermTo(MODULE,'delete'))return Redirect::to('admin/error/show/403');\n\t\t$slider = Slider::find($id);\n\t\tunlink('uploads/sliders/'.$slider->slider_image);\n\t\tSlider::destroy($id);\n\t\tSession::flash('success', 'Slider is successfully deleted.');\n\t\treturn Redirect::to('admin/slider');\n\t}",
"abstract public function delete__do_process ();",
"private function removeFormData() {\n\t\tif (isset($_SESSION[\"dsgvo\"][\"remove_formdata_cronjob\"]) && $_SESSION[\"dsgvo\"][\"remove_formdata_cronjob\"] === date(\"Ymd\")) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\t$_SESSION[\"dsgvo\"][\"remove_formdata_cronjob\"] = date(\"Ymd\");\n\t\t}\n\n\t\t$expire = date(\"Y-m-d\", time() - 86400 * (int)$this->settings[\"formdata_autoremove_interval\"]);\n\n\t\t$GLOBALS[\"db\"]->query(\n\t\t\t\"DELETE _lead, _content \".\n\t\t\t\"FROM {$GLOBALS[\"cms\"]->tbname[\"papoo_form_manager_leads\"]} _lead \".\n\t\t\t\"LEFT JOIN {$GLOBALS[\"cms\"]->tbname[\"papoo_form_manager_lead_content\"]} _content ON _content.form_manager_content_lead_id_id = _lead.form_manager_lead_id \".\n\t\t\t\"WHERE DATE(FROM_UNIXTIME(_lead.form_manager_form_datum)) <= '$expire'\"\n\t\t);\n\t}",
"public function destroy($id)\n {\n //\n $slider = Slider::find($id);\n $slider->delete();\n }",
"public function destroy(Request $request)\n {\n $slider = Slider::whereId($request->id)->first();\n\n File::delete(Config::get('path.uploads').'/sliders/'.$slider->image);\n\n $slider->delete();\n\n return redirect()->action('Admin\\SliderController@index');\n }",
"public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}",
"protected function afterDelete($data)\n {\n /** @var $model LangActiveRecord */\n $model = $this->getModel();\n foreach((array)$data as $pid)\n Seo::model()->deleteMeta(array('pid' => $pid, 'entity' => $model->classId(true)));\n\n if(method_exists($model, 'refreshCache'))\n $model->refreshCache();\n\n if(array_key_exists('bpid', $model->relations()))\n {\n foreach((array)$data as $item)\n $model->deleteBasePid($item);\n }\n }",
"public function destroy($ids)\n {\n //\n $ids = explode(',', $ids);\n if ($ids[0] == 'on') {\n unset($ids[0]);\n }\n foreach ($ids as $id) {\n $slider = Slider::findOrFail($id);\n $img_path = base_path() . '/uploads/slider/';\n\n if ($slider->image != null) {\n unlink(sprintf($img_path . '%s', $slider->image));\n }\n $slider->delete();\n }\n }",
"public function destroy($id)\n {\n\n $slider=Slider::find($id);\n \n if(Storage::delete('public/slider/'.$slider->slider)){\n $slider->delete();\n return redirect('Admin/slider')->with('success','Photo Deleted');\n }\n }",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll('photo_id='.$this->id);\n\t\tTag::model()->updateFrequency($this->tags, '');\n\t}",
"public function handleDelete($key)\n {\n $val = $this->page->meta[$key];\n $this->page->deleteMeta($key);\n\n $this->presenter->flashMessage(\"Postavka je izbrisana\");\n //$this->invalidateControl('editpage_metalist');\n\n $this->invalidateControl();\n if (!$this->presenter->isAjax()) {\n $this->redirect('this#toc-meta');\n }\n }",
"function delete_slide($slide_id)\r\n {\r\n return $this->db->delete('slide',array('slide_id'=>$slide_id));\r\n }",
"public function destroy(Slider $slider)\n {\n //\n $isDeleted = $slider->delete();\n return response()->json(['message' => $isDeleted ? \"تم حذف سلايدر بنجاح\" : \"خطأ في حذف سلايدر\"], $isDeleted ? 200:400);\n }",
"public function deleted(Carousel $carousel)\n {\n // TODO :: delete the image from disk\n }",
"private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function deleteByFilter($sliderImageVo){\n\t\ttry {\n\t\t\t$sql = 'DELETE FROM `slider_image`';\n\t\t\t$isDel = false;\n\t\t\t$condition = array();\n\t\t\t$params = array();\n\t\t\tif (!is_null($sliderImageVo->sliderImageId)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`slider_image_id` = :sliderImageId';\n\t\t\t\t$params[] = array(':sliderImageId', $sliderImageVo->sliderImageId, PDO::PARAM_INT);\n\t\t\t}\n\t\t\tif (!is_null($sliderImageVo->sliderId)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`slider_id` = :sliderId';\n\t\t\t\t$params[] = array(':sliderId', $sliderImageVo->sliderId, PDO::PARAM_INT);\n\t\t\t}\n\t\t\tif (!is_null($sliderImageVo->image)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`image` = :image';\n\t\t\t\t$params[] = array(':image', $sliderImageVo->image, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($sliderImageVo->title)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`title` = :title';\n\t\t\t\t$params[] = array(':title', $sliderImageVo->title, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($sliderImageVo->description)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`description` = :description';\n\t\t\t\t$params[] = array(':description', $sliderImageVo->description, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($sliderImageVo->link)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`link` = :link';\n\t\t\t\t$params[] = array(':link', $sliderImageVo->link, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($sliderImageVo->order)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`order` = :order';\n\t\t\t\t$params[] = array(':order', $sliderImageVo->order, PDO::PARAM_INT);\n\t\t\t}\n\t\t\tif(!$isDel){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sql .= ' WHERE ' . join(' and ', $condition);\n\t\t\t}\n\t\t\n\t\t\t//debug\n\t\t\tLogUtil::sql('(deleteByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\t\t\n\t\t\t$stmt = $this->conn->prepare($sql);\n\t\t\tforeach ($params as $param){\n\t\t\t\t$stmt->bindParam($param[0], $param[1], $param[2]);\n\t\t\t}\n\t\t\t$stmt->execute();\n\t\t\treturn true;\n\t\t}\n\t\tcatch (PDOException $e) {\n\t\t\tthrow $e;\n\t\t}\n\t\treturn null;\n\t}",
"function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}",
"public function 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 }",
"function OnBeforeSubMegaDelete(&$sub_Storage){\n }",
"public function destroy($id)\n {\n try{\n $slider= Slider::find($id);\n\n $link = $slider->img_url;\n\n $slider->delete();\n\n if($slider->img_url!=null){\n if(\\File::exists(public_path($link))){\n unlink(public_path($link));\n\n }\n\n }\n\n\n\n Session::flash('danger', 'Image is deleted');\n return Redirect::back();\n }catch (Exception $exception){\n Session::flash('alert', 'Image is not deleted');\n return Redirect::back();\n }\n\n\n }",
"public function processDelete()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->delete($this->module->table_name, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_lang, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_related, 'id_parent='.$pageId.' OR id_related='.$pageId);\n\n $this->redirect_after = static::$currentIndex.'&conf=1&token='.$this->token;\n }",
"function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}",
"public function destroy($id)\n {\n $slider=Slider::find($id);\n $slider->delete();\n unlink('image/slider/'.$slider->image);\n Session::flash('success','Slider Deleted successfully');\n return redirect()->back();\n }",
"public function onAfterDelete();",
"function cs_pb_gallery($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t\t$name = $_POST['action'];\n\t\t\t$counter = $_POST['counter'];\n\t\t\t$gallery_element_size = '50';\n\t\t\t$cs_gal_header_title_db = '';\n\t\t\t$cs_gal_view_all_db = '';\n\t\t\t$cs_gal_view_all_url_db = '';\n\t\t\t$cs_gal_layout_db = '';\n\t\t\t$cs_gal_album_db = '';\n \t\t\t$cs_gal_desc_db = '';\n\t\t\t$cs_gal_pagination_db = '';\n\t\t\t$cs_gal_media_per_page_db = get_option(\"posts_per_page\");\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$gallery_element_size = $cs_node->gallery_element_size;\n\t\t\t$cs_gal_header_title_db = $cs_node->header_title;\n\t\t\t$cs_gal_view_all_db = $cs_node->view_all;\n\t\t\t$cs_gal_view_all_url_db = $cs_node->view_all_url;\n\t\t\t$cs_gal_layout_db = $cs_node->layout;\n\t\t\t$cs_gal_album_db = $cs_node->album;\n \t\t\t$cs_gal_desc_db = $cs_node->desc;\n\t\t\t$cs_gal_pagination_db = $cs_node->pagination;\n\t\t\t$cs_gal_media_per_page_db = $cs_node->media_per_page;\n\t\t\t\t$counter = $post->ID.$count_node;\n\t}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $gallery_element_size?>\" item=\"gallery\" data=\"<?php echo element_size_data_array_index($gallery_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"gallery_element_size[]\" class=\"item\" value=\"<?php echo $gallery_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n <div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Gallery Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\"> </a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Gallery Header Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_gal_header_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_gal_header_title_db)?>\" />\n <p>Please enter gallery header title.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>View All Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_gal_view_all[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_gal_view_all_db)?>\" />\n <p>Please enter the title.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>View All URL</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_gal_view_all_url[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_gal_view_all_url_db)?>\" />\n <p>Please enter the URL for view all.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose Gallery Layout</label></li>\n <li class=\"to-field\">\n <select name=\"cs_gal_layout[]\" class=\"dropdown\">\n <option value=\"gallery-4-col\" <?php if($cs_gal_layout_db==\"gallery-4-col\")echo \"selected\";?> >4 Column</option>\n <option value=\"gallery-3-col\" <?php if($cs_gal_layout_db==\"gallery-3-col\")echo \"selected\";?> >3 Column</option>\n <option value=\"gallery-2-col\" <?php if($cs_gal_layout_db==\"gallery-2-col\")echo \"selected\";?> >2 Column</option>\n <option value=\"gallery-two-col-with-title\" <?php if($cs_gal_layout_db==\"gallery-two-col-with-title\")echo \"selected\";?> >2 Column - Gallery with title</option>\n </select>\n \n <p>Select gallery layout, single column, double column, thriple column or four column.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose Gallery/Album</label></li>\n <li class=\"to-field\">\n <select name=\"cs_gal_album[]\" class=\"dropdown\">\n \t<option value=\"0\">-- Select Gallery --</option>\n <?php\n $query = array( 'posts_per_page' => '-1', 'post_type' => 'cs_gallery', 'orderby'=>'ID', 'post_status' => 'publish' );\n $wp_query = new WP_Query($query);\n while ($wp_query->have_posts()) : $wp_query->the_post();\n ?>\n <option <?php if($post->post_name==$cs_gal_album_db)echo \"selected\";?> value=\"<?php echo $post->post_name; ?>\"><?php echo get_the_title()?></option>\n <?php\n endwhile;\n ?>\n </select>\n <p>Select gallery album to show images.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Show Description</label></li>\n <li class=\"to-field\">\n <select name=\"cs_gal_desc[]\" class=\"dropdown\">\n <option <?php if($cs_gal_desc_db==\"On\")echo \"selected\";?> >On</option>\n <option <?php if($cs_gal_desc_db==\"Off\")echo \"selected\";?> >Off</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Pagination</label></li>\n <li class=\"to-field\">\n <select name=\"cs_gal_pagination[]\" class=\"dropdown\" >\n <option <?php if($cs_gal_pagination_db==\"Show Pagination\")echo \"selected\";?> >Show Pagination</option>\n <option <?php if($cs_gal_pagination_db==\"Single Page\")echo \"selected\";?> >Single Page</option>\n </select>\n </li>\n </ul>\n\t\t\t\t<ul class=\"form-elements\" >\n <li class=\"to-label\"><label>No. of Media Per Page</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"cs_gal_media_per_page[]\" class=\"txtfield\" value=\"<?php echo $cs_gal_media_per_page_db; ?>\" />\n <p>To display all the records, leave this field blank.</p>\n </li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"gallery\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}",
"function cmc_framework_markets_landing_process_uploaded_file($form, &$form_state) {\n \n for ($i=1; $i<=5; $i++) {\n $tab = 'tab' . $i;\n $image_key = 'cmc_framework_markets_tab' . $i . '_image';\n $image_key_delete = 'cmc_framework_markets_tab' . $i . '_image_delete';\n \n if ($form_state['values'][$image_key] != 0) {\n // The new file's status is set to 0 or temporary and in order to ensure\n // that the file is not removed after 6 hours we need to change it's status\n // to 1.\n $file = file_load($form_state['values'][$image_key]);\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n \n // delete current file\n $image_fid = variable_get($image_key, '');\n if ($image_fid) {\n $f = file_load($image_fid);\n if (!empty($f->fid) && file_delete($f)) {\n drupal_set_message($f->filename . ' deleted');\n }\n }\n \n }\n else {\n $image_delete = $form_state['values'][$image_key_delete];\n if (!$image_delete) {\n unset($form_state['values'][$image_key]);\n }\n else {\n $image_fid = variable_get($image_key, '');\n $file = file_load($image_fid);\n \n if (file_delete($file)) {\n drupal_set_message($file->filename . ' deleted');\n }\n else {\n drupal_set_message($file->filename . ' could not be deleted. ');\n \n // so we still keep a record fo the file\n unset($form_state['values'][$image_key]);\n }\n }\n }\n }\n\n}",
"function rp_deaktivierungs_hooks() {\n // -----------------------------------------------\n $spielerSeiteId = get_option('rp_results_parser_einstellungen_data')['spielerSeiteId'];\n $alleSpielerSeiteId = get_option('rp_results_parser_einstellungen_data')['alleSpielerSeiteId'];\n wp_delete_post($spielerSeiteId, true);\n wp_delete_post($alleSpielerSeiteId, true);\n\n\n // Loesche Tabellen rp_spieler_daten und rp_mannschaften_daten\n // -----------------------------------------------------------\n global $wpdb;\n $table = $wpdb->prefix . \"rp_spieler_daten\";\n $wpdb->query(\"DROP TABLE IF EXISTS $table\");\n\n $table = $wpdb->prefix . \"rp_mannschaften_daten\";\n $wpdb->query(\"DROP TABLE IF EXISTS $table\");\n\n\n // Loesche alle rp_spieler Posts\n // -----------------------------\n $posts_table = $wpdb->posts;\n $query = \"DELETE FROM {$posts_table} WHERE post_type = 'rp_spieler'\";\n $wpdb->query($query);\n\n\n // Loesche Taxnomoy-Term Relationen, rp_spieler_mannschaft Terms\n // und rp_spieler_mannschaft Taxonomy- TODO\n // -------------------------------------------------------------\n $terms = get_terms('rp_spieler_mannschaft', array('fields' => 'ids', 'hide_empty' => false));\n foreach ($terms as $value) {\n wp_delete_term($value, 'rp_spieler_mannschaft');\n }\n\n $wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => 'rp_spieler_mannschaft'));\n\n\n // Loesche Einstellungen bei wp_options rp_results_parser_einstellungen\n // --------------------------------------------------------------------\n delete_option('rp_results_parser_einstellungen_data');\n}",
"public function delete()\n\t{\n\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_fields', array( 'field_type=?', 'Upload' ) ) AS $field )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_values', array( \"value_value<>? OR value_value IS NOT NULL\", '' ) ) as $cfield )\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\File::get( 'core_FileField', $cfield[ 'value_value' ] )->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\Exception $e ){}\n\t\t}\n\t}",
"protected function _postDelete()\n {\n $this->getResource()->delete();\n\n $this->getIssue()->compileHorizontalPdfs();\n }",
"public function destroy(Slider $slider)\n {\n if ($slider->update(['status' => 'd'])) {\n return response()->json(['message' => 'Delete Successfully!'], 200);\n } else {\n return response()->json(['message' => 'Delete Unsuccessfully!'], 200);\n }\n }",
"function deleteimage()\r\n\t{ \t\r\n\t if (isset($_POST['remove']) && $_POST['remove']=='remove selected')\r\n\t {//get the values \r\n \t $id1 = array();\r\n \t $id1 = $_POST['removeid'];\r\n \t $parentid = $_POST['parentid'];\r\n \t if (count($id1) > 0)\r\n \t { //fetch each and every one check box item\r\n \t foreach ($id1 as $id)\r\n \t {\r\n \t \t$this->categeory_model->deleteimage($id);\r\n \t \tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t\t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n \t }\r\n\t }\r\n\t }\r\n\t else{\r\n\t \t\r\n\t\t$id = $this->uri->segment(4);\r\n\t\t$parentid = $this->uri->segment(5);\r\n\t\t$this->categeory_model->deleteimage($id);\r\n\t\tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n\t }\r\n\tredirect('admin/categeory/image_view/'.$parentid);\r\n\t}",
"public function destroy(Slider $slider)\n {\n $slider->delete();\n\n return redirect()->back()->with('success', 'Slider Deleted Successfuly');\n }",
"protected function afterDelete()\n {\n }",
"public function afterDelete() {\r\n parent::afterDelete();\r\n\r\n if($this->id){\r\n Cache::delete('getPracticeTitleById'.$this->id);\r\n }\r\n }",
"protected function _predelete() {\n }",
"public function delete() {\n $this->remove_content();\n\n parent::delete();\n }",
"protected function setDeleteData()\n\t{\n\n\t}"
] | [
"0.669221",
"0.6678323",
"0.6666585",
"0.6647402",
"0.6456898",
"0.63002646",
"0.6024636",
"0.60135365",
"0.59168386",
"0.5907212",
"0.5871957",
"0.5854564",
"0.5852193",
"0.5851042",
"0.58006644",
"0.5800276",
"0.5776466",
"0.5756322",
"0.57377917",
"0.56978333",
"0.56758046",
"0.56610894",
"0.5656546",
"0.5618625",
"0.56114227",
"0.55944824",
"0.5588561",
"0.5585051",
"0.55743825",
"0.55725956",
"0.5561011",
"0.5539982",
"0.55341953",
"0.5510418",
"0.55081266",
"0.55026245",
"0.5485061",
"0.5461081",
"0.5460166",
"0.5447364",
"0.54454064",
"0.5444339",
"0.54437053",
"0.54421026",
"0.5428919",
"0.54253197",
"0.5425184",
"0.5413242",
"0.5413106",
"0.54100865",
"0.54067785",
"0.5406022",
"0.54045886",
"0.5381093",
"0.53672135",
"0.5365042",
"0.53635085",
"0.5360472",
"0.53533757",
"0.53518564",
"0.53502643",
"0.53480035",
"0.5341233",
"0.5335661",
"0.53332055",
"0.5324346",
"0.5323831",
"0.5311524",
"0.53038514",
"0.53037626",
"0.5296455",
"0.5295395",
"0.52924746",
"0.5292008",
"0.5291787",
"0.52834976",
"0.52832",
"0.52761525",
"0.5270844",
"0.52664703",
"0.5258961",
"0.5258394",
"0.52521366",
"0.524605",
"0.52412826",
"0.52391034",
"0.5236542",
"0.5236248",
"0.52354336",
"0.5234672",
"0.5233967",
"0.5230985",
"0.52308387",
"0.5228207",
"0.5227657",
"0.52234006",
"0.52185225",
"0.52169234",
"0.5214649",
"0.52144116",
"0.5207541"
] | 0.0 | -1 |
Connect to MPD server | public function connect($timeout = 30){
$this->connection = \stream_socket_client("tcp://$this->host:$this->port", $errno, $errstr, $timeout);
if (!$this->connection) {
echo "$errstr ($errno)<br />\n";
return;
}
$resp = fgets($this->connection, 1024);
if(strncmp(MPDClient::OK, $resp, strlen(MPDClient::OK)) === 0){
if(strlen($resp) > strlen(MPDClient::OK)){
$this->mpdProtoVersion = substr($resp, strlen(MPDClient::OK));
}
}else{
echo "Error connecting to MPD, No response\n";
fclose($this->connection);
return;
}
if(isset($this->passwd)){
$this->send(MPDClient::PASSWORD.' '.$this->passwd);
}
//Read stats and status
$this->updateState();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function connect() { \n\t\n\t\t// Look at the current instance and pull the options for said instance\n\t\t$options = self::get_instance(); \n\t\t$this->_mpd = new mpd($options['host'],$options['port'],$options['password']);\n\n\t\tif ($this->_mpd->connected) { return true; } \n\n\t\treturn false;\n\n\t}",
"function connect() {\n\n\t\t// only if logins are set\n\t\tif ($this->server->ip && $this->server->port && $this->server->login && $this->server->pass) {\n\t\t\t// log console message\n\t\t\t$this->console('Try to connect to MP dedicated server on {1}:{2} timeout {3}s',\n\t\t\t $this->server->ip, $this->server->port,\n\t\t\t ($this->server->timeout !== null ? $this->server->timeout : 0));\n\n\t\t\t// connect to the server\n\t\t\tif (!$this->client->InitWithIp($this->server->ip, $this->server->port, $this->server->timeout)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] InitWithIp - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// log console message\n\t\t\t$this->console(\"Try to authenticate with login '{1}' and password '{2}'\",\n\t\t\t $this->server->login, $this->server->pass);\n\n\t\t\t// check login\n\t\t\tif ($this->server->login != 'SuperAdmin') {\n\t\t\t\ttrigger_error(\"Invalid login '\" . $this->server->login . \"' - must be 'SuperAdmin' in config.xml !\", E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check password\n\t\t\tif ($this->server->pass == 'SuperAdmin') {\n\t\t\t\ttrigger_error(\"Insecure password '\" . $this->server->pass . \"' - should be changed in dedicated config and config.xml !\", E_USER_WARNING);\n\t\t\t}\n\n\t\t\t// log into the server\n\t\t\tif (!$this->client->query('Authenticate', $this->server->login, $this->server->pass)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] Authenticate - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// enable callback system\n\t\t\t$this->client->query('EnableCallbacks', true);\n\n\t\t\t// wait for server to be ready\n\t\t\t$this->waitServerReady();\n\n\t\t\t// connection established\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// connection failed\n\t\t\treturn false;\n\t\t}\n\t}",
"public function pconnect(): void\n {\n }",
"final public function p_connect() {\n \t$this->connect('', '', '', '', true);\n \t}",
"function connect() {\n $this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass);\n }",
"public function connect() {\n $this->getConnectionSocket();\n }",
"private function mpowerConnect()\n {\n $errno = 0;\n $errstr = \"\";\n $this->_socket = @fsockopen($this->_server, $this->_port, $errno, $errstr, $this->_connectionTimeout);\n if (!$this->_socket) {\n @fclose($this->_socket);\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerConnect]Failed to connect to %s:%s.Errno:%d:%s\",\n $this->_server, $this->_port, $errno, $errstr\n )\n );\n }\n\n }",
"public function connect() {\n if ($this->client) {\n $this->client->connect();\n }\n }",
"function msgsrv_open ($host, $port, $appname, $username, $password) {}",
"public function connect() {\n $this->connection = AMQPStreamConnection($this->server_ip, $this->server_port, $this->username, $this->password);\n }",
"protected function connect()\n {\n $res = $this->memc->connect(MEMCACHE_HOST, 11211);\n $this->namespace = MEMCACHE_NAMESPACE;\n if (MEMCACHE_DEBUG) {\n if ($res) {\n Logger::write('Memcache::connect(): connected');\n } else {\n Logger::write('Memcache::connect(): connect FAILED!');\n }\n }\n }",
"function msession_connect($host, $port)\n{\n}",
"private function connect()\n {\n try {\n self::$connection = new PDO($this->buildDSN(), $this->user, $this->pass, $this->options);\n } catch (PDOException $e) {\n die('Connection failed: ' . $e->getMessage());\n }\n\n }",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"protected function connect($config) {\n\t\t// set the Memcache plugin\n\t\t$this->_memcached = new Memcached;\n\n\t\t$this->_memcached->addServer($config['host'], $config['port'])\n\t\t\tor die('Could not connect to server');\n\n\t\t$this->_isConnected = true;\n\t}",
"private function connect() {\n\t\tif (!$this->connected) {\n\t\t\t$this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\t$this->connected = @socket_connect($this->socket, $this->host, $this->port);\n\t\t}\n\t}",
"function connect() {\n\n $this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass);\n\n}",
"public function connect()\n {\n if (!$this->isConnected()) {\n $this->manager->connect();\n }\n }",
"public function connect()\n\t{\n\t\t$this->isConnected = false;\n\n\t\t$this->connectInternal();\n\t}",
"public function connect()\r\n {\r\n $this->log( \"Connecting to {$this->_server}:{$this->_port}\" );\r\n \r\n // open the connection\r\n $this->_conn = fsockopen( $this->_server, $this->_port, $errno, $errstr, 10 );\r\n \r\n if ( $this->_conn )\r\n {\r\n $this->log( \"Connected.\" );\r\n \r\n // start processing the data\r\n $this->main();\r\n }\r\n }",
"public function connect()\n {\n $this->connection->connect();\n }",
"private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }",
"public function connect()\r\n\t{\r\n\t\t//$this->link = qracle_connect();\r\n\t}",
"public abstract function connect();",
"protected function connect() {}",
"function connect()\n {\n $this->db = new MysqliAdapter($this->config[$this->sectionName]);\n \n if (isset($this->config[$this->sectionName]['username']) && isset($this->config[$this->sectionName]['password']))\n {\n if (!$this->db->connect())\n {\n writeLog('Could not connect to server', E_USER_ERROR);\n exit;\n }\n writeLog(\"connect successfull\");\n } \n else \n {\n writeLog(\"no username or password\");\n $this->unauthorized();\n exit;\n }\n }",
"public function connect(): void;",
"public abstract function Connect();",
"public function connect()\n {\n $this->conn = false;\n $ldapconn = ldap_connect($this->host, $this->port)\n or die('Could not connect to LDAP server.');\n\n $this->conn = $ldapconn;\n }",
"public function connect()\n {\n $this->connection = new \\Memcached('chopra_sso');\n $serverList = $this->connection->getServerList();\n\n $serverExists = false;\n foreach ($serverList as $server) {\n if ($server['host'] === $this->memcachedHost && $server['port'] === (int)$this->memcachedPort) {\n $serverExists = true;\n }\n }\n\n if (!$serverExists) {\n $this->connection->resetServerList();\n $res = $this->connection->addServer($this->memcachedHost, $this->memcachedPort);\n if (!$res) {\n throw new \\MemcachedException('Can\\'t connect to memcache server.');\n }\n }\n $this->connection->setOption(\\Memcached::OPT_SERIALIZER, \\Memcached::SERIALIZER_PHP);\n }",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"abstract public function connect();",
"function ts3client_startConnection($serverConnectionHandlerID, $identity, $ip, $port, $nickname, $defaultChannelID, $defaultChannelPassword, $serverPassword) {}",
"public function connect()\n {\n if ($this->pdo !== null) {\n return;\n }\n\n $db = $this->configs['database'] ?? '';\n $hostname = $this->configs['hostname'] ?? '';\n $port = $this->configs['port'] ?? '';\n $charset = $this->configs['charset'] ?? '';\n $username = $this->configs['username'] ?? '';\n $password = $this->configs['password'] ?? '';\n\n $this->pdo = new PDO(\n \"mysql:dbname={$db};host={$hostname};port={$port};charset={$charset}\",\n $username,\n $password\n );\n }",
"abstract protected function connect();",
"abstract protected function connect();",
"abstract protected function connect();",
"protected function connect()\n\t\t{\n\t\t\t$conn = new PDO(\"mysql:dbname=$this->m_db;host=$this->m_host\", $this->m_username, $this->m_password); /* Create a new connection */\n\n\t\t\tif (DEBUG) /* If the global variable DEBUG is true */\n\t\t\t\techo 'Connecting to database.<br>'; /* Display debug messages */\n\t\t\t\n\t\t\treturn $conn; /* Return the database connection */\n\t\t}",
"public function connect()\n {\n $this->connection = new mysqli(\"localhost\", \"mid2\", \"mid2\", \"ds9\");\n if ($this->connection->connect_error) {\n die(\"Connection failed: \" . $this->connection->connect_error);\n }\n }",
"public function connect(): mixed;",
"public function connect(){ //connrct to database\r\t\tif ($this->connected==false){\r\t\t\tif ($this->pers){\r\t\t\t\t$this->handle=sqlite_popen($this->server);\r\t\t\t}else{\r\t\t\t\t$this->handle=sqlite_open($this->server);\r\t\t\t}\r\t\t\t\r\t\t\t//$this->engine = new SQLiteDatabase($this->server);\r\t\t\t$this->connected=true;\r\t\t}//\r\t}",
"private function connect()\n {\n if (! is_null(self::$db)) {\n return;\n }\n\n // $this->host \t= $Database->host;\n // $this->user \t= $Database->user;\n // $this->pass \t= $Database->pass;\n // $this->database\t= $Database->database;\n\n $conn = 'mysql:dbname=' . $this->dbInfo->database . ';host=' . $this->dbInfo->host.';charset=utf8';\n try {\n self::$db = new PDO($conn, $this->dbInfo->user, $this->dbInfo->pass);\n } catch (PDOException $e) {\n die('Could not connect to database (' . $conn . ')');\n }\n }",
"public function connect()\n {\n }",
"public function connect()\n {\n }",
"public function connect()\n {\n }",
"public function connect(): void\n {\n }",
"private function connect()\n\t{\n\t\t$connectionData = $this->app->file->requireFile('config.php');\n\t\t\n\t\textract($connectionData);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstatic::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\n\t\t\tstatic::$connection->exec('SET NAMES utf8');\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\t\t\t\t\n\t}",
"public function connect()\n {\n try {\n\n $this->config = (new Config\\Config())->getConfig(); // load config file in config class\n\n // create pdo connection to DB by using config\n $this->_dbInstance = new \\PDO('mysql:host=' . $this->config['ServerName'] . ';dbname=' . $this->config['DBName'], $this->config['UserName'], $this->config['Password'],array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n\n // set attributes for this connection\n $this->_dbInstance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }catch(\\PDOException $e)\n {\n echo $e->getMessage();\n }\n }",
"public function connect()\n\t{\n\t\ttry {\n\t\t\t$this->_connection = new PDO(\n\t\t\t\t\"mysql:host=\" . $this->_host . \n\t\t\t\t\";dbname=\" . $this->_database,\n\t\t\t\t$this->_username,\n\t\t\t\t$this->_password,\n\t\t\t\tarray(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')\n\t\t\t); \n\t\t}\n\t\tcatch(PDOException $error) {\n\t\t\tdie('<br />MySQL error: Failed to connect.<br />' . $error->getMessage());\n\t\t}\n\t}",
"protected function connect()\n {\n $this->imap = imap_open($this->mailbox, $this->username, $this->password);\n }",
"private function connect()\n {\n global $config, $conn;\n if (!isset($conn))\n {\n try\n {\n $conn = new PDO('mysql:host=' . $config['mysql_hostname'] . ';dbname=' . $config['mysql_database'] . ';', $config['mysql_user'], $config['mysql_password']);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch (PDOException $e)\n {\n error_log($e->getMessage());\n print 'We were unable to connect to the database. Please check your error logs.';\n die();\n }\n }\n }",
"abstract function getConnect();",
"public function connect() {\n\n\t\t$this->_httpq = new HttpQPlayer(conf('localplay_httpq_hostname'),conf('localplay_httpq_password'),conf('localplay_httpq_port'));\n\n\t\t// Test our connection by retriving the version\n\t\tif (!is_null($this->_httpq->version())) { return true; }\n\n\t\treturn false;\n\n\t}",
"private function connect()\n {\n $connection_string = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';';\n $this->connection = new PDO($connection_string, DB_USER, DB_PASS);\n }",
"protected function connect()\n\t{\n\t\t$strDSN = 'mysql:';\n\t\t$strDSN .= 'dbname=' . $GLOBALS['TL_CONFIG']['dbDatabase'] . ';';\n\t\t$strDSN .= 'host=' . $GLOBALS['TL_CONFIG']['dbHost'] . ';';\n\t\t$strDSN .= 'port=' . $GLOBALS['TL_CONFIG']['dbPort'] . ';';\n\t\t$strDSN .= 'charset=' . $GLOBALS['TL_CONFIG']['dbCharset'] . ';'; // supported only in PHP 5.3.6+\n\n\t\t$arrOptions = array(\n\t\t\tPDO::ATTR_PERSISTENT => $GLOBALS['TL_CONFIG']['dbPconnect'],\n\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode=\\'\\'; SET NAMES ' . $GLOBALS['TL_CONFIG']['dbCharset'],\n\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n\t\t);\n\n\t\t$this->resConnection = new PDO($strDSN, $GLOBALS['TL_CONFIG']['dbUser'], $GLOBALS['TL_CONFIG']['dbPass'], $arrOptions);\n\t}",
"function connect() {\n\n\t\t// only if logins are set ...\n\t\tif ($this->server->ip && $this->server->port && $this->server->login && $this->server->pass) {\n\n\t\t\t$this->console_text('[Aseco] Try to connect to server on {1}:{2}',\n\t\t\t\t$this->server->ip,\n\t\t\t\t$this->server->port);\n\n\t\t\t// connect to the server ...\n\t\t\tif (!$this->client->InitWithIp($this->server->ip, $this->server->port)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ' . $this->client->getErrorMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->console_text('[Aseco] Authenticated with username \\'{1}\\' and password \\'{2}\\'',\n\t\t\t\t$this->server->login, $this->server->pass);\n\n\t\t\t// logon the server ...\n\t\t\t$this->client->addCall('Authenticate', array($this->server->login, $this->server->pass));\n\n\t\t\t// enable callback system ...\n\t\t\t$this->client->addCall('EnableCallbacks', array(true));\n\n\t\t\t// start query ...\n\t\t\tif (!$this->client->multiquery()){\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ' . $this->client->getErrorMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->client->getResponse();\n\n\t\t\t// connection established ...\n\t\t\treturn true;\n\t\t} else {\n\n\t\t\t// connection failed ...\n\t\t\treturn false;\n\t\t}\n\t}",
"public function connect() {\r\n\t\t$this->connection = mysql_connect($this->host, $this->username, $this->password);\r\n\t\t$this->selectDB($this->squema);\r\n\t}",
"public function setup()\n {\n\n $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\n socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, 1);\n socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array(\"sec\"=>1, \"usec\"=>0));\n $MSG = \"hello\";\n socket_sendto($sock, $MSG, strlen($MSG), MSG_EOR, '255.255.255.255', 8686);\n socket_recvfrom($sock, $buf, 1000, 0, $addr, $port);\n socket_close($sock);\n\n if(preg_match(\"/^(\\d+\\.\\d+\\.\\d+\\.\\d+):(\\d+)$/i\", $buf, $ms)) {\n echo \"Server found at $ms[1]:$ms[2]\\n\";\n $this->tcpClient = new TcpClient($ms[1], $ms[2]);\n $this->login( $this->tcpClient );\n } else {\n throw new SPSException(\"Can not login on ikarus master-slave server. Please run it first\", -88);\n }\n }",
"public function connect() {\n $this->debugBacktrace();\n $this->connection = mysqli_connect($this->server, $this->user, $this->password, $this->database); \n\n if (!$this->connection) {\n $mysqlError = mysqli_error($this->connection);\n die('ERROR CODE: ARPOASRUWWER412547');\n } \n }",
"function connect() {\r\n\t\t//echo \"Host:$this->dbhost User:$this->dbuser Pass: $this->dbpass DB: $this->dbname\";\r\n\t\t\r\n\t\t$this->socket = new mysqli( $this->dbhost, $this->dbuser, $this->dbpass,$this->dbname );\r\n\t\tif ($this->socket->connect_errno >0) {\r\n\r\n \t\t\t $this->error( \"Error connecting to database server - \", true );\r\n\t\t}\t\t\r\n\t\t$this->connected = true;\r\n\t}",
"public function connect() {\r\n\t$this->oMySql = new mysqli($this->server, $this->user, $this->pass, $this->database);\r\n\r\n\tif ($this->oMySql->connect_error) {\r\n\t $this->oops(\"Could not connect to server: {$this->server}.\");\r\n\t //die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);\r\n\t}\r\n\r\n\t// Store connected status\r\n\t$this->bIsConnected = true;\r\n\r\n\t// Unset the data so it can't be dumped\r\n\t$this->server = '';\r\n\t$this->user = '';\r\n\t$this->pass = '';\r\n\t$this->database = '';\r\n }",
"protected function connect() {\r\n $this->service->connect();\r\n $this->assert_is_true($this->service->is_connected(), $this->service->get_error());\r\n }",
"private function connect() {\r\n\t\tunset($this->dbLink);\r\n\t\t/* create connection to database host */\r\n\t\t// $dbLink = mysql_connect(\"mysql.localhost\", \"de88623\", \"proberaum1\");\r\n\t\t$dbLink = mysql_connect(\"localhost\", \"robert\", \"YMbHFY+On2\");\r\n\t\t/* select database */\r\n\t\tmysql_select_db(\"robert_www_parkdrei_de\");\r\n\t\t/* set link to database as a object attribute */\r\n\t\t$this->dbLink = $dbLink;\r\n\t}",
"private function connect()\n {\n //variable con el nombre del server\n $server = \"localhost\";\n //variable con el nombre de la base\n $database = \"candidatossv\";\n //variable con el usuario de la base\n $username = \"root\";\n //variable con la contra de la base\n $password = \"\";\n try {\n //realizando conexion\n @self::$connection = new PDO(\"mysql:host=$server; dbname=$database; charset=utf8\", $username, $password);\n } catch (PDOException $exception) {\n //mostrando el tipo de excepcion al realizar la conexion\n throw new Exception($exception->getCode());\n }\n }",
"protected function connect() \n {\n $this->socket = @stream_socket_client(\n $this->host.':'.$this->port,\n $errorNumber,\n $errorDescription,\n $this->timeout ? $this->timeout : ini_get('default_socket_timeout')\n );\n if ($this->socket) {\n if ($this->password!==null) {\n $this->executeCommand('AUTH', array($this->password)); \n }\n $this->executeCommand('SELECT', array($this->db));\n } else {\n throw new Exception(\n 'Failed to connect to redis: '.$errorDescription,\n (int)$errorNumber\n );\n }\n }",
"public function connect()\n {\n $dsn = sprintf(\"mysql:host=%s;port=%s;dbname=%s\", $this->configuration['host'], $this->configuration['port'], $this->configuration['database']);\n $this->pdo = new PDO($dsn, $this->configuration['username'], $this->configuration['password']);\n }",
"public function connect(): void\n {\n $this->pdo = new PDO(\n $this->constructDns($this->config),\n $this->config['username'],\n $this->config['password'],\n $this->config['options'] ?? [],\n );\n }",
"protected function connect()\n {\n $url = $this->createUrl(\"\");\n // create curl resource\n $this->connection = curl_init();\n\n // set url\n curl_setopt($this->connection, CURLOPT_URL, $url);\n\n //return the transfer as a string\n curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, 1);\n\n }",
"private function connectPdo() {\r\n\t\t$this -> link = new PDO('mysql:host=' . $this -> host . ';dbname=' . $this -> base, $this -> user, $this -> pass);\r\n\t\t$this -> link -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t}",
"public function connectMaster()\r\n {\r\n $masterConfig = $this->config['master'];\r\n $this->app->logDebug(\"DB Connect Master {$masterConfig[4]}:host={$masterConfig[0]};dbname={$masterConfig[1]}\");\r\n if (isset($this->pdoList[0])) {\r\n $this->pdoList[0];\r\n return;\r\n }\r\n try {\r\n $this->pdo = new PDO(\"{$masterConfig[4]}:host={$masterConfig[0]};dbname={$masterConfig[1]}\",\r\n $masterConfig[2], $masterConfig[3], [PDO::ATTR_PERSISTENT => $masterConfig[5]]);\r\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $this->connected = true;\r\n } catch (PDOException $e) {\r\n throw new SqlMagicException('Failed to open the DB connection', SqlMagicException::DB_CONN_ERROR);\r\n }\r\n $this->pdoList[0] = $this->pdo;\r\n }",
"public function connect($server, $username, $secret);",
"private function connect() {\n\t\tif(strtolower(trim($this->secure)) == 'ssl') {\n\t\t\t$this->server = 'ssl://' . $this->server;\n\t\t}\n\t\t$this->conn = fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);\n\t\tif (substr($this->getServerResponse(),0,3)!='220') { return false; }\n\t\treturn true;\n\t}",
"protected function connect() {\n if ($this->worker->addServer($this->host, $this->port) === false) {\n throw new Ex(\n \"Unable to connect to Gearman at '{$this->host}:{$this->port}'\",\n Ex::CONNECTION_ERROR\n );\n }\n }",
"public function connect():void\n {\n $this->pdo = new PDO(\n 'mysql:host=localhost;dbname=mondocine',\n 'root',\n '',\n [\n PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8mb4\",\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n ]\n );\n }",
"function connect($server, $port, $nickname, $password = \"\")\n\t{\n\t\t$this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\tif(!socket_connect($this->socket, $server, $port)) return socket_last_error();\n\t\t$this->nickname = $nickname;\n\t\t$this->server = $server;\n\t\t$this->setNickname($server, $nickname, $password);\n\t\t$this->connected = true;\n\t\treturn true;\n\t}",
"private static function _connect()\n {\n try {\n self::$_dbh = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n }\n catch (PDOException $e) {\n echo \"Failure to connect to database. \".$e->getMessage();\n }\n }",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"abstract function connect();",
"public function connect () : void {\n\t\t\t$this->dbConnection = mysqli_connect($this->servername, $this->username, $this->password, $this->dbName);\n\n\t\t\tif($this->dbConnection == false)\n\t\t\t{\n\t\t\t die(mysqli_connect_error());\n\t\t\t}\n\n\t\t}",
"public function connect(){\n try {\n $this->_dbh = new PDO('mysql:host='.$this->_host.';dbname='.$this->_db,$this->_user,$this->_pass);\n echo \"connexion reussi\";\n }\n catch(PDOException $e)\n {\n echo \"Connection failed: \" . $e->getMessage();\n }\n }",
"public function connect() {\n\t\n\t\t// First thing we do is create a socket stream using the server config data.\n\t\t$this->socket = @stream_socket_client('tcp://'.$this->server['chat']['host'].\n\t\t':'.$this->server['chat']['port']);\n\t\t// If we managed to open a connection, we need to do one or two things.\n\t\tif($this->socket !== false) {\n\t\t\t// First we set the stream to non-blocking, so the bot doesn't pause when reading data.\n\t\t\tstream_set_blocking($this->socket, 0);\n\t\t\t// Now we make our handshake packet. Here we send information about the bot/client to the dAmn server.\n\t\t\t$data = 'dAmnClient '.$this->server['chat']['version'].LBR;\n\t\t\t$data.= 'agent='.$this->Agent.LBR;\n\t\t\t$data.= 'bot='.$this->Client.LBR;\n\t\t\t$data.= 'owner='.$this->owner.LBR;\n\t\t\t$data.= 'trigger='.$this->trigger.LBR;\n\t\t\t$data.= 'creator=photofroggy/[email protected]'.LBR.chr(0);\n\t\t\t// This is were we actually send the packet! Quite simple really.\n\t\t\t@stream_socket_sendto($this->socket, $data);\n\t\t\t// Now we have to raise a flag! This tells everything that we are currently trying to connect through a handshake!\n\t\t\t$this->connecting = true;\n\t\t\t// Finally, exit before this if case exits, so we can do the stuff that happens when the socket stream fails.\n\t\t\treturn true;\n\t\t}\n\t\t// All we do here is display an error message and return false dawg.\n\t\t$this->Warning('Could not open connection with '.$this->server['chat']['host'].'.');\n\t\treturn false;\n\t\n\t}",
"public function openConnection() {\n if($this->database != null) return;\n\n $config = $this->getDatabaseConfig();\n\n try {\n $this->database = new \\PDO(\n 'mysql:dbname=' . $config['database'] . ';host=' . $config['host'] . ':' . $config['port'],\n $config['username'],\n $config['password'],\n [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_ASSOC\n ]\n );\n } catch(\\PDOException $exception) {\n die('Connection to mysql-server failed: ' . $exception->getMessage());\n }\n }",
"private function connect()\n {\n // Try\n try {\n // Setup database connection\n $this->connection = new mysqli(\n $this->credentials->host,\n $this->credentials->user,\n $this->credentials->pass,\n $this->credentials->name,\n $this->credentials->port\n );\n } catch (Exception $ex) {\n // Return warning\n ErrorHandler::die(102, 'No database connection. Please check your credentials or is the server offline? Error: ' . $ex->getMessage());\n }\n }",
"function connect_server()\n\t{\n\t\t// server : localhost\n\t\t// user name : root\n\t\t// password : mysql\n\t\t// database : inet_php45\n\t\t$link = mysqli_connect(\"localhost\", \"root\", \"mysql\", \"inet_php45\");\n\n\t\t// kiểm tra kết nối\n\t\tif (mysqli_connect_errno()) {\n\t\t\techo \"ket noi khong thanh cong\";\n\t\t\texit;\n\t\t}\n\n\t\treturn $link;\n\t}",
"function connect()\n {\n $this->db = new PDO($this->dns,$this->user,$this->pass,$this->option);\n $this->db->setAttribute(PDO::ATTR_ERRMODE , PDO::ERRMODE_EXCEPTION);\n\n }"
] | [
"0.72100955",
"0.67200947",
"0.6688605",
"0.66860205",
"0.6523335",
"0.6515528",
"0.6492286",
"0.64142805",
"0.6376998",
"0.63415784",
"0.62969965",
"0.62872267",
"0.6283951",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.62791747",
"0.6277593",
"0.6230658",
"0.62175006",
"0.61946166",
"0.6175011",
"0.61735785",
"0.6103645",
"0.6070674",
"0.60665333",
"0.60167336",
"0.60126835",
"0.59856856",
"0.59780973",
"0.59595335",
"0.59425724",
"0.58891565",
"0.5884408",
"0.5884408",
"0.5884408",
"0.5884408",
"0.5884408",
"0.5884408",
"0.5884408",
"0.58635783",
"0.5841682",
"0.5832799",
"0.5832799",
"0.5832799",
"0.5832145",
"0.58301646",
"0.58252186",
"0.57991517",
"0.57932013",
"0.57844615",
"0.57844615",
"0.57844615",
"0.57781625",
"0.5771466",
"0.57632023",
"0.5752704",
"0.5716547",
"0.5713528",
"0.5710861",
"0.5707045",
"0.5692547",
"0.568814",
"0.56880325",
"0.56817895",
"0.56817514",
"0.5673541",
"0.56717366",
"0.56646574",
"0.56604487",
"0.565517",
"0.56504273",
"0.56496996",
"0.564773",
"0.56331444",
"0.56319296",
"0.5628657",
"0.56216353",
"0.561729",
"0.5614561",
"0.56053156",
"0.5587313",
"0.55758226",
"0.5570275",
"0.5568234",
"0.5568163",
"0.55660933",
"0.55651265",
"0.5562999",
"0.5550471",
"0.5534771",
"0.5531337",
"0.5528583"
] | 0.7104345 | 1 |
Send a command to mpd | protected function send($cmd){
$resp = [];
//Clear any previous errors
$this->error = '';
$cmd = $cmd."\n";
fwrite($this->connection, $cmd);
while (!feof($this->connection)) {
$line = fgets($this->connection, 1024);
if(strncmp(MPDClient::OK, $line, strlen(MPDClient::OK)) === 0){
break;
}
if(strncmp(MPDClient::ERR, $line, strlen(MPDClient::ERR)) === 0){
$this->error = substr($line, strlen(MPDClient::ERR));
break;
}
array_push($resp, trim($line));
}
return $resp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function send($cmd) {\n $cmd = escapeshellarg($cmd);\n $cmd = sprintf(\"screen -S ts_%d -p 0 -X stuff %s%c\", $this->sid, $cmd, 13);\n ssh($cmd, $this->host);\n }",
"function msgsrv_send ($target, $cmd, $content, $link) {}",
"function sendCommand($cmd) \n { \n \n $result = $this->write($cmd . \"\\r\\n\",strlen($cmd) + 2);\n if ($this->isError($result)) {\n return $result;\n }\n $response = $this->getReply();\n \n return $response;\n }",
"public function command($m){}",
"private function send_msg() {\r\n }",
"public function sendCommand($cmd) {\n $this->log($cmd);\n $cmd .= \"\\r\\n\";\n fwrite($this->getConnection(), $cmd);\n }",
"public function client_send($data, $command = '')\n {\n }",
"function sendCommandToPiHome($command, $param) {\n\t# Check for non-empty command and parameter\n\tif(strlen($command) == 0 or strlen($param) == 0) die('Command and Parameter are empty' . $command . $param);\n\t\n\t# Build command message consists of \"command param\"\n\t$message = $command. '/pi/' . $param;\n\t\n\t# Create one-time socket to local PiHome.py to send command to it\n\t$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\tif(!$sock) die('PHP cannot create socket');\n\t\n\tif(!socket_connect($sock, SCRIPT_IP, SCRIPT_PORT)) {\n\t\tsocket_close($sock);\n\t\tdie('Cannot connect to PiHome.py ip and port at ' . SCRIPT_IP . ', ' . SCRIPT_PORT);\n\t}\n\t\n\t# Send command through socket\n\tsocket_send($sock, $message, strlen($message), 0);\n\t\n\t# Do not wait for socket response, close right away.\n\t# This may need to change if we want to wait for confirmation from PistartRecordHome.py\n\tsocket_close($sock);\n}",
"function dbus_message($str) {\n exec(\"echo '$str''' | xargs -0 notify-send -t 500\");\n }",
"public function send() {}",
"public function send() {}",
"public function send() {}",
"public function send() {}",
"public function send() {}",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"private function doCommand($cmd, $timeout=10.0) {\n \n /* try to open the command port */\n \n $errno = 0;\n $errstr = \"\";\n $handle = fsockopen(\"tcp://localhost\", 5999, $errno, $errstr, $timeout); \n\n if(!$handle) {\n \n $this->error(\"doCommnand() - can't open command port ($errno): $errstr\");\n return false;\n }\n \n /* send the command */\n \n $cmd = trim($cmd).\"\\n\";\n \n if(!fwrite($handle, $cmd)) {\n $this->error(\"doCommnand() - can't send command.\");\n return false;\n }\n \n /* get the output */\n \n $output = \"\";\n \n while(!feof($handle)) {\n \n $output .= fgets($handle, 2048);\n }\n \n fclose($handle); \n\n /* pass back the lines of output as an array */\n \n return explode(\"\\n\", $output);\n }",
"protected function send() {}",
"function mpd_add_track($track, $port){ \n\t\tshell_exec(\"mpc -p $port add \".escapeshellarg($track));\n\t}",
"public function send(CommandReply $reply, $wait = false);",
"public function sendPeerWhatHeWant(){\n if(in_array('ADCGet', $this->opponentSupports)){\n $Command = $this->waitForCommand('ADCGET');\n if(!$Command || !$Command->params || !is_array($Command->params) || count($Command->params)<2){\n return;\n }\n if($Command->params[1]=='MyList.DcLst'){\n $this->sendCommand('ADCSND file MyList.DcLst 0 0');\n }else{\n $this->sendCommand('Error File Not Found');\n }\n }else{\n $Command = $this->waitForCommand('Get');\n $this->sendCommand('Error File Not Found');\n }\n }",
"public function doRaw($command)\n {\n $this->send($command);\n }",
"abstract function doSend();",
"public function killCommand()\n {\n $this->registry->set(Registry::DAEMON_KILL_KEY, time());\n $this->outputLine('Broadcast kill signal');\n }",
"public function run($command)\n {\n $this->hasMessage = true;\n $command = str_replace('{id}', $this->transactionId++, $command);\n\n $this->dbgpServer->sendCommand($command);\n }",
"public function send()\n {\n }",
"public function enviarComandoMute( ) {\n $cmd = new ComandoFlash($this->getProyectorActivo(), $this->getEstadoMuteado($this->getProyectorActivo()), \"\");\n $this->enviarPeticion($cmd->getComando());\n }",
"public function send() {\n\t\t\texit(implode(\"\", func_get_args()));\n\t\t}",
"abstract function command();",
"public function sendMessage($message) {\n\t\t$this->sendCommand(\"PRIVMSG \".$this->config['destinationChannel'].\" :\".$message);\n\t}",
"private function writeCommand($command)\n { \n fwrite($this->smtpConnection, $command);\n }",
"private function sendCmd($cmd, $params='') {\r\n\r\n if (!is_resource($this->socket)) {\r\n return false;\r\n }\r\n\r\n fputs($this->socket, $cmd . ' ' . $params . \"\\n\");\r\n\r\n $msg = '';\r\n while (strpos($msg, 'msg=') === false) {\r\n $msg .= fread($this->socket, 8096);\r\n }\r\n\r\n if (strpos($msg, 'error id=2568') !== false) {\r\n $this->errors[] = '"<b>' . $cmd . '</b>" command failed! insufficient client permissions!';\r\n return false;\r\n }\r\n\r\n if (strpos($msg, 'msg=ok') === false) {\r\n return false;\r\n }\r\n else {\r\n return $msg;\r\n }\r\n }",
"function putcmd($cmd, $arg = \"\")\r\n {\r\n \tif (!$this->_socket) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \tif ($arg != \"\") {\r\n \t\t$cmd = $cmd.\" \".$arg;\r\n \t}\r\n \t\r\n \tfputs($this->_socket, $cmd.\"\\r\\n\");\r\n \t$this->debug(\"> \".$cmd.\"\\n\");\r\n \t\r\n \treturn TRUE;\r\n }",
"abstract function send();",
"public function exec() {\n\t\t$this->stop();\n\t\tswitch ($this->enable) {\n\t\tcase FALSE:\n\t\t\t$this->update(TRUE);\n\t\t\tbreak;\n\t\tcase TRUE:\n\t\t\t$this->update(FALSE);\n\t\t\tusleep($this->delay);\n\t\t\t$this->start();\n\t\t\tbreak;\n\t\t}\n\t}",
"public function setPlayback($cmd, $params = []){\n $cmdLine = $cmd.\" \". implode(' ', $params);\n \n $this->send($cmdLine);\n \n if(!empty($this->error)){\n echo $this->error;\n }\n }",
"public function send()\n {\n }",
"public function send()\n {\n }",
"public function send()\n {\n }",
"public function send() {\r\n\t\t\t$this->sent = true;\r\n\t\t}",
"public function setCommand($c)\n {\n $this->command = $c;\n }",
"function _sendCmd($cmd)\n {\n $status = $this->_sock->getStatus();\n if (PEAR::isError($status) || $status['eof']) {\n return new PEAR_Error( 'Failed to write to socket: (connection lost!) ' );\n }\n if ( PEAR::isError( $error = $this->_sock->write( $cmd . \"\\r\\n\" ) ) ) {\n return new PEAR_Error( 'Failed to write to socket: ' . $error->getMessage() );\n }\n\n if( $this->_debug ){\n // C: means this data was sent by the client (this class)\n echo \"C:$cmd\\n\";\n }\n return true;\n }",
"private function command($command, $multicall)\n\t{\n\t\t$message = new xmlrpcmsg($command, array(new xmlrpcval($this->hash, 'string')));\n\t\t\n\t\tif($multicall === true)\n\t\t{\n\t\t\t$return = $this->multicall->add($message, $this->hash);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->client->send($message);\n\t\t\t$return = $this->checkError($result);\n\t\t}\n\t\treturn $return;\n\t}",
"public function send($message);",
"public function send($message);",
"public function send($message);",
"public function send($message);",
"private function sendCommand($command) {\n\t\t# Log the outbound message\n\t\tif($this->config['logging'] == 2) {\n\t\t\t$this->log(\"[SEND]: \".rtrim($command,\"\\r\\n\"));\n\t\t}\n\t\tif(substr($command,-4) != \"\\n\\r\") {\n\t\t\t$command = $command . \"\\n\\r\";\n\t\t}\n\t\t$writtenBytes = fwrite($this->socket, $command, strlen($command));\n\t\tif($writtenBytes < strlen($command)) {\n\t\t\tthrow new Exception(\"Attempted to write \".strlen($command).\" bytes, could only send {$writtenBytes} to socket\");\n\t\t}\n\t}",
"public function process(Message $command);",
"private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }",
"function execute_cmd($cmd)\n\t{\n\t\tfwrite(\"w\",\"/var/run/exec.sh\",$cmd);\n\t\tevent(\"EXECUTE\");\n\t}",
"function send_sms()\n\t{\n\t\t$config['functions']['send_sms'] = array('function' => 'Xmlrpc.rpc_send_sms');\n\t\t$this->xmlrpcs->initialize($config);\n\t\t$this->xmlrpcs->serve();\n\t}",
"public function sleepCommand($id)\n {\n $this->registry->set('daemon:' . $id, getmypid());\n sleep(10);\n }",
"public function execute() {\n\t\t// a mistake and did a negative, or you were trying to un-mute someone. I'll be nice about it\n\t\t// and let the mod/admin know what to do.\n\t\tif ($this->time < 0) {\n\t\t\t$chat = new WhisperCommand($this->server, ServerChatClient::getClient(), array($this->client),\n\t\t\t\t\"Cannot give a negative mute. Use /unmute <display name> to un-mute someone.\");\n\t\t\t$chat->execute();\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If the person isn't muted yet, message them privately so we don't have a bunch of folks\n\t\t// bitch about why someone was muted. Don't make it public knowledge.\n\t\tif (!$this->recipient->isMuted()) {\n\t\t\t$chat = new WhisperCommand($this->server, ServerChatClient::getClient(), array($this->recipient),\n\t\t\t\t\"You have been muted for spam/offensive chat.\");\n\t\t\t$chat->execute();\n\t\t}\n\n\t\t// Add time on the recipient so that they can get the punishment that they deserve.\n\t\t$this->recipient->addMuteTime($this->time);\n\n\t\t// Message the administrator or moderator that the mute has successfully gone through.\n\t\t$chat = new WhisperCommand($this->server, ServerChatClient::getClient(), array($this->client),\n\t\t\t\"You have successfully muted \" . $this->recipient->getDisplayName() . \".\");\n\t\t$chat->execute();\n\t}",
"function send_message ($message)\t\t\t\t\n\t{\n\t\t$con = new Stomp('tcp://'.ACTIVEMQ_SERVER.':61613');\n\t\t$con->connect();\n\t\t$con->send(\"/queue/s3backup\", $message);\n\t\n\t}",
"public function command(Command $command);",
"abstract public function dispatch($command);",
"public function command($name)\n {\n $this->name = $name;\n }",
"public function dispatch( Command $command ): void;",
"public function send($message)\n {\n }",
"public function sendAction() {\n\t\t$this->certificateAction(TRUE);\n\t\t$this->groupAction(TRUE);\n\t\t$this->statAction(TRUE);\n\t}",
"protected function sendCommand($command, $data = '')\n {\n fwrite($this->socket, pack('VV', $command, strlen($data)) . $data);\n return $this->receiveResponse();\n }",
"public function send(int $debotHandle, string $message): void\n {\n $this->tonClient->request(\n 'debot.send',\n [\n 'debot_handle' => $debotHandle,\n 'message' => $message,\n ]\n )->wait();\n }",
"function smtp_command($cmd) \n {\n \tVWP::nowarn();\n $sock_data = @ socket_write($this->_socket, $cmd . \"\\r\\n\", strlen($cmd) + 2);\n VWP::noWarn(false);\n \n if ($sock_data === false) {\n \t$this->_smtp_msg = \"Unable to write to socket\";\n \treturn $this->report_error($this->_smtp_msg);\n }\n \n $this->_smtp_msg = \"\";\n $this->_smtp_code = false;\n $i = 0;\n \n while ($line = $this->smtp_getline()) {\n $i++;\n \n if ((strlen($line) > 3) && ($line[3] == \" \")) { \n $tmp = substr($line,0,3) + 0;\n $this->_smtp_msg .= substr($line,4); \n if ($tmp != 220) { \n $this->_smtp_code = $tmp;\n break;\n } \n } else {\n $this->_smtp_msg .= $line;\n } \n } \n return $this->_smtp_code; \n }",
"public function send() {\n $tidy = new Tidy();\n $tidy->parseString($this->output, $this->tidyConfig);\n $tidy->cleanRepair();\n\n // Send the output string to the client\n echo $tidy;\n }",
"public function sendProcess($command, $contentType = \"text/plain\")\n {\n $this['response']->setBody(new Stream(popen($command, 'r')));\n $this['response']->setHeader(\"Content-Type\", $contentType);\n }",
"public function command(): string;",
"public function _DO_push()\n {\n// $res = $this->tim->group_send_group_msg('admin', 'L5900888378d29-T', 'hello');\n// $res = servTIM::sole(null)->systemMessage('L591a745be656f-T', 'hint', '老师暂时离开');\n $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-D', 'hint', '老师暂时离开');\n print_r($res);\n// $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-T', 'hint', '老师暂时离开');\n// print_r($res);\n }",
"function send($mobile, $message);",
"function sendcmd($in, $address, $service_port)\n{\n $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n if ($socket === false) {\n return \"socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n }\n\n $result = socket_connect($socket, $address, $service_port);\n if ($result === false) {\n return \"socket_connect() failed.\\nReason: ($result) \" . socket_strerror(socket_last_error($socket)) . \"\\n\";\n }\n \n socket_write($socket, $in, strlen($in));\n $mess = \"\";\n /*$next = \"\";*/\n sleep(1);\n \n /*$next = socket_read($socket, 4096);*/\n\t\n\twhile(0 != socket_recv($socket, $out, 4096, MSG_DONTWAIT)){ \n\tif($out != null) \n\t\t$mess .= $out; \n\t}; \n\t\n /*$mess .= $next;*/\n \n socket_close($socket);\n return $mess;\n}",
"public function postCmd(Event $event) {\n $this->handler->onPostCmdEvent($event);\n }",
"public function execute(): void\n\t{\n\t\techo 'Complex Command: should be done by a receiver object <br>';\n\t\t$this->receiver->doSomething($this->a);\n\t\t$this->receiver->doSomethingElse($this->b);\n\t}",
"protected function clientCommand($command)\n {\n MPCMF_LL_DEBUG && error_log(\"==\\n+ waiting: \" . ($this->waiting ? 'yes' : 'no'));\n\n if(!$this->waiting) {\n MPCMF_LL_DEBUG && error_log(\"+ input: {$command}\");\n if(!preg_match('/(?<cmd>[a-z]+)\\s/i', $command, $match)) {\n MPCMF_LL_DEBUG && error_log(\"[!!!] UNKNOWN COMMAND: {$command}\");\n return;\n }\n $this->cmd = $match['cmd'];\n $this->processCommand();\n } else {\n $this->processPayload();\n }\n\n }",
"public function system($command, $descriptor, $destination);",
"private function send(): void\n {\n $data = [\n 'code' => $this->status,\n 'message' => $this->message,\n 'datetime' => Carbon::now()\n ];\n\n $config = config(\"tebot.$this->channelConfig\");\n\n $data['title'] = $this->title . ' ' . $config['name'];\n\n if (!empty($this->detail)) $data['detail'] = json_encode($this->detail);\n\n Http::withHeaders(['x-api-key' => $config['key']])->post($config['url'] . '/api/message', $data);\n }",
"public function runCommand($cmd)\n {\n //excecuting\n echo \"'\".$cmd.\"' command executed.\\n\";\n }",
"function api_masterSend($opcode, $payload) {\r\n //UDP setup\r\n $server_ip = '127.0.0.1';\r\n $server_port = 11211;\r\n\r\n //The second argument here is the SMK, change it from the default (AF199...)\r\n //before deploying!\r\n //Don't include $payload in this pack - presumably it's been packed before\r\n //from whatever called this function and will be formatted accordingly -\r\n //just cat it to the end of the resulting data string.\r\n $data = \"AF1993ADFE944E38FE8CED6E490D1BB16C6A20F7F36237753A2EAF5BF2503536\" .\r\n pack(\"N\", $opcode) . $payload;\r\n\r\n $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\r\n socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 1, 'usec' => 0));\r\n socket_sendto($socket, $data, strlen($data), 0, $server_ip, $server_port);\r\n socket_close($socket);\r\n}",
"function onCommand(){\r\n\r\n\t\tglobal $aryTipeTxt;// $aryTipeTxt : Array after processing of the input character string.\r\n\t\tglobal $raw_input;// $raw_input : Input strings.\r\n\t\tglobal $currentdirectory;// $currentdirectory : current directory (full path)\r\n\t\tglobal $poPath;// $poPath : Entire directory. (ex: $poPath . \"/root/bin/user.json\")\r\n\r\n\t\t$this->addlog(\"コマンドが実行されたよ!\");//[PHPPO/INFO][TestPlugin]コマンドが実行されたよ!\r\n\t\t$this->info(\"[TestPlugin]コマンドが実行されたよ!\");// as $this->addlog(\"コマンドが実行されたよ!\");\r\n\t\t$this->throwError(\"エラーなんか起きてないよ(>_<)\");//[PHPPO/ERROR]エラーなんか起きてないよ(/ω\)\r\n\r\n\t\t$baseCommand = $aryTipeTxt[0]; // to get base command.\r\n\t\tswitch ($baseCommand) {\r\n\t\t\tcase 'test': // on \"test\" command\r\n\t\t\t\t# code...\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'add_more':// on \"add_more\" command\r\n\t\t\t\t# code...\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault: // it won't run... believe in you...\r\n\t\t\t\t# code...\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t$this->info(\"=============variables=============\");\r\n\t\t$this->vardump(\"aryTipeTxt\"); // call to a function in this class.\r\n\t\t$this->vardump(\"raw_input\");\r\n\t\t$this->vardump(\"currentdirectory\");\r\n\t\t$this->vardump(\"poPath\");\r\n\r\n\t\tif (count($aryTipeTxt) > 1) { // there are args.\r\n\t\t\t$this->addlog(\"引数があるみたいだよ!\");\r\n\t\t\t$this->info(var_export($aryTipeTxt));\r\n\t\t}\r\n\t}",
"function AppendCmdToPlay($nickid, $cmdstr, $cmdp)\n {\n $c = pfcGlobalConfig :: Instance();\n $u = pfcUserConfig :: Instance();\n\n $ct = pfcContainer :: Instance();\n\n // check for empty nickid\n if ($nickid == \"\")\n return false;\n\n // get new command id\n $cmdtoplay_id = $ct->incMeta(\"nickid-to-cmdtoplayid\", $nickid, 'cmdtoplayid');\n if (count($cmdtoplay_id[\"value\"]) == 0)\n $cmdtoplay_id = 0;\n else\n $cmdtoplay_id = $cmdtoplay_id[\"value\"][0];\n\n // create command array\n $cmdtoplay = array();\n $cmdtoplay['cmdstr'] = $cmdstr;\n $cmdtoplay['params'] = $cmdp;\n\n // store command to play\n $ct->setCmdMeta($nickid, $cmdtoplay_id, serialize($cmdtoplay));\n\n return true;\n }",
"public abstract function sendMessage();",
"function _Write($cmd, $s1='', $s2='') {\n\t\t$id = ++$this->_Id;\n\n\t\t// Put our packet together\n\t\t$data = pack(\"VV\",$id,$cmd).$s1.chr(0).$s2.chr(0);\n\n\t\t// Prefix the packet size\n\t\t$data = pack(\"V\",strlen($data)).$data;\n\n\t\t// Send packet\n\t\tfwrite($this->_Sock,$data,strlen($data));\n\n\t\t// In case we want it later we'll return the packet id\n\t\treturn $id;\n\t}",
"private function sendSignal()\n {\n $this->view->downSignal = true;\n }",
"private function onPing()\n {\n $this->send($this->replyEvent());\n }",
"public function Command($command, $actionId);",
"public function send_msg($message)\r\n\t{\r\n\t\t$this->server->send_msg($this->channel, $message);\r\n\t}",
"public function sendOutput($message,$type=2){\n\tif($type==1){\n\t\techo \"CON \".$message;\n\t}elseif($type==2){\n\t\techo \"END \".$message;\n\t}else{\n\t\techo \"END We faced an error\";\n\t}\n\texit;\n }",
"public function sendQuery($query)\n\t{\n\t\t$this->database->execQuery($query, false);\n\t}",
"function _send_command($command, $args = '', $check = true)\n\t{\n\t\tif (!empty($args))\n\t\t{\n\t\t\t$command = \"$command $args\";\n\t\t}\n\n\t\tfwrite($this->connection, $command . \"\\r\\n\");\n\n\t\tif ($check === true && !$this->_check_command())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function sendCommand($command, $commandstring, $expect)\n {\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"function METHOD_hello()\n {\n $this->sendTerminal('This is a Hello World :)');\n\n }"
] | [
"0.6895455",
"0.64080966",
"0.63814795",
"0.6020841",
"0.6015965",
"0.60119283",
"0.5976633",
"0.5950566",
"0.59503037",
"0.58519864",
"0.58519864",
"0.58519864",
"0.58519864",
"0.58519864",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.58201665",
"0.57042396",
"0.56885797",
"0.565367",
"0.5644103",
"0.56320524",
"0.5587936",
"0.5549695",
"0.5540831",
"0.552677",
"0.55117357",
"0.54770505",
"0.5466589",
"0.54446816",
"0.5443879",
"0.5419451",
"0.5414605",
"0.53991675",
"0.53977036",
"0.53810704",
"0.53802216",
"0.53722656",
"0.53722656",
"0.53722656",
"0.5349252",
"0.5347825",
"0.53242135",
"0.53169423",
"0.5313152",
"0.5313152",
"0.5313152",
"0.5313152",
"0.5234156",
"0.52261734",
"0.5220383",
"0.5170764",
"0.5157919",
"0.51497525",
"0.5144443",
"0.5136223",
"0.5134167",
"0.5132427",
"0.51228136",
"0.51119065",
"0.50938785",
"0.50844705",
"0.5082738",
"0.5051191",
"0.50510573",
"0.5029006",
"0.50082916",
"0.5007472",
"0.5002335",
"0.49951676",
"0.4985149",
"0.4978856",
"0.4971322",
"0.4967872",
"0.4964978",
"0.4956818",
"0.4949913",
"0.49481234",
"0.4946308",
"0.49206161",
"0.49153432",
"0.49049732",
"0.48979768",
"0.48898798",
"0.4888767",
"0.48813373",
"0.48710054",
"0.48653898",
"0.4864321",
"0.48617747",
"0.48425108",
"0.48376387"
] | 0.51659644 | 60 |
Set the current playback play, pause etc. | public function setPlayback($cmd, $params = []){
$cmdLine = $cmd." ". implode(' ', $params);
$this->send($cmdLine);
if(!empty($this->error)){
echo $this->error;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCurrentPlayer($player){\r\n $this->currentPlayer = $player;\r\n }",
"public function play() {\n if ($this->getLigado() && !($this->getTocando())) {\n $this->setTocando(true);\n }\n }",
"public function updateNowPlaying()\r\n\t{\r\n\t\t$this->batchScraper->nowPlaying();\r\n\t}",
"public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }",
"function play($pkt){\n if( $this->active_player && $this->state->paused){\n $this->json('VideoPlayer.PlayPause',null,$pkt);\n }\n else\n $this->nak($pkt['from']);\n }",
"function play() { \n\n\t\tif ($this->XBMCCmd(\"PlayNext\")!=\"OK\") { return false; } \n\t\treturn true;\n\n\t}",
"public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}",
"public function pause();",
"public function setCurrentPlayer($player) {\n $this->game->set_current_turn($player);\n }",
"public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }",
"public function play() {\n\n\t\t/* A play when it's already playing causes a track restart\n\t\t * which we don't want to doublecheck its state\n\t\t */\n\t\tif ($this->_httpq->state() == 'play') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (is_null($this->_httpq->play())) { return false; }\n\t\treturn true;\n\n\t}",
"public function setMediaPlayer( Streamwide_Engine_Media_Player $mediaPlayer )\n {\n $this->_mediaPlayer = $mediaPlayer;\n }",
"public function play() { \n\n\t\tif (is_null($this->_mpd->Play())) { return false; } \n\t\treturn true;\n\n\t}",
"public function actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }",
"public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }",
"function startPlayback($cam, $path) {\n\tsendPiCam($cam, 'STARTPLAYBACK,' . $path);\n}",
"public function pauseWorking(){\r\n\r\n }",
"public function play()\n {\n try {\n $this->soap(\"AVTransport\", \"Play\", [\n \"Speed\" => 1,\n ]);\n } catch (SoapException $e) {\n if (count($this->getQueue()) < 1) {\n $e = new \\BadMethodCallException(\"Cannot play, the current queue is empty\");\n }\n throw $e;\n }\n\n return $this;\n }",
"private function getPlayback() {\n\t\treturn $this->socketSend('playback');\n\t}",
"protected function _initMediaPlayer()\n {\n $this->_mediaPlayer->reset();\n }",
"public function setCurrent(bool $current): void {\n\t\t$this->current = $current;\n\t}",
"public function Play()\n {\n SetValue($this->GetIDForIdent(\"Status\"), 1);\n include_once(__DIR__ . \"/sonos.php\");\n (new PHPSonos($this->ReadPropertyString(\"IPAddress\")))->Play();\n \n }",
"public function setPlayer(Player $player);",
"public function set_current($current_stop) {\r\n $this->current_stop = $current_stop;\r\n }",
"public function setModeCurrent() {\n\t\t$this->mode = 'current';\n\t}",
"public function setMedia()\n {\n }",
"public function setMedia()\n {\n }",
"public function setMedia()\n {\n }",
"public function autoplay($status = false);",
"public function set_current_screen()\n {\n }",
"public function setCurrent($current)\n {\n if (!empty($current))\n $this->current = $current;\n }",
"public function set_play_offs_qtt($arg) {\n while ($arg * 2 > $this->participants_qtt) { //when there's more play offs than participants\n $arg /= 2;\n }\n if ($arg * 2 < $this->group_qtt) {\n $arg = $this->group_qtt / 2;\n }\n //$this->play_offs_qtt = $arg / 2;\n $this->play_offs_qtt = $arg;\n }",
"public function __construct($file, $id = null) {\n parent::__construct(self::TEMPLATE);\n\n if (!$id) {\n $id = md5(microtime());\n }\n\n// $file = 'http://localhost/kayalion/sian/public/sample.mp3';\n\n $this->set('playerId', $id);\n\n $this->addStyle(JQueryModule::STYLE_JQUERY_UI);\n $this->addStyle(self::STYLE);\n\n $this->addJavascript(JQueryModule::SCRIPT_JQUERY);\n $this->addJavascript(JQueryModule::SCRIPT_JQUERY_UI);\n $this->addJavascript(JPlayerModule::SCRIPT_JPLAYER);\n\n $js = '$(\"#' . $id . '\").jPlayer( {';\n $js .= 'customCssIds: true, ';\n $js .= 'nativeSupport: false, ';\n $js .= 'ready: function () { this.element.jPlayer(\"setFile\", \"' . $file . '\"); }, ';\n $js .= 'swfPath: \"' . $this->getSwfPath() . '\"';\n $js .= '});';\n\n $js .= \"var global_lp = 0;\n\n $('#\" . $id . \"').jPlayer('onProgressChange', function(lp,ppr,ppa,pt,tt) {\n var lpInt = parseInt(lp);\n var ppaInt = parseInt(ppa);\n global_lp = lpInt;\n\n $('#\" . $id . \"-loader-playback').progressbar('option', 'value', lpInt);\n $('#\" . $id . \"-slider-playback').slider('option', 'value', ppaInt);\n })\n\n $('#\" . $id . \"-pause').hide();\n\n function showPauseBtn() {\n $('#\" . $id . \"-play').fadeOut(function(){\n $('#\" . $id . \"-pause').fadeIn();\n });\n }\n\n function showPlayBtn() {\n $('#\" . $id . \"-pause').fadeOut(function(){\n $('#\" . $id . \"-play').fadeIn();\n });\n }\n\n function playTrack(t, n) {\n $('#\" . $id . \"').jPlayer('setFile', t).jPlayer('play');\n\n showPauseBtn();\n\n return false;\n }\n\n $('#\" . $id . \"-play').click(function() {\n $('#\" . $id . \"').jPlayer('play');\n showPauseBtn();\n return false;\n });\n\n $('#\" . $id . \"-pause').click(function() {\n $('#\" . $id . \"').jPlayer('pause');\n showPlayBtn();\n return false;\n });\n\n $('#\" . $id . \"-stop').click(function() {\n $('#\" . $id . \"').jPlayer('stop');\n showPlayBtn();\n return false;\n });\n\n $('#\" . $id . \"-volume-min').click( function() {\n $('#\" . $id . \"').jPlayer('volume', 0);\n $('#\" . $id . \"-slider-volume').slider('option', 'value', 0);\n return false;\n });\n\n $('#\" . $id . \"-volume-max').click( function() {\n $('#\" . $id . \"').jPlayer('volume', 100);\n $('#\" . $id . \"-slider-volume').slider('option', 'value', 100);\n return false;\n });\n\n // Slider\n $('#\" . $id . \"-slider-playback').slider({\n max: 100,\n range: 'min',\n animate: true,\n\n slide: function(event, ui) {\n $('#\" . $id . \"').jPlayer('playHead', ui.value*(100.0/global_lp));\n }\n });\n\n $('#\" . $id . \"-slider-volume').slider({\n value : 80,\n max: 100,\n range: 'min',\n animate: true,\n\n slide: function(event, ui) {\n $('#\" . $id . \"').jPlayer('volume', ui.value);\n }\n });\n\n $('#\" . $id . \"-loader-playback').progressbar();\n\n\n //hover states on the static widgets\n $('#dialog_link, #\" . $id . \"Container ul.icons li').hover(\n function() { $(this).addClass('ui-state-hover'); },\n function() { $(this).removeClass('ui-state-hover'); }\n );\n \";\n\n $this->addInlineJavascript($js);\n }",
"function getCurPlayingTrack(){\n\n\t}",
"abstract protected function play(array $move = array());",
"public function setMode(array $options)\n {\n $this->soap(\"AVTransport\", \"SetPlayMode\", [\n \"NewPlayMode\" => Helper::setMode($options),\n ]);\n\n return $this;\n }",
"protected function setMark() {\n echo $this->promptMessage('choose_mark');\n $mark = $this->limitInput(array(self::X_MARK, self::O_MARK, self::QUIT_BUTTON));\n switch ($mark) {\n case self::X_MARK:\n $this->_userMark = self::X_MARK;\n $this->_botMark = self::O_MARK;\n break;\n case self::O_MARK:\n $this->_userMark = self::O_MARK;\n $this->_botMark = self::X_MARK;\n break;\n case self::QUIT_BUTTON:\n $this->quit();\n }\n echo \"You will be Player \" . $this->_userMark . \".\" . PHP_EOL;\n echo $this->promptMessage('start_game') . PHP_EOL;\n }",
"private function setRunningPaused( $running, $paused ) {\n $this->isRunning = is_bool( $running ) ? $running : false;\n $this->isPaused = is_bool( $paused ) ? $paused : false;\n }",
"public function play()\n {\n $game = $this->getGame();\n $playerList = $game->getPlayerList();\n /** @var IPlayer $player */\n array_map(function($player){\n $player->removeCards();\n }, $playerList->getPlayers());\n $this->getGame()->setDeck((new \\FiveCardDraw\\Service\\Deck\\StandardDeckBuilder())->build());\n for ($i = 0; $i < 5; ++$i) {\n /** @var IPlayer $player */\n foreach ($playerList->getPlayers() as $player) {\n $player->addCard($game->getDeck()->draw());\n }\n }\n $game->changeState(new TradeState($game));\n }",
"public function switchActivePlayer()\n\t{\n\t\t$activeplayer = $this -> activePlayer;\n\t\t$playerX = $this -> playerX;\n\t\t$playerO = $this -> playerO;\n\t\tif ($activeplayer == $playerX)\n\t\t\t$this -> activePlayer = $playerO;\n\t\telse\n\t\t\t$this -> activePlayer = $playerX;\n\t\t\t\n\t\t$newactive = $this -> activePlayer;\n\t\t\n\t\t$query = \"UPDATE tttgame \n\t\t\t\t SET activeplayer = '$newactive' \n\t\t\t\t WHERE playerX = '$playerX' \n\t\t\t\t AND playerO = '$playerO';\";\n\t\t$this -> queryDB($query);\n\t}",
"function play( $id, $id_param, $back_url ) {\n\t\t\n\t}",
"function start()\n\t{\n\t\t$this->score = 0;\n\t\t$this->won = false;\n\t\t$this->over = false;\n\t}",
"function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}",
"function setSeeking($newSeeking){\n $this->seeking = $newSeeking;\n }",
"function runningPlay() {\n\t\t// request information about the new challenge ...\n\t\t// ... and callback to function newChallenge() ...\n//\t\t$this->addCall('GetCurrentChallengeInfo', array(), '', 'newChallenge');\n\t}",
"public function __set($attr_playlist_name, $attr_val) {\r\n if (property_exists(__CLASS__, $attr_playlist_name)) {\r\n $this->$attr_playlist_name = $attr_val;\r\n }\r\n }",
"public function setActive() {}",
"public function setMusicPlaylist($attributes = []);",
"function videoPlayPauseButton(){ ?>\n\t\n\t<span id=\"video-play-pause\" class=\"pause-btn\"></span>\n\n<?php }",
"public function isPlaying()\n {\n return \\doing_action($this->tag);\n }",
"public function pause(){\n\t\tsession_write_close();\n\t}",
"public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}",
"public function getPause()\n {\n return $this->get(self::PAUSE);\n }",
"public function start() {\r\n\r\n $this->stepTick = $this->getMain()->getServer()->getTick();\r\n\r\n $count = count($this->players);\r\n\r\n $this->step = self::STEP_HIDE;\r\n\r\n $this->seekersCount = ceil($count * ($this->getSeekersPercentage() / 100)); // Minimum $this->getSeekersPercentage() percents of the players (inimum because if there are less than $this->getSeekersPercentage(), then there could be no seeker)\r\n\r\n $this->hidersLeft = count($this->players) - $this->seekersCount;\r\n\r\n\r\n\r\n shuffle($this->players);\r\n\r\n $i = 0;\r\n\r\n foreach($this->players as $p) {\r\n\r\n if($i < $this->seekersCount) {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_SEEK;\r\n\r\n $this->players[$i]->sendTip(\"§4You're a seeker.\");\r\n\r\n } else {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_HIDE;\r\n\r\n $this->players[$i]->sendTip(\"§4You're an hider.\");\r\n\r\n }\r\n\r\n $i++;\r\n\r\n }\r\n\r\n }",
"function setActive() ;",
"public function setFirstPlayExpiration($value)\n {\n $this->_firstPlayExpiration = $value;\n }",
"function next() { \n\n\t\tif ($this->XBMCCmd(\"PlayNext\")!=\"OK\") { return false; }\n return true;\n\n\t}",
"public function playMoves()\n\t{\n\t\t$this->resetBoard();\n\t\t$moves = unserialize(serialize($this->moves));\n\t\t$this->resetMoves();\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$this->move($move[0], $move[1]);\n\t\t}\n\t}",
"function testRun( )\n\t{\n $this->audio->addCronTab( 1, 2, 3, \"xxx.mp3\", 4 );\n $this->audio->readCronTab( );\n $this->audio->readFutureCronTab( );\n\t}",
"function inline_play_handler( $atts, $content = null ) {\n\t\t\t\n\t\t\tif ( !$this->external_call && (is_home() || is_archive()) && $this->theSettings['player_onblog'] == \"false\" ) { \n\t\t\t\treturn; \n\t\t\t}\n\t\t\t$id = $this->Player_ID;\t\t\t\n\t\t\textract(shortcode_atts(array( // Defaults\n\t\t\t\t'bold' => 'y',\n\t\t\t\t'play' => 'Play',\n\t\t\t\t'track' => '',\n\t\t\t\t'caption' => '',\n\t\t\t\t'flip' => 'l',\n\t\t\t\t'title' => '#USE#',\n\t\t\t\t'stop' => 'Stop',\n\t\t\t\t'ind' => 'y',\n\t\t\t\t'autoplay' => $this->theSettings['auto_play'],\n\t\t\t\t'loop' => 'false',\n\t\t\t\t'vol' => $this->theSettings['initial_vol'],\n\t\t\t\t'flow' => 'n'\n\t\t\t), $atts));\n\t\t\t\t\t\n\t\t\tif ( $track == \"\" ) { // Auto increment \n\t\t\t\tif ( !$this->has_fields || $this->external_call ) { return; }\n\t\t\t\t$track = ++$this->single_autocount;\n\t\t\t\t$arb = \"\";\n\t\t\t} \n\t\t\telseif ( is_numeric($track) ) { // Has a track number\n\t\t\t\tif ( !$this->has_fields || $this->external_call ) { return; }\n\t\t\t\t$arb = \"\";\n\t\t\t} \n\t\t\telse { // Has arbitrary file/uri\t\t\t\t\n\t\t\t\tif ( !$this->string_pushto_playlist( $track, $caption, \"1\" ) ) { return; }\n\t\t\t\t$track = $this->InlinePlaylist['count'];\t\t\t\t\t\n\t\t\t\t$arb = \"arb\";\n\t\t\t}\n\t\t\t\n\t\t\t$divO = \"\";\n\t\t\t$divC = \"\";\n\t\t\tif ( $flow == \"n\" || $this->external_call ) {\n\t\t\t\t$divO = \"<div style=\\\"font-size:14px; line-height:22px !important; margin:0 !important;\\\">\";\n\t\t\t\t$divC = \"</div>\";\n\t\t\t}\n\t\t\t\n\t\t\t$playername = ( $arb != \"\" ) ? \"foxInline\" : $this->has_fields;\n\t\t\t\n\t\t\t// Set font weight\n\t\t\t$b = ( $bold == \"false\" || $bold == \"0\" || $bold == \"n\" ) ? \" style=\\\"font-weight:500;\\\"\" : \" style=\\\"font-weight:700;\\\"\";\n\t\t\t\n\t\t\t// Set spacer between elements depending on play/stop/title\n\t\t\tif ( $play != \"\" && $title != \"\" ){\t\n\t\t\t\t$spacer = \" \"; \n\t\t\t} else {\n\t\t\t\t$spacer = \"\";\n\t\t\t\tif ( $play == \"\" && $stop != \"\" ) { $stop = \" \" . $stop; }\n\t\t\t}\n\t\t\t// Prep title\n\t\t\t$customtitle = ( $title == \"#USE#\" ) ? \"\" : $title;\n\t\t\t\n\t\t\t// Make id'd span elements\n\t\t\t$openWrap = $divO . \"<span id=\\\"playpause_wrap_mp3j_\" . $id . \"\\\" class=\\\"wrap_inline_mp3j\\\"\" . $b . \">\";\n\t\t\t//$pos = \"<span class=\\\"bars_mp3j\\\"><span class=\\\"load_mp3j\\\" id=\\\"load_mp3j_\" . $id . \"\\\" style=\\\"background:\" . $this->Colours['loadbar_colour'] . \";\\\"></span><span class=\\\"posbar_mp3j\\\" id=\\\"posbar_mp3j_\" . $id. \"\\\"></span></span>\";\n\t\t\t$pos = \"<span class=\\\"bars_mp3j\\\"><span class=\\\"load_mp3j\\\" id=\\\"load_mp3j_\" . $id . \"\\\"></span><span class=\\\"posbar_mp3j\\\" id=\\\"posbar_mp3j_\" . $id. \"\\\"></span></span>\";\n\t\t\t//$play_h = \"<span class=\\\"textbutton_mp3j\\\" id=\\\"playpause_mp3j_\" . $id . \"\\\" style=\\\"color:\" . $this->Colours['list_current_colour'] . \";\\\">\" . $play . \"</span>\";\n\t\t\t$play_h = \"<span class=\\\"textbutton_mp3j\\\" id=\\\"playpause_mp3j_\" . $id . \"\\\">\" . $play . \"</span>\";\n\t\t\t$title_h = ( $title == \"#USE#\" || $title != \"\" ) ? \"<span class=\\\"T_mp3j\\\" id=\\\"T_mp3j_\" . $id . \"\\\">\" . $customtitle . \"</span>\" : \"\";\n\t\t\t$closeWrap = ( $ind != \"y\" ) ? \"<span style=\\\"display:none;\\\" id=\\\"indi_mp3j_\" . $id . \"\\\"></span></span>\" . $divC : \"<span class=\\\"indi_mp3j\\\" id=\\\"indi_mp3j_\" . $id . \"\\\"></span></span>\" . $divC;\n\t\t\t\n\t\t\t// SHOULD THIS GO SOMEWHERE IN SPAN FORMAT??\n\t\t\t$vol_h = \"<div class=\\\"vol_mp3j\\\" id=\\\"vol_mp3j_\" . $id . \"\\\"></div>\";\n\t\t\t\n\t\t\t// Assemble them\t\t\n\t\t\t$html = ( $flip != \"l\" ) ? $openWrap . $pos . $title_h . $spacer . $play_h . $closeWrap : $openWrap . $pos . $play_h . $spacer . $title_h . $closeWrap;\n\t\t\t\n\t\t\t// Add title to js footer string if needed \n\t\t\tif ( $title_h != \"\" && $title == \"#USE#\" ) {\n\t\t\t\t$this->Footerjs .= \"jQuery(\\\"#T_mp3j_\" . $id . \"\\\").append(\" . $playername . \"[\" . ($track-1) . \"].name);\\n\";\n\t\t\t\t//$this->Footerjs .= \"jQuery(\\\"#T_mp3j_\" . $id . \"\\\").append('<span style=\\\"font-size:.7em;\\\"> - '+\" . $playername . \"[\" . ($track-1) . \"].artist+'</span>');\\n\";\n\t\t\t\t$this->Footerjs .= \"if (\" . $playername . \"[\" . ($track-1) . \"].artist !==''){ jQuery(\\\"#T_mp3j_\" . $id . \"\\\").append('<span style=\\\"font-size:.75em;\\\"> - '+\" . $playername . \"[\" . ($track-1) . \"].artist+'</span>'); }\\n\";\n\t\t\t}\n\t\t\t// Add info to js info array\n\t\t\t$autoplay = ( $autoplay == \"true\" || $autoplay == \"y\" || $autoplay == \"1\" ) ? \"true\" : \"false\";\n\t\t\t$loop = ( $loop != \"false\" ) ? \"true\" : \"false\";\n\t\t\t$this->jsInfo[] = \"\\n { list:\" . $playername . \", type:'single', tr:\" . ($track-1) . \", lstate:'', loop:\" . $loop . \", play_txt:'\" . $play . \"', pause_txt:'\" . $stop . \"', pp_title:'', autoplay:\" . $autoplay . \", has_ul:0, transport:'playpause', status:'basic', download:false, vol:\" . $vol . \", height:'' }\";\n\t\t\t\n\t\t\t$this->write_jp_div();\n\t\t\t$this->Player_ID++;\n\t\t\treturn $html;\n\t\t}",
"public function set( $name, $value ){\n\t\t\tif( !$this->isStarted() ){\n\t\t\t\t$this->startAll();\n\t\t\t}\n\n\t\t\t$_SESSION[ $name ] = $value;\n\t\t}",
"public abstract function onPlayerSelect();",
"protected function setAudio($index = 0)\n\t{\n\t\tif (isset($this->audio[$index]))\n\t\t{\n\t\t\t$this->_tmp_audio = $this->audio[$index];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_tmp_audio = new stdClass;\n\t\t}\n\t}",
"public function setAudio($v)\n\t{\n\n\t\tif ($this->audio !== $v || $v === false) {\n\t\t\t$this->audio = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::AUDIO;\n\t\t}\n\n\t}",
"public function set($s) {\r\n\t\t$this->current = $s;\r\n\t}",
"public function set_buffering($on) {\n\t\tself::$core_display->buffering = $on;\n\t\tif (!$this->buffering_on()) {\n\t\t\t$this->flush_buffer();\n\t\t}\n\t}",
"public function unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }",
"function set_current_record($recordVar, Omeka_Record_AbstractRecord $record, $setPreviousRecord = false)\n{\n get_view()->setCurrentRecord($recordVar, $record, $setPreviousRecord);\n}",
"public function setSession()\n\t{\n\t\t$this->session = Session::getInstance();\n\t\t$this->session->start();\n\t}",
"public function updatePlayer($player)\n\t{\n\t}",
"public function setMusicSong($attributes = []);",
"public function setSoundType ($typ) {\n\t\tif (ctype_digit ($typ))\n\t\t\t$this->soundType = $typ;\n\t\telse if (!is_null($this->soundTypeMap[$typ]))\n\t\t\t$this->soundType = $this->soundTypeMap[$typ];\n\t}",
"function isPlaying() {\n\t$info = [];\n\texec(\"mpc\", $info);\n\treturn strpos($info[1], '[paused]') !== 0 && strpos($info[0], 'volume') !== 0;\n}",
"private function _changeActivePlayer()\n\t{\n\t\t// Get next player id, then save it to this game\n\t\t$this->read();\n\t\t$this->Player->id = $this->data['Game']['active_player'];\n\t\t$this->Player->read();\n\t\t$this->set('active_player', $this->Player->data['Player']['next_player_id']);\n\t\t$this->save();\n\t\t\n\t\t// Success\n\t\treturn true;\n\t}",
"public function SwitchPlayer($id_setlist, $id_category)\n\t{\n\t\t#$data = $this->model->switchPlayer($id_setlist, $id_category);\n\t\t#$this->run('Edit', array('id_setup' => $data->id_setup));\n\n\t\t$this->run(\n\t\t\t'Edit',\n\t\t\tarray(\n\t\t\t\t'id_setup' => $this->model->switchPlayer($id_setlist, $id_category)->id_setup\n\t\t\t)\n\t\t);\n\t}",
"function prev() { \n\n\t\tif ($this->XBMCCmd(\"PlayPrev\")!=\"OK\") { return false; }\n return true;\n\t\n\t}",
"function pause()\n {\n session_write_close();\n }",
"public static function changeCurrentTime($currentTime = 'now')\n {\n self::$_currentTime = $currentTime;\n }",
"function play_number($num){\r\n\t\t$out = '';\r\n\r\n\t\t$out .= \"<audio controls autoplay>\";\r\n\t\t$out .= \"<source src=sound/\".$num.\".wav type='audio/mpeg'>\";\r\n\t\t/*$out .= \"sleep(1)\";\r\n\t\t$out .= \"<source src=sound/\".$x1.\".wav type='audio/mpeg'>\";\r\n\t\t$out .= \"sleep(1)\";\r\n\t\t$out .= \"<source src=sound/\".$x0.\".wav type='audio/mpeg'>\";\r\n\t\t$out .= \"sleep(1)\";*/\r\n\t\t$out .= \"</audio>\";\r\n\t \r\n\t return $out;\r\n\t}",
"public function makeSound()\n {\n echo 'Maw Maw....<br>';\n }",
"public function playByPlay(): Response\n {\n return $this->call('playbyplay');\n }",
"public function play($currentPlayerId, $type = Game::IMPORT_TYPE_NORMAL)\n {\n $gameData = Cache::get('tcg.userGame', null);\n if (!$gameData) {\n $game = GameBuilder::buildTest($currentPlayerId, ['isBot' => false]);\n } else {\n\n $game = Game::import($type, $gameData, $currentPlayerId);\n }\n $this->game = $game;\n\n }",
"public static function resetCurrentTime()\n {\n \tself::$_currentTime = 'now';\n }",
"public function start(): void\n {\n $this->startTimer();\n $this->setGameState(SELF::STATE_STARTED);\n }",
"public function play($params = null, $options = null)\n {\n $url = $this->instanceUrl() . '/actions/play';\n list($response, $opts) = $this->_request('post', $url, $params, $options);\n $this->refreshFrom($response, $opts);\n return $this;\n }",
"public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }",
"protected function selectPlayer(){\r\n $this->currentPlayer = rand(1,2);\r\n selectRandPlayerMsg($this->currentPlayer);\r\n }",
"public function play($auto = true, $interval = 5000, $pauseOnHover = false)\r\n\t{\r\n\t\t$value = array(\r\n\t\t\t'interval'\t\t=> $interval,\r\n\t\t\t'auto'\t\t\t=> $auto,\r\n\t\t\t'pauseOnHover'\t=> $pauseOnHover\r\n\t\t);\r\n\r\n\t\t$this->options['play'] = $this->mergeOption('play', $value);\r\n\r\n\t\treturn $this;\r\n\t}",
"public function updateNowPlaying(SessionInterface $session, string $artist, string $track, string $album = null, $trackNumber = null, $context = null, $mbid = null, $duration = null, $albumArtist = null): void\n {\n $this->signedCall('track.updateNowPlaying', [\n 'artist' => $artist,\n 'track' => $track,\n 'album' => $album,\n 'trackNumber' => $trackNumber,\n 'context' => $context,\n 'mbid' => $mbid,\n 'duration' => $duration,\n 'albumArtist' => $albumArtist,\n ], $session, 'POST');\n }",
"private function setCurrent($dir)\n\t{\n\t\t$this->current_dir = str_replace(self::$dir, '', $dir);\n\t}",
"public function stand(){\n $_SESSION['score'] = $this ->score;\n $this ->endturn = false;\n }",
"public function setFrame($value) {}",
"public function resume();",
"public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}",
"public function onPlayerInteract(Player $player) : void {\n\t}",
"public function makeSound()\n {\n echo 'Wow wow....<br>';\n }",
"public function processMusic()\n\t{\n\t\tif ($this->site->lookupmusic !== '0') {\n\t\t\t$music = new Music($this->echooutput);\n\t\t\t$music->processMusicReleases();\n\t\t}\n\t}",
"public function setProgressNow(int $value)\n {\n $this->update(['progress_now' => $value]);\n }",
"function theme_views_slideshow_thumbnailhover_control_pause($vss_id, $view, $options) {\n return l(t('Pause'), '', array(\n 'attributes' => array(\n 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',\n 'id' => \"views_slideshow_thumbnailhover_playpause_\" . $vss_id,\n ),\n 'fragment' => ' ',\n 'external' => TRUE,\n ));\n}",
"function set_current_url() {\r\n\t\t\t$this->current_url = $this->get_current_url();\r\n\t\t}"
] | [
"0.65589255",
"0.65317315",
"0.6311168",
"0.61975765",
"0.5907432",
"0.5904678",
"0.58615655",
"0.5794852",
"0.57136136",
"0.56510025",
"0.56299025",
"0.5622852",
"0.5602241",
"0.5478389",
"0.5441109",
"0.5407787",
"0.5388129",
"0.53508216",
"0.53296375",
"0.5308068",
"0.52894217",
"0.52413946",
"0.5149783",
"0.5144713",
"0.51015633",
"0.5094347",
"0.5094347",
"0.5094347",
"0.5065036",
"0.5063786",
"0.50399077",
"0.5037028",
"0.50057936",
"0.50051737",
"0.4948309",
"0.4938274",
"0.49260676",
"0.4916717",
"0.4896938",
"0.48818406",
"0.4853534",
"0.48319492",
"0.48081616",
"0.48014155",
"0.480009",
"0.47962847",
"0.4792666",
"0.47867063",
"0.478625",
"0.47798732",
"0.4753472",
"0.4744071",
"0.47384992",
"0.47369766",
"0.47336817",
"0.47316656",
"0.47274485",
"0.47067022",
"0.46768785",
"0.46766147",
"0.46690986",
"0.4668061",
"0.46642813",
"0.46521702",
"0.464632",
"0.46328378",
"0.46324283",
"0.46276075",
"0.4625907",
"0.4615174",
"0.46148458",
"0.46025884",
"0.45972314",
"0.45896396",
"0.45892623",
"0.45833653",
"0.4583283",
"0.45791054",
"0.45646107",
"0.4558664",
"0.45521936",
"0.4549488",
"0.45238924",
"0.45144305",
"0.45142913",
"0.4513178",
"0.4510528",
"0.4509369",
"0.45019838",
"0.4501417",
"0.44981158",
"0.44867024",
"0.44850504",
"0.44763792",
"0.4471258",
"0.44617477",
"0.444675",
"0.4444933",
"0.44292578",
"0.44204465"
] | 0.6193976 | 4 |
Display a listing of the resource. | public function index()
{
if ('admin' != Auth::user()->username)
{
return Response::json(array('result'=>'failed','error_msg'=>'You do not have access to this page'));
}
$scopes = Scope::all() ;
return View::make('scope.index',array('scopes'=>$scopes,'active'=>'scopes','nav_active'=>'scopes')) ;//转至系统权限管理页面
} | {
"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()
{
//
} | {
"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()
{
//
} | {
"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}"
] | [
"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.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }"
] | [
"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.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()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
] | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.68336326",
"0.6811471",
"0.68060875",
"0.68047357",
"0.68018645",
"0.6795623",
"0.6791791",
"0.6791791",
"0.6787701",
"0.67837197",
"0.67791027",
"0.677645",
"0.6768301",
"0.6760122",
"0.67458534",
"0.67458534",
"0.67443407",
"0.67425704",
"0.6739898",
"0.6735328",
"0.6725465",
"0.6712817",
"0.6693891",
"0.6692419",
"0.6688581",
"0.66879624",
"0.6687282",
"0.6684741",
"0.6682786",
"0.6668777",
"0.6668427",
"0.6665287",
"0.6665287",
"0.66610634",
"0.6660843",
"0.66589665",
"0.66567147",
"0.66545695",
"0.66527975",
"0.6642529",
"0.6633056",
"0.6630304",
"0.6627662",
"0.6627662",
"0.66192114",
"0.6619003",
"0.66153085",
"0.6614968",
"0.6609744",
"0.66086483",
"0.66060555",
"0.6596137",
"0.65950733",
"0.6594648",
"0.65902114",
"0.6589043",
"0.6587102",
"0.65799844",
"0.65799403",
"0.65799177",
"0.657708",
"0.65760696",
"0.65739626",
"0.656931",
"0.6567826",
"0.65663105",
"0.65660435",
"0.65615267",
"0.6561447",
"0.6561447",
"0.65576506",
"0.655686",
"0.6556527",
"0.6555543",
"0.6555445",
"0.65552044",
"0.65543956",
"0.65543705",
"0.6548264",
"0.65475875",
"0.65447706"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(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)
{
//
} | {
"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 |
sets the required permissions of the navigation | public function setRequiredPermissions($permissions = array())
{
$this->requiredPermissions = $permissions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __setNavRendererPerms() {\n\t\t$userPermission = array(\n\t\t\t'allowProxy' => false, \n\t\t\t'allowAdmin' => false\n\t\t);\n\n\t\tif($this->Auth->loggedIn()) {\n\t\t\t$user = array('model' => 'User', 'foreign_key' => $this->Auth->user('id'));\n\t\t\t$isSuper = $this->Acl->check($user, 'role/super');\n\t\t\t$userPermission = array(\n\t\t\t\t'allowProxy' => $isSuper,\n\t\t\t\t'allowAdmin' => $isSuper\n\t\t\t);\n\t\t} \n\n\t\t// pass as settings to the helper constructor\n\t\t$this->helpers['NavRenderer'] = $userPermission;\n\t}",
"public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }",
"protected function setRequiredAccessLevelsForPost() {\n $this->post_required_access_levels = array(\"owner\",\"admin\",\"collaborator\");\n }",
"public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}",
"public function initializePermissions() {\n\t\tLoader::helper('clov_permissions', 'clov');\n\t\t$page = $this->getCollectionObject();\n\t\t\n\t\tClovPermissionsHelper::setBaselinePermissions($page);\n\t\t\n\t\t// Project managers and employees can add new expenses.\n\t\t$clovGroups = Loader::package('clov')->getGroups();\n\t\t$page->assignPermissions($clovGroups[ClovPackage::PROJECT_MANAGERS], array('add_subpage'));\n\t\t$page->assignPermissions($clovGroups[ClovPackage::EMPLOYEES], array('add_subpage'));\n\t\t\n\t\t// Only allow clov_expense pages under this one.\n\t\tClovPermissionsHelper::restrictSubpageType($page, CollectionType::getByHandle('clov_expense'));\n\t}",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }",
"public function setPermissions($permissions) {}",
"protected function editLockPermissions() {}",
"protected function CheckNavigationRights()\n {\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n $this->data['showCacheButton'] = $securityHelper->isGranted('CMS_RIGHT_FLUSH_CMS_CACHE');\n }",
"function SettingsController_DefineAdminPermissions_Handler(&$Sender) {\n if (isset($Sender->RequiredAdminPermissions)) {\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Settings.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Categories.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Spam.Manage';\n }\n }",
"public function givePermission($permissions);",
"protected function assignPermissions()\n {\n $role = Role::whereName(config('system.default_role.admin'))->first();\n $role->syncPermissions(config('system.default_permission'));\n }",
"protected function checkAccess() {\n\t\t$hasAccess = static::hasAccess();\n\n\t\tif (!$hasAccess) {\n\t\t\tilUtil::sendFailure($this->pl->txt(\"permission_denied\"), true);\n if (self::version()->is6()) {\n $this->ctrl->redirectByClass(ilDashboardGUI::class, 'jumpToSelectedItems');\n } else {\n\t\t\t$this->ctrl->redirectByClass(ilPersonalDesktopGUI::class, 'jumpToSelectedItems');\n\t\t\t}\n\t\t}\n\t}",
"public function setPermissions($permissions);",
"function virustotalscan_admin_permissions(&$admin_permissions)\r\n{\r\n \tglobal $lang;\r\n // se incarca fisierul de limba\r\n \t$lang->load(\"virustotalscan\", false, true);\r\n // se seteaza textul permisiunii\r\n\t$admin_permissions['virustotalscan'] = $lang->virustotalscan_canmanage;\r\n}",
"function restrict_menus() {\n if (!current_user_can('manage_options') && is_user_logged_in()) {\n $path = get_site_url();\n $screen = get_current_screen();\n $base = $screen->id;\n\n if( 'profile' == $base || 'edit-contact' == $base || 'contact' == $base || 'edit-category' == $base ) {\n // only load these pages\n } else {\n wp_redirect($path.'/wp-admin/edit.php?post_type=contact');\n }\n }\n}",
"protected function _setupPrivileges()\n {\n $this->_acl\t->allow( 'guest', 'index', 'index' )\n ->allow( 'guest', 'auth' , array('index', 'login', 'logout') )\n ->allow( 'guest', 'register', 'index');\n\n $this->_acl\t->allow( 'user', 'index', 'index' )\n ->allow( 'user', 'auth' , array('index', 'login', 'logout') )\n ->allow( 'user', 'register', 'index')\n ->allow( 'user', 'dashboard', 'index');\n }",
"private function loadPermissions(): void\n {\n $permissions = Cache::get($this->cacheKey());\n\n $this->isPayor = $permissions['isPayor'];\n $this->isAgencyBankAccountSetup = $permissions['isAgencyBankAccountSetup'];\n $this->canViewDocumentation = $permissions['canViewDocumentation'];\n }",
"protected function setupPermissionFields()\n {\n $tab = 'Permission';\n\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STAFF))->setLabel('Manage Staff')->setTabGroup($tab)\n// ->setNotes('Add/Edit Staff user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STUDENT))->setLabel('Manage Students')->setTabGroup($tab)\n// ->setNotes('Add/Edit Student user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_SUBJECT))->setLabel('Manage Subjects')->setTabGroup($tab)\n// ->setNotes('Add/Edit subject and student enrollments');\n }",
"private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}",
"public function setRequiredPermissions($permissionNames)\n\t{\n\t}",
"function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}",
"public function accesspermissionAction()\r\n {\r\n \r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $this->view->keyy=$key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n $this->view->menu_table=$temp_menu_arr;\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }",
"public function SetPermissions ($permissions);",
"protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Yonetici'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Şirket hakkındaki herşeyi yapabilir'));\n\n Jetstream::role('editor', __('İlan Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece ilanları yönetebilir'));\n Jetstream::role('operasyon', __('Operasyon Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece operasyonları yönetebilir'));\n\n }",
"protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}",
"function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}",
"public function setAcl()\n {\n Zend_Registry::set('acl',$this->acl);\n }",
"protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::permissions([\n 'create',\n 'read',\n 'update',\n 'delete',\n ]);\n }",
"public function enableNavigation() {\n\t\t$this->enableNav = true;\n\t}",
"function repository_googledrive_extend_navigation_user_settings($navigation, $user, $usercontext, $course, $coursecontext) {\n $url = new moodle_url('/repository/googledrive/preferences.php');\n $subsnode = navigation_node::create(get_string('syncyourgoogleaccount', 'repository_googledrive'), $url,\n navigation_node::TYPE_SETTING, null, 'monitor', new pix_icon('i/navigationitem', ''));\n\n if (isset($subsnode) && !empty($navigation)) {\n $navigation->add_node($subsnode);\n }\n}",
"protected function fixPermission() {}",
"public function testPermissionSet()\n {\n }",
"private function savePermissions(): void\n {\n $this->client->isPayor = $this->isPayor;\n $this->client->isAgencyBankAccountSetup = $this->isAgencyBankAccountSetup;\n $this->client->canViewDocumentation = $this->canViewDocumentation;\n }",
"public function setAdminPermissions(array $permissions): void;",
"public function testUpdatePermissionSet()\n {\n }",
"public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }",
"function role_permission() {\n\t\tif(!has_permission(2)) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->output_head['function'] = __FUNCTION__;\n\n\t\t$this->output_head['style_extras'] = array(assets_url() . '/plugins/datatables/dataTables.bootstrap.css');\n\t\t$this->output_head['js_extras'] = array(assets_url() . '/plugins/datatables/jquery.dataTables.min.js',\n\t\t\t\t\t\t\t\t\t\t\t\tassets_url() . '/plugins/datatables/dataTables.bootstrap.min.js');\n\t\t$this->output_head['js_function'] = array();\n\t\t$this->load->model('user_model');\n\t\t\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'Role & Permission Manager';\n\t\t$this->load->view('role_permission', $this->output_data);\n\t\t$this->load->view('global/footer');\n\t}",
"public function accesspermission1Action()\r\n {\r\n Zend_Loader::loadClass('Permission');\r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n //print \"<pre>\"; print_r($this->view->user_permission_table); print \"</pre>\";\r\n //print \"<pre>\"; print_r($temp_menu_arr); print \"</pre>\";\r\n $this->view->menu_table=$temp_menu_arr;\r\n\r\n //exit;\r\n /*$this->view->user_detail=$ob_User->getUserDetails($user_id);\r\n $ob_Credit\t= new Credit();\r\n $user_current_balance=$ob_Credit->get_current_balance($user_id);\r\n $this->view->user_expiary_date=$user_current_balance[$user_id]['expiary_date'];\r\n\r\n $subusers=$ob_User->get_sub_user_ids($user_id,0,0);\r\n $this->view->subusers_count=($subusers)?count(explode(',',$subusers)):0;*/\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n\r\n\r\n /*\r\n $ob_User\t= new User();\r\n $this->view->user_rows=$ob_User->get_user_list_rows(0,$quick_search,$arr_limit,$arr_order);\r\n $row_count=$ob_User->get_user_list_rows_count(0,$quick_search);\r\n $arr_rows=array('user_id','account_name','phone','email','nric');\r\n $this->view->page_sorting_images=$this->sessionAuth->get_sorting_html($arr_rows,$arr_order);\r\n\r\n $this->view->page_peginetion=$this->sessionAuth->get_peginetion($row_count,$page,$num_row);*/\r\n//print \"<pre>\"; print_r($aaaaaaa); print \"</pre>\"; exit;\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }",
"function set_can_create_list ($permission)\r\n {\r\n $_SESSION[\"can_create_list\"] = $permission;\r\n }",
"protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Administrator'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Administrator users can perform any action.'));\n\n Jetstream::role('editor', __('Editor'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Editor users have the ability to read, create, and update.'));\n }",
"function check_role_access(){\n if(!is_user_logged_in()){\n return 0;\n }\n //Make sure its not admin\n if(in_array(\"administrator\", wp_get_current_user()->roles)){\n return 0;\n }\n\n\n //Get capabilities\n $allcaps = wp_get_current_user()->allcaps;\n $can_access = array();\n //Get manu slugs user can access from capabilities\n foreach($allcaps as $key=>$value){\n if(strpos($key,$this->wp_user_role_customizer) !== FALSE){\n //Remove wp_user_role_customizer from capability name to get menu-slug\n array_push($can_access, substr($key, strlen($this->wp_user_role_customizer . \"_\"), strlen($key)));\n\n }\n }\n\n if(empty($can_access)){\n return 0;\n }\n\n // array_push($can_access, 'post.php');\n\n\n\n //Get path and query of requested page\n $uri = wp_parse_url($_SERVER['REQUEST_URI']);\n $path = (isset($uri['path']) ? $uri['path'] : null);\n $query = (isset($uri['query']) ? $uri['query'] : null);\n $user_can_access = FALSE;\n //Make sure its wp-admin page\n if(strpos($path, 'wp-admin') !== FALSE){\n //Redirect to dashboard if requested page is either about.php or index.php\n if(strpos($path, '/wp-admin/about.php') !== FALSE || strpos($path, '/wp-admin/index.php') !== FALSE){\n wp_redirect(get_dashboard_url());\n exit();\n }\n\n if( strpos($path,'.php') !== FALSE || $query !== null){\n foreach($can_access as $menu_slug){\n //Access page if user can access requested page\n if($this->check_for_url_access($path,$query,$menu_slug)){\n $user_can_access = TRUE;\n break;\n\n }\n }\n //Exit if user can't access requested page\n if($user_can_access === FALSE){\n wp_die('You Cannot Access This Page', 'Access Denied',['exit'=> true]);\n }\n }\n }\n\n }",
"function routePermission(){\n\t\n\t$routePermission =[\n\n\t\t'admin_owner_auth_check' =>\t\n\t\t\t\n\t\t\t[\n\t\t\t\t//jobs permission\n\t\t\t\t// 'jobs/create'=>['add_job'],\t\t\t\t\t\n\t\t\t\t// 'jobs/store'=>['add_job'],\n\t\t\t\t'jobs/{reference_id}/{step?}'=>['edit_job'], \n\t\t\t\t'jobs/update'=>['edit_job'],\n\n\t\t\t\t//listing permission\n\t\t\t\t// 'listing/create'=>['add_listing'],\t\t\t\t\t\n\t\t\t\t'listing/{reference}/edit/{step?}'=>['edit_listing'], \n\t\t\t\t\n\n\n\t\t\t\t//admin jobs permission\n\t\t\t\t'admin-dashboard/moderation/listing-approval'=>['listing_approval'],\n\t\t\t\t'admin-dashboard/moderation/manage-listings'=>['listing_approval'],\n\t\t\t\t'admin-dashboard/moderation/manage-enquiries'=>['listing_approval'],\n\t\t\t\t\n\n\n \t\t\t\t'admin-dashboard/jobs/manage-jobs'=>['manage_job_status'],\n \t\t\t\t// 'admin-dashboard/jobs/manage-jobs'=>['manage_job_status','manage_job_view'],\n\t\t\t \t'admin-dashboard/jobs/get-jobs'=>['manage_job_status','manage_job_view'],\n\t\t\t \t'admin-dashboard/jobs/update-job-status'=>['manage_job_status'],\n\t\t\t \t'admin-dashboard/jobs/bulk-update-job-status'=>['manage_job_status'],\n\t\t\t \t'admin-dashboard/config/categories'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/config/locations'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/users/internal-users'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/users/registered-users'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/users/export'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/email-notification'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/internal-email'=>['manage_job_status'],\n\n\t\t\t \t//ui element\n\t\t\t\t'submit_review_element_cls'=>['submit_for_review_job','submit_for_review_listing'],\n\t\t\t\t'edit_permission_element_cls'=>['edit_job','edit_listing'],\n\t\t\t\t'change_status_element_cls'=>['job_status'],\n\t\t\t\t'view_profile_element_cls' => ['listing_approval'],\n\t\t\t],\n\n\t\t'normal_user_check' =>\n\t\t\t[\t\t\t\t\t\t\n\t\t\t\t'delete_element_cls'=>['delete_job_contact'],\t\t\t\t\t\n\t\t\t\t'status_element_cls'=>['change_job_status'],\n\t\t\t\t'edit_element_cls'=>['edit_listing'],\t\n\t\t\t],\n\n\t\t// 'public_access' =>\n\t\t// \t[\t\n\t\t// \t\t//jobs permission\n\t\t// \t\t'jobs/{job}'=>['read_job'],\n\t\t// \t]\n\t\t\t\t\t\t\t\t\t\t\n\t];\n\n\n\treturn $routePermission;\n}",
"public function setAuthorizationElement();",
"function permissions() {\r\n\t\treturn false;\r\n\t}",
"public function setPermissions()\n\t{\n\t\treturn [\n\t\t\t'product.create',\n\t\t 'issue.create',\n\t\t 'issue.edit'\n\t\t];\n\t}",
"private function setRights($data) {\n\n if (isset($data['allowed_controllers']['Row'][0])) {\n $list = $data['allowed_controllers']['Row'][0];\n foreach ($list as $key => $value) {\n array_push( $this->rights, $value );\n }\n }\n }",
"private function registerPermissions(): void\n {\n Gate::before(static function (Authorizable $user, string $ability) {\n if (method_exists($user, 'checkPermissionTo')) {\n return $user->checkPermissionTo($ability) ?: NULL;\n }\n });\n }",
"public function init() {\n $config_array = $this->config->toArray();\n $prev_role = null;\n\n foreach ($config_array as $role => $permissions) {\n $prev_role = $this->addUserRole($role, $prev_role);\n \n if(empty($permissions) || !is_array($permissions)) {\n continue;\n }\n \n foreach($permissions as $controller => $actionList) {\n $controller = $this->addController($controller);\n $priviliges = $this->getPriviliges($actionList);\n \n $this->allow($role, $controller, $priviliges);\n } \n }\n }",
"public function is_allowed_to_set_content_object_rights();",
"function init() {\n\n if( !current_user_can( self::$capability ) ) {\n return;\n }\n\n //** Add Inquiry page to Property Settings page array */\n add_filter( 'wpp_settings_nav', array( &$this, 'settings_nav' ) );\n\n //** Add Settings Page */\n add_action( 'wpp_settings_content_admin_tools', array( &$this, 'settings_page' ) );\n\n //** Contextual Help */\n add_action( 'property_page_property_settings_help', array( &$this, 'wpp_contextual_help' ) );\n\n }",
"public function setPermission(Request $request)\n {\n $input = $request->all();\n $roles = $this->roleRepository->all();\n $permissionsSync = [];\n foreach ($roles as $role) {\n if (isset($input['roles'][$role->id])) {\n $permissionsSync = $input['roles'][$role->id]['permissions'];\n $role->permissions()->sync($permissionsSync);\n }\n }\n Session::flash('message', trans('permission.message.set_role'));\n return back();\n }",
"private function _navigationSettings(){\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $navigation = array();\r\n\r\n foreach ($_POST as $name => $value) {\r\n $navigation[$name] = $value;\r\n }\r\n\r\n if(file_put_contents(ROOT.DS.'site'.DS.'content'.DS.'navigation.json', json_encode($navigation))){\r\n $response = 200;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }",
"function ProcessLibraryPermissions()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ProcessLibraryPermissions();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_DELETE\")) {\n $this->disabled_delete = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_DELETE\");\n }\n else {\n $this->disabled_delete = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_EDIT\")) {\n $this->disabled_edit = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_EDIT\");\n }\n else {\n $this->disabled_edit = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_ADD\")) {\n $this->disabled_add = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_ADD\");\n }\n else {\n $this->disabled_add = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_APPLY\")) {\n $this->disabled_apply = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_APPLY\");\n }\n else {\n $this->disabled_apply = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_COPY\")) {\n $this->disabled_copy = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_COPY\");\n }\n else {\n $this->disabled_copy = 0;\n }\n\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_MOVE\")) {\n $this->disabled_move = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_MOVE\");\n }\n else {\n $this->disabled_move = 1;\n }\n\n if (! $this->disabled_move) {\n if ($this->listSettings->HasItem(\"MAIN\", \"MOVE_FIELD\")) {\n $this->move_field = $this->listSettings->GetItem(\"MAIN\", \"MOVE_FIELD\");\n }\n else {\n if ($this->Storage->HasColumn(\"_priority\") !== false) {\n $this->move_field = \"_priority\";\n }\n else {\n $_inc_column = $this->Storage->GetIncrementalColumn();\n $this->move_field = $_inc_column[\"name\"];\n }\n }\n }\n\n if ($this->listSettings->HasItem(\"MAIN\", \"IS_READONLY\")) {\n $this->read_only = $this->listSettings->GetItem(\"MAIN\", \"IS_READONLY\");\n if ($this->read_only) {\n $this->disabled_delete = 1;\n $this->disabled_edit = 1;\n $this->disabled_add = 1;\n $this->disabled_move = 1;\n }\n }\n else {\n $this->read_only = 0;\n }\n\n }",
"public function relatorio4(){\n $this->isAdmin();\n }",
"public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}",
"function _gizra_access_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create profile content\n $permissions[] = array(\n 'name' => 'create profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own profile content\n $permissions[] = array(\n 'name' => 'edit own profile content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view field_hidden_field\n $permissions[] = array(\n 'name' => 'view field_hidden_field',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}",
"protected function restrict() {\n $this->restrict_to_permission('manage_products');\n }",
"public function initialize()\n {\n parent::initialize();\n $nav_selected = [\"slides\"];\n $this->set('nav_selected', $nav_selected);\n\n // Allow full access to this controller\n //$this->Auth->allow();\n }",
"public function setup_root_nav_action() {\n\t\t$user_roles = $this->get_instance( UserRoles::class );\n\n\t\tif (\n\t\t\t$user_roles->is_wcfm_vendor()\n\t\t\t|| $user_roles->is_wcfm_shop_staff()\n\t\t\t|| $user_roles->is_wordpress_administrator()\n\t\t) {\n\t\t\t// Setup Family Settings Tab.\n\t\t\t\\bp_core_new_nav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => $this->get_instance( SiteDefaults::class )->defaults( 'account_type' ) . ' Settings',\n\t\t\t\t\t'slug' => 'family-settings',\n\t\t\t\t\t'show_for_displayed_user' => false,\n\t\t\t\t\t'screen_function' => array( $this, 'settings_render_main_screen_function' ),\n\t\t\t\t\t'item_css_id' => 'far fa-address-card',\n\t\t\t\t\t'user_has_access' => \\bp_is_my_profile(),\n\t\t\t\t\t'position' => 70,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\\bp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Shop Settings',\n\t\t\t\t\t'slug' => 'shop-settings',\n\t\t\t\t\t'parent_url' => trailingslashit( \\bp_displayed_user_domain() . 'family-settings' ),\n\t\t\t\t\t'parent_slug' => 'family-settings',\n\t\t\t\t\t'screen_function' => array( $this, 'settingssubtab_render_main_screen_function' ),\n\t\t\t\t\t'position' => 100,\n\t\t\t\t\t'user_has_access' => \\bp_is_my_profile(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\\bp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Products',\n\t\t\t\t\t'slug' => 'products',\n\t\t\t\t\t'parent_url' => trailingslashit( \\bp_displayed_user_domain() . 'family-settings' ),\n\t\t\t\t\t'parent_slug' => 'family-settings',\n\t\t\t\t\t'screen_function' => array( $this, 'productsubtab_render_main_screen_function' ),\n\t\t\t\t\t'position' => 100,\n\t\t\t\t\t'user_has_access' => \\bp_is_my_profile(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\\bp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Video',\n\t\t\t\t\t'slug' => 'video-settings',\n\t\t\t\t\t'parent_url' => trailingslashit( \\bp_displayed_user_domain() . 'family-settings' ),\n\t\t\t\t\t'parent_slug' => 'family-settings',\n\t\t\t\t\t'screen_function' => array( $this, 'videosubtab_render_main_screen_function' ),\n\t\t\t\t\t'position' => 20,\n\t\t\t\t\t'user_has_access' => \\bp_is_my_profile(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\\bp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Customers',\n\t\t\t\t\t'slug' => 'customer-settings',\n\t\t\t\t\t'parent_url' => trailingslashit( \\bp_displayed_user_domain() . 'family-settings' ),\n\t\t\t\t\t'parent_slug' => 'family-settings',\n\t\t\t\t\t'screen_function' => array( $this, 'customersubtab_render_main_screen_function' ),\n\t\t\t\t\t'position' => 10,\n\t\t\t\t\t'user_has_access' => \\bp_is_my_profile(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\\bp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Members and Payments',\n\t\t\t\t\t'slug' => 'advanced-settings',\n\t\t\t\t\t'parent_url' => trailingslashit( \\bp_displayed_user_domain() . 'family-settings' ),\n\t\t\t\t\t'parent_slug' => 'family-settings',\n\t\t\t\t\t'screen_function' => array( $this, 'advancedsubtab_render_main_screen_function' ),\n\t\t\t\t\t'position' => 200,\n\t\t\t\t\t'user_has_access' => \\bp_is_my_profile(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Setup My Video Tab.\n\t\t\\bp_core_new_nav_item(\n\t\t\tarray(\n\t\t\t\t'name' => 'Video Space',\n\t\t\t\t'slug' => 'video-space',\n\t\t\t\t'show_for_displayed_user' => true,\n\t\t\t\t'screen_function' => array( $this, 'myvideo_render_main_screen_function' ),\n\t\t\t\t'item_css_id' => 'far fa-address-card',\n\t\t\t\t'position' => 1,\n\t\t\t)\n\t\t);\n\n\t\t// Setup my accounts tab.\n\t\t\\bp_core_new_nav_item(\n\t\t\tarray(\n\t\t\t\t'name' => 'My Account',\n\t\t\t\t'slug' => 'my-account',\n\t\t\t\t'show_for_displayed_user' => false,\n\t\t\t\t'screen_function' => array( $this, 'account_render_main_screen_function' ),\n\t\t\t\t'item_css_id' => 'far fa-address-card',\n\t\t\t\t'position' => 80,\n\t\t\t)\n\t\t);\n\t}",
"public function checkPermissions();",
"function eu4all_extends_navigation(&$navigation){\n\tglobal $PAGE, $USER;\n\t\n\t$systemcontext = get_context_instance(CONTEXT_SYSTEM);\n\t$view = has_capability('local/eu4all:umviewownprofile', $systemcontext);\n\t$edit = has_capability('local/eu4all:umeditownprofile', $systemcontext);\n\t\n\tif(($view || $edit) && $node = $navigation->get('myprofile', navigation_node::TYPE_USER)){\n\t\tif($category = $node->add(get_string('pluginname', 'local_eu4all'), null, navigation_node::TYPE_CATEGORY)){\n\t\t\t// Force the EU4ALL category menu expansion if the user is using a screen reader\n\t\t\tif(!empty($USER->screenreader)){\n\t\t\t\t$category->force_open();\n\t\t\t}\n\t\t\t\n\t\t\tif($view){\n\t\t\t\t$category->add(get_string('viewAccessibilityPreferences', 'local_eu4all'), new moodle_url('/local/eu4all/pages/userpreferences.php', array('id'=>$USER->id)), navigation_node::TYPE_CUSTOM);\n\t\t\t}\n\t\t\tif($edit){\n\t\t\t\t$category->add(get_string('editAccessibilityPreferences', 'local_eu4all'), new moodle_url('/local/eu4all/pages/userpreferencesedit.php', array('id'=>$USER->id)), navigation_node::TYPE_SETTING);\n\t\t\t}\n\t\t}\n\t\t/* // Ok moodle, you've won just this once. I will try to hack the settingsnav (it has an unexpected behaviour in some moodle instances)\n\t\tif(isset($PAGE->settingsnav) && $node = $PAGE->settingsnav->get('usercurrentsettings', navigation_node::TYPE_CONTAINER)){\n\t\t\t$node->add(get_string('editAccessibilityPreferences', 'local_eu4all'), new moodle_url('/local/eu4all/pages/userpreferencesedit.php', array('id'=>$USER->id)), navigation_node::TYPE_SETTING);\n\t\t}\n\t\t*/\n\t}\n}",
"function mainMenu() \r\n\t\t{\r\n\t\t\tif($this->RequestAction('/external_functions/verifiedAccess/'.$this->Auth->user('id').\"/1/mainMenu\") == true)\r\n\t\t\t{\r\n\t\t\t\t$this->set('title_for_layout', 'Fondos por rendir :: Menu Principal');\r\n\t\t\t\t$this->set('userAdmin', $this->Auth->user('admin'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->Session->setFlash('No tienes permisos para ver esta pagina, consulta con el administrador del sistema.', 'flash_alert');\r\n\t\t\t\t$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));\r\n\t\t\t}\r\n\t\t}",
"function admin_menu() {\n\t\t// Set Admin Access Level\n\t\tif(!$this->options['access_level']): \n\t\t\t$access = 'edit_dashboard';\n\t\telse: \n\t\t\t$access = $this->options['access_level'];\n\t\tendif;\n\t\t\n\t\t// Create Menu Items \n\t\tadd_options_page('Escalate Network', 'Escalate Network', $access, 'escalate-network-options', array($this, 'settings_page'));\n\t}",
"function adminMenu()\n{\n if (function_exists('rstCheckAccessPermissions') && rstCheckAccessPermissions()) {\n // available for Contributors\n $capability = 'edit_posts';\n } else {\n // available only for Administrators\n $capability = 'manage_options';\n }\n // available only for Administrators\n $capability_for_settings = 'manage_options';\n add_menu_page(__('Row Seats', 'menu-test'), __('Row Seats', 'menu-test'), $capability, 'rst-intro', 'rst_intro_page', RSTPLN_URL . 'images/row-seat-ico.png');\n add_submenu_page('rst-intro', __('Row Seats Settings', 'menu-test'), __('Row Seats Settings', 'menu-test'), $capability_for_settings, 'rst-settings', 'rst_settings');\n\tadd_submenu_page('rst-intro', __('Payment Settings', 'menu-test'), __('Payment Settings', 'menu-test'), $capability_for_settings, 'rst-pay-settings', 'rst_pay_settings');\n add_submenu_page('rst-intro', __('Manage Seats', 'menu-test'), __('Manage Seats', 'menu-test'), $capability, 'rst-manage-seats', 'rst_manage_seats');\n\t///add_submenu_page('rst-intro', __('Special Price', 'menu-test'), __('Special Price', 'menu-test'), $capability, 'rst-special-price', 'rst_special_price');\n\tadd_submenu_page('rst-intro', __('Transactions', 'menu-test'), __('Transactions', 'menu-test'), $capability, 'rst-transactions', 'rst_transactions');\n add_submenu_page('rst-intro', __('Add an Event', 'menu-test'), __('Add an Event', 'menu-test'), $capability, 'rst-manage-seats-moncal', 'rst_manage_seats_moncalender');\n\tadd_submenu_page('rst-intro', __('Reports', 'menu-test'), __('Reports', 'menu-test'), $capability, 'rst-reports', 'rst_reports');\n //add_submenu_page('rst-intro', __('Wpuser Access', 'menu-test'), __('Wpuser Access', 'menu-test'), $capability, 'wpuser-access', 'wpuser_access');\n\t//add_submenu_page('rst-intro', __('Seat color', 'menu-test'), __('Seat color', 'menu-test'), $capability, 'seat-color', 'seat_color');\n\t\t//wp_register_script('jscolor.js', plugin_dir_url(__FILE__) . 'js/jscolor/jscolor.js', array('jquery'));\n\t\t//wp_enqueue_script('jscolor.js');\n}",
"public function givePermission($permission);",
"public function givePermission($permission);",
"public function assignPermissions(Request $request)\n {\n $request->validate([\n 'role_id' => 'required',\n 'permissionIds' => 'required'\n ]);\n\n $role = Role::find($request->role_id);\n $role->givePermission($request->permissionIds); \n }",
"public function setLeftSideBarData()\n\t{\n\t\t$this->isLoggedIn();\n\t\t$role_id \t= $this->role_id;\n\n $modules = Permission::\n where('status','active')\n ->where('can_view',1)\n ->where('role_id',$role_id)\n ->with('module')\n ->get()\n ->where('module.status','active')\n ->groupBy('module.parent_id');\n $parent_menu = $modules[0]->sortBy('module.rank')->unique('module.id')->pluck('module');\n\n $sub_menu = $modules->mapToGroups(function ($item, $key) {\n return [$key => $item->pluck('module')->unique('id')];\n });\n\t\t$this->parent_menu = $parent_menu;\n\t\t$this->sub_menu = $sub_menu;\n\t}",
"function nav(array $navLinks, $name = null, array $args = array())\n{\n if ($name !== null) {\n $navLinks = apply_filters($name, $navLinks, $args);\n }\n\n $menu = get_view()->navigation()->menu(new Omeka_Navigation($navLinks));\n\n if ($acl = get_acl()) {\n $menu->setRole(current_user())->setAcl($acl);\n }\n\n return $menu;\n}",
"public function & GetPermissions ();",
"public static function addAccessCapability() {\n foreach (wp_roles()->role_objects as $name => $role) {\n if (in_array($name, static::getAccessibleRoles())) {\n $role->add_cap('admin_access');\n }\n }\n }",
"public function setNavigation(array $menu){\n $this->_navigation = $menu;\n }",
"function side_navigation()\n\t{\n\t\t//side navigation\n\t\t$nav['dashboard'] = array(\n\t\t\t'name' => trans('admin_messages.dashboard'),\n\t\t\t'icon' => 'assessment',\n\t\t\t'has_permission' => true,\n\t\t\t'route' => route('admin.dashboard'),\n\t\t\t'active' => navigation_active('admin.dashboard'),\n\t\t);\n\n\t\t$nav['admin_management'] = array(\n\t\t\t'name' => trans('admin_messages.admin_user_management'),\n\t\t\t'icon' => 'supervised_user_circle',\n\t\t\t'has_permission' => checkPermission('view-admin'),\n\t\t\t'route' => route('admin.view_admin'),\n\t\t\t'active' => navigation_active('admin.view_admin')\n\t\t);\n\n\t\t$nav['role_management'] = array(\n\t\t\t'name' => trans('admin_messages.role_management'),\n\t\t\t'icon' => 'lock',\n\t\t\t'has_permission' => checkPermission('view-role'),\n\t\t\t'route' => route('admin.view_role'),\n\t\t\t'active' => navigation_active('admin.view_role')\n\t\t);\n\n\t\t$nav['user_management'] = array(\n\t\t\t'name' => trans('admin_messages.user_management'),\n\t\t\t'icon' => 'account_circle',\n\t\t\t'has_permission' => checkPermission('view-user'),\n\t\t\t'route' => route('admin.view_user'),\n\t\t\t'active' => navigation_active('admin.view_user')\n\t\t);\n\t\t\n\t\t$nav['driver_management'] = array(\n\t\t\t'name' => trans('admin_messages.driver_management'),\n\t\t\t'icon' => 'drive_eta',\n\t\t\t'has_permission' => checkPermission('view-driver'),\n\t\t\t'route' => route('admin.view_driver'),\n\t\t\t'active' => navigation_active('admin.view_driver')\n\t\t);\n\t\t\n\t\t$nav['home_banner'] = array(\n\t\t\t'name' => trans('admin_messages.home_banner'),\n\t\t\t'icon' => 'merge_type',\n\t\t\t'has_permission' => checkPermission('view-home_banner'),\n\t\t\t'route' => route('admin.home_banner'),\n\t\t\t'active' => navigation_active('admin.home_banner')\n\t\t);\n\t\t\n\t\t$nav['cuisine_management'] = array(\n\t\t\t'name' => trans('admin_messages.cuisine_management'),\n\t\t\t'icon' => 'category',\n\t\t\t'has_permission' => checkPermission('view-category'),\n\t\t\t'route' => route('admin.cuisine'),\n\t\t\t'active' => navigation_active('admin.cuisine')\n\t\t);\n\t\t\n\t\t$nav['restaurant_management'] = array(\n\t\t\t'name' => trans('admin_messages.store_management'),\n\t\t\t'icon' => 'restaurant',\n\t\t\t'has_permission' => checkPermission('view-restaurant'),\n\t\t\t'route' => route('admin.view_restaurant'),\n\t\t\t'active' => navigation_active('admin.view_restaurant')\n\t\t);\n\t\t\n\t\t$nav['send_message'] = array(\n\t\t\t'name' => trans('admin_messages.send_message'),\n\t\t\t'icon' => 'email',\n\t\t\t'has_permission' => checkPermission('manage-send_message'),\n\t\t\t'route' => route('admin.send_message'),\n\t\t\t'active' => navigation_active('admin.send_message')\n\t\t);\n\t\t\n\t\t$nav['order_management'] = array(\n\t\t\t'name' => trans('admin_messages.order_managemnt'),\n\t\t\t'icon' => 'add_shopping_cart',\n\t\t\t'has_permission' => checkPermission('manage-orders'),\n\t\t\t'route' => route('admin.order'),\n\t\t\t'active' => navigation_active('admin.order')\n\t\t);\n\t\t\n\t\t$nav['restaurant_payout_management'] = array(\n\t\t\t'name' => trans('admin_messages.store_payout_management'),\n\t\t\t'icon' => 'euro_symbol',\n\t\t\t'has_permission' => checkPermission('manage-payouts'),\n\t\t\t'route' => route('admin.payout', 1),\n\t\t\t'active' => navigation_active('admin.payout', 1)\n\t\t);\n\t\t\n\t\t$nav['driver_payout_management'] = array(\n\t\t\t'name' => trans('admin_messages.driver_payout_management'),\n\t\t\t'icon' => 'motorcycle',\n\t\t\t'has_permission' => checkPermission('manage-payouts'),\n\t\t\t'route' => route('admin.payout', 2),\n\t\t\t'active' => navigation_active('admin.payout', 2)\n\t\t);\n\t\t\n\t\t$nav['driver_owe_amount'] = array(\n\t\t\t'name' => trans('admin_messages.owe_amount'),\n\t\t\t'icon' => 'attach_money',\n\t\t\t'has_permission' => checkPermission('manage-owe_amount'),\n\t\t\t'route' => route('admin.owe_amount'),\n\t\t\t'active' => navigation_active('admin.owe_amount')\n\t\t);\n\t\t\n\t\t$nav['restaurant_owe_amount'] = array(\n\t\t\t'name' => trans('admin_messages.store_owe_amount'),\n\t\t\t'icon' => 'attach_money',\n\t\t\t'has_permission' => checkPermission('manage-restaurant_owe_amount'),\n\t\t\t'route' => route('admin.restaurant_owe_amount'),\n\t\t\t'active' => navigation_active('admin.restaurant_owe_amount')\n\t\t);\n\n\n\t\t$nav['penality'] = array(\n\t\t\t'name' => trans('admin_messages.penalty'),\n\t\t\t'icon' => 'thumb_down',\n\t\t\t'has_permission' => checkPermission('manage-penality'),\n\t\t\t'route' => route('admin.penality'),\n\t\t\t'active' => navigation_active('admin.penality')\n\t\t);\n\t\t\n\t\t$nav['promo_management'] = array(\n\t\t\t'name' => trans('admin_messages.promo_management'),\n\t\t\t'icon' => 'card_giftcard',\n\t\t\t'has_permission' => checkPermission('view-promo'),\n\t\t\t'route' => route('admin.promo'),\n\t\t\t'active' => navigation_active('admin.promo')\n\t\t);\n\t\t\n\t\t$nav['static_page_management'] = array(\n\t\t\t'name' => trans('admin_messages.static_page_management'),\n\t\t\t'icon' => 'description',\n\t\t\t'has_permission' => checkPermission('view-static_page'),\n\t\t\t'route' => route('admin.static_page'),\n\t\t\t'active' => navigation_active('admin.static_page')\n\t\t);\n\t\t\n\t\t$nav['home_slider'] = array(\n\t\t\t'name' => trans('admin_messages.home_slider'),\n\t\t\t'icon' => 'description',\n\t\t\t'has_permission' => checkPermission('view-restaurant_slider'),\n\t\t\t'route' => route('admin.view_home_slider'),\n\t\t\t'active' => navigation_active('admin.view_home_slider')\n\t\t);\n\t\t\n\t\t$nav['country_management'] = array(\n\t\t\t'name' => trans('admin_messages.country_management'),\n\t\t\t'icon' => 'language',\n\t\t\t'has_permission' => checkPermission('view-country'),\n\t\t\t'route' => route('admin.country'),\n\t\t\t'active' => navigation_active('admin.country')\n\t\t);\n\t\t\n\t\t$nav['currency_management'] = array(\n\t\t\t'name' => trans('admin_messages.currency_management'),\n\t\t\t'icon' => 'euro_symbol',\n\t\t\t'has_permission' => checkPermission('view-currency'),\n\t\t\t'route' => route('admin.currency'),\n\t\t\t'active' => navigation_active('admin.currency')\n\t\t);\n\t\t\n\t\t\n\t\t$nav['language_management'] = array(\n\t\t\t'name' => trans('admin_messages.language_management'),\n\t\t\t'icon' => 'translate',\n\t\t\t'has_permission' => checkPermission('view-language'),\n\t\t\t'route' => route('admin.languages'),\n\t\t\t'active' => navigation_active('admin.languages')\n\t\t);\n\t\t\n\t\t$nav['cancel_reason'] = array(\n\t\t\t'name' => trans('admin_messages.cancel_reason'),\n\t\t\t'icon' => 'cancel',\n\t\t\t'has_permission' => checkPermission('view-cancel_reason'),\n\t\t\t'route' => route('admin.order_cancel_reason'),\n\t\t\t'active' => navigation_active('admin.order_cancel_reason')\n\t\t);\n\t\t\n\t\t$nav['review_issue_type'] = array(\n\t\t\t'name' => trans('admin_messages.review_issue_type'),\n\t\t\t'icon' => 'report_problem',\n\t\t\t'has_permission' => checkPermission('view-review_issue_type'),\n\t\t\t'route' => route('admin.issue_type'),\n\t\t\t'active' => navigation_active('admin.issue_type')\n\t\t);\n\t\t\n\t\t$nav['review_vehicle_type'] = array(\n\t\t\t'name' => trans('admin_messages.manage_vehicle_type'),\n\t\t\t'icon' => 'drive_eta',\n\t\t\t'has_permission' => checkPermission('view-vehicle_type'),\n\t\t\t'route' => route('admin.vehicle_type'),\n\t\t\t'active' => navigation_active('admin.vehicle_type')\n\t\t);\n\t\t\n\t\t$nav['food_receiver'] = array(\n\t\t\t'name' => trans('admin_messages.food_receiver'),\n\t\t\t'icon' => 'receipt',\n\t\t\t'has_permission' => checkPermission('view-recipient'),\n\t\t\t'route' => route('admin.food_receiver'),\n\t\t\t'active' => navigation_active('admin.food_receiver')\n\t\t);\n\t\t\n\t\t$nav['help_category'] = array(\n\t\t\t'name' => trans('admin_messages.help_category'),\n\t\t\t'icon' => 'help',\n\t\t\t'has_permission' => checkPermission('view-help_category'),\n\t\t\t'route' => route('admin.help_category'),\n\t\t\t'active' => navigation_active('admin.help_category')\n\t\t);\n\t\t\n\t\t$nav['help_subcategory'] = array(\n\t\t\t'name' => trans('admin_messages.help_subcategory'),\n\t\t\t'icon' => 'help',\n\t\t\t'has_permission' => checkPermission('view-help_subcategory'),\n\t\t\t'route' => route('admin.help_subcategory'),\n\t\t\t'active' => navigation_active('admin.help_subcategory')\n\t\t);\n\t\t\n\t\t$nav['help'] = array(\n\t\t\t'name' => trans('admin_messages.help'),\n\t\t\t'icon' => 'help',\n\t\t\t'has_permission' => checkPermission('view-help'),\n\t\t\t'route' => route('admin.help'),\n\t\t\t'active' => navigation_active('admin.help')\n\t\t);\n\t\t\n\t\t$nav['site_setting'] = array(\n\t\t\t'name' => trans('admin_messages.site_setting'),\n\t\t\t'icon' => 'settings',\n\t\t\t'has_permission' => checkPermission('manage-site_setting'),\n\t\t\t'route' => route('admin.site_setting'),\n\t\t\t'active' => navigation_active('admin.site_setting')\n\t\t);\n\n\n\t\t$nav['support'] = array(\n\t\t\t'name' => trans('admin_messages.support'),\n\t\t\t'icon' => 'support_agent',\n\t\t\t'has_permission' => checkPermission('view-support'),\n\t\t\t'route' => route('admin.support'),\n\t\t\t'active' => navigation_active('admin.support')\n\t\t);\n\n\t\treturn $nav;\n\t}",
"public function syncPermissions(): void {\n\t\t$FinalPermissions = discover_permissions( false );\n\t\t$RolesExists = Permission::query()->whereIn( 'name', $FinalPermissions )->get();\n\t\tif ( $RolesExists->count() > 0 ) {\n\t\t\t$FinalPermissionsCollection = collect( $FinalPermissions )->filter( static function ( $item ) use ( $RolesExists ) {\n\t\t\t\treturn ! $RolesExists->contains( 'name', '=', $item );\n\t\t\t} );\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissionsCollection as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tif ( ! empty( $CreateRoles ) ) {\n\t\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t\t}\n\t\t} else {\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissions as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t}\n\t}",
"function page_nav() {\n global $user;\n global $xtpl;\n \n $xtpl->assign('nav_base', trim(simpleid_url(' ', '', true)));\n \n if ($user != NULL) {\n if (isset($user['administrator']) && ($user['administrator'] == 1)) $xtpl->parse('main.nav.nav_admin');\n \n }\n $xtpl->parse('main.nav');\n}",
"public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'userprofile' => [\n 'label' => 'userprofile',\n 'url' => Backend::url('stepanozhigov/userprofile/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['stepanozhigov.userprofile.*'],\n 'order' => 500,\n ],\n ];\n }",
"function initialize_forge_management_permissions()\n {\n //ROLES\n $manageForge = role_first_or_create('manage-forge');\n $student = role_first_or_create('student');\n $teacher = role_first_or_create('teacher');\n\n initialize_groups_management_permissions();\n give_permission_to_role($teacher, 'list-groups');\n give_permission_to_role($teacher, 'list-groups');\n give_permission_to_role($teacher, 'list-groups');\n\n //ASSIGNMENT\n permission_first_or_create('show-assignment');\n give_permission_to_role($teacher, 'show-assignment');\n permission_first_or_create('list-assignment');\n give_permission_to_role($teacher, 'list-assignment');\n permission_first_or_create('store-assignment');\n give_permission_to_role($teacher, 'store-assignment');\n permission_first_or_create('update-assignment');\n give_permission_to_role($teacher, 'update-assignment');\n permission_first_or_create('destroy-assignment');\n give_permission_to_role($teacher, 'destroy-assignment');\n permission_first_or_create('assign-users-to-assignments');\n give_permission_to_role($teacher, 'assign-users-to-assignments');\n permission_first_or_create('assign-groups-to-assignments');\n give_permission_to_role($teacher, 'assign-groups-to-assignments');\n\n //MANAGE FORGE ROLE\n permission_first_or_create('list-user-servers');\n permission_first_or_create('store-user-servers');\n permission_first_or_create('ask-server-permissions');\n permission_first_or_create('validate-server-permissions');\n permission_first_or_create('create-server-sites');\n permission_first_or_create('install-git-repositories');\n permission_first_or_create('install-ssh-keys');\n permission_first_or_create('enable-auto-deploy');\n permission_first_or_create('disable-auto-deploy');\n permission_first_or_create('obtain-lets-encrypt-certificate');\n permission_first_or_create('activate-certificate');\n permission_first_or_create('list-certificates');\n permission_first_or_create('deploy-site');\n permission_first_or_create('list-mysql');\n permission_first_or_create('show-mysql');\n permission_first_or_create('create-mysql');\n permission_first_or_create('list-mysql-users');\n permission_first_or_create('show-mysql-user');\n permission_first_or_create('create-mysql-user');\n\n permission_first_or_create('show-deployment-script');\n permission_first_or_create('update-deployment-script');\n\n\n give_permission_to_role($manageForge, 'list-user-servers');\n give_permission_to_role($manageForge, 'store-user-servers');\n give_permission_to_role($manageForge, 'ask-server-permissions');\n give_permission_to_role($manageForge, 'validate-server-permissions');\n give_permission_to_role($manageForge, 'create-server-sites');\n give_permission_to_role($manageForge, 'install-git-repositories');\n give_permission_to_role($manageForge, 'install-ssh-keys');\n give_permission_to_role($manageForge, 'enable-auto-deploy');\n give_permission_to_role($manageForge, 'disable-auto-deploy');\n give_permission_to_role($manageForge, 'obtain-lets-encrypt-certificate');\n give_permission_to_role($manageForge, 'activate-certificate');\n give_permission_to_role($manageForge, 'list-certificates');\n give_permission_to_role($manageForge, 'deploy-site');\n give_permission_to_role($manageForge, 'list-mysql');\n give_permission_to_role($manageForge, 'show-mysql');\n give_permission_to_role($manageForge, 'create-mysql');\n give_permission_to_role($manageForge, 'list-mysql-users');\n give_permission_to_role($manageForge, 'show-mysql-user');\n give_permission_to_role($manageForge, 'create-mysql-user');\n\n give_permission_to_role($manageForge, 'show-deployment-script');\n give_permission_to_role($manageForge, 'update-deployment-script');\n\n\n //STUDENT ROLE\n permission_first_or_create('todo');\n give_permission_to_role($student, 'todo');\n\n app(PermissionRegistrar::class)->registerPermissions();\n }",
"public function permission()\n {\n if ( ! auth()->guard('admin')->user()->can('access permission ' . $this->table)) {\n return redirect()->route('admin.setting.index')->with('alert-danger', __($this->noPermission));\n }\n $view = [\n 'back' => route('admin.setting.index'),\n 'title' => __('Permission Settings'),\n 'breadcrumbs' => [\n route('admin.setting.index') => __('Setting'),\n route('admin.setting.permission.index') => __('Permission'),\n null => __('Edit')\n ],\n 'subtitle' => __('All About Permission Settings'),\n 'description' => __('You can adjust all permission settings here'),\n 'navs' => $this->settings,\n 'setting' => $this->settings->where('slug', 'permission')->first(),\n 'roles' => Role::orderBy('name', 'asc')->pluck('name', 'id')->toArray()\n ];\n return view('admin.setting.permission.index', $view);\n }",
"public function authorize()\n {\n return auth()->user()->ability('admin','update_pages');\n }",
"public function run()\n {\n Permission::insert(config('permissions', true));\n }",
"private function setOther() {\n if (Request::has(\"include-other-read\") && Request::input(\"include-other-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-other-write\") && Request::input(\"include-other-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-other-execute\") && Request::input(\"include-other-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }",
"public function adminPermisionListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t $_SESSION['pid']\t=\t$_GET['id'];\n\t\t\t\t \n\t\t\t}",
"public function initAdminNavigation()\n {\n $naviPath = APPLICATION_PATH . '/../modules/mazelab/storage/configs/navigation/admin.ini';\n if (file_exists($naviPath)) {\n $view = Zend_Layout::getMvcInstance()->getView();\n $view->navigation()->getContainer()->findBy('resource', 'dashboard')\n ->addPages(new Zend_Config_Ini($naviPath));\n }\n }",
"function setPrivileges() {\n $this->Session->write('Privilege.User.id', $this->Session->read('Auth.User.id'));\n foreach(Configure::read('Privilege') as $entity => $privileges) {\n foreach($privileges as $key => $privilege) {\n $key = \"Club.\".Configure::read('Club.id').\".Privilege.$entity.$key\";\n $this->Session->write($key, $this->isAuthorized($privilege));\n }\n }\n }",
"public function testCreatePermissionSet()\n {\n }",
"public function seta_permissoes()\n\t{\n\t\tif(!$this->auth->esta_autenticado())\n\t\t{\n\t\t\tredirect(URL_PREFIX, 'location');\n\t\t}else{\n\t\t\t$n_cod_user = $this->input->post('n_cod_user');\n\t\t\t$local = $this->input->post('local');\n\t\t\t$sessao = $this->input->post('sessao');\n\t\t\t$acao = $this->input->post('acao');\n\n\t\t\t$matriz = array('n_cod_user' => $n_cod_user,\n\t\t\t\t\t\t\t'c_sessao' => $local,\n\t\t\t\t\t\t\t'c_subsessao' => $sessao,\n\t\t\t\t\t\t\t'c_acao' => $acao);\n\t\t\t$valida = $this->gph_crud->buscar(DB_PREFIX.'permissoes', 'sql', $matriz);\n\t\t\tif($valida->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$this->gph_crud->excluir(DB_PREFIX.'permissoes', $matriz);\n\t\t\t\techo '<img src=\"'.base_url('sites/admin/_images/botoes/auto_off.jpg').'\" width=\"66\" height=\"28\" />';\n\t\t\t}else{\n\t\t\t\t$this->gph_crud->adiciona(DB_PREFIX.'permissoes', $matriz);\n\t\t\t\techo '<img src=\"'.base_url('sites/admin/_images/botoes/auto_on.jpg').'\" width=\"66\" height=\"28\" />';\n\t\t\t}\n\t\t}\n\t}",
"public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'profile' => [\n 'label' => 'Profile',\n 'url' => Backend::url('avirdigital/profile/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['avirdigital.profile.*'],\n 'order' => 500,\n ],\n ];\n }",
"public function registerMenuOptions()\n {\n if (Auth::user()->hasPermission('property_category.index')) {\n Menu::registerMenuOptions(Category::class, trans('plugins/real-estate::category.menu'));\n }\n }",
"public function authorize()\n {\n return access()->allow('edit-settings');\n }",
"function hook_roomify_rights_alter(&$permissions) {\n // Remove permission 'access content' for anonymous users.\n unset($permissions['anonymous user']['access content']);\n}",
"function require_permission($required)\n{\n require_login();\n\n // owners have full access\n if ($_SESSION['permission'] == OWN) {\n return;\n }\n\n if ($required != $_SESSION['permission']) {\n redirect_to(url_for(\"/index.php\"));\n }\n}",
"public function appendNavigation(){\n\t\t\t$nav = $this->getNavigationArray();\n\n\t\t\t/**\n\t\t\t * Immediately before displaying the admin navigation. Provided with the\n\t\t\t * navigation array. Manipulating it will alter the navigation for all pages.\n\t\t\t *\n\t\t\t * @delegate NavigationPreRender\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $nav\n\t\t\t * An associative array of the current navigation, passed by reference\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('NavigationPreRender', '/backend/', array('navigation' => &$nav));\n\n\t\t\t$xNav = new XMLElement('ul');\n\t\t\t$xNav->setAttribute('id', 'nav');\n\n\t\t\tforeach($nav as $n){\n\t\t\t\tif($n['visible'] == 'no') continue;\n\n\t\t\t\t$can_access = false;\n\n\t\t\t\tif(!isset($n['limit']) || $n['limit'] == 'author')\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\tif($can_access) {\n\t\t\t\t\t$xGroup = new XMLElement('li', $n['name']);\n\t\t\t\t\tif(isset($n['class']) && trim($n['name']) != '') $xGroup->setAttribute('class', $n['class']);\n\n\t\t\t\t\t$hasChildren = false;\n\t\t\t\t\t$xChildren = new XMLElement('ul');\n\n\t\t\t\t\tif(is_array($n['children']) && !empty($n['children'])){\n\t\t\t\t\t\tforeach($n['children'] as $c){\n\t\t\t\t\t\t\tif($c['visible'] == 'no') continue;\n\n\t\t\t\t\t\t\t$can_access_child = false;\n\n\t\t\t\t\t\t\tif(!isset($c['limit']) || $c['limit'] == 'author')\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\tif($can_access_child) {\n\t\t\t\t\t\t\t\t$xChild = new XMLElement('li');\n\t\t\t\t\t\t\t\t$xChild->appendChild(\n\t\t\t\t\t\t\t\t\tWidget::Anchor($c['name'], SYMPHONY_URL . $c['link'])\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$xChildren->appendChild($xChild);\n\t\t\t\t\t\t\t\t$hasChildren = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($hasChildren){\n\t\t\t\t\t\t\t$xGroup->appendChild($xChildren);\n\t\t\t\t\t\t\t$xNav->appendChild($xGroup);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->Header->appendChild($xNav);\n\t\t\tAdministration::instance()->Profiler->sample('Navigation Built', PROFILE_LAP);\n\t\t}",
"public function updatePermissions()\n {\n if(! array_key_exists( 'permissions', $this->options['paths'] )) {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/permissions.blade.php';\n $target = base_path($this->options['paths']['permissions']);\n $hook = '<!-- bread_permissions -->';\n $this->updateFileContent($target, $hook, $file);\n }",
"public function testAllPermissions()\n {\n }"
] | [
"0.6807484",
"0.6671099",
"0.6471941",
"0.64572895",
"0.6446978",
"0.63454884",
"0.63454884",
"0.63454884",
"0.63454884",
"0.63454884",
"0.6305774",
"0.6247079",
"0.61264205",
"0.60874796",
"0.6045589",
"0.60247946",
"0.6024683",
"0.60105395",
"0.59882087",
"0.5925689",
"0.591191",
"0.5904632",
"0.589942",
"0.5897245",
"0.58935577",
"0.58754",
"0.5863378",
"0.5862707",
"0.58572626",
"0.5855764",
"0.58338845",
"0.58178127",
"0.5805386",
"0.5800893",
"0.5794464",
"0.57885003",
"0.5760662",
"0.5756612",
"0.57565725",
"0.5722759",
"0.57071865",
"0.5706477",
"0.5683018",
"0.56823975",
"0.56799144",
"0.5663294",
"0.5660804",
"0.56562877",
"0.5650123",
"0.5644821",
"0.5625882",
"0.561932",
"0.56069404",
"0.559159",
"0.55763286",
"0.5554975",
"0.5548326",
"0.5525824",
"0.5523595",
"0.55020535",
"0.5501254",
"0.54971886",
"0.54930395",
"0.54860467",
"0.54815125",
"0.54784304",
"0.54750764",
"0.5474851",
"0.5474432",
"0.54715055",
"0.54561496",
"0.54561496",
"0.5454915",
"0.5447774",
"0.5445878",
"0.54433435",
"0.54348004",
"0.54235697",
"0.54193527",
"0.5410698",
"0.5410528",
"0.5398591",
"0.5385396",
"0.5381001",
"0.53807396",
"0.53789634",
"0.53766686",
"0.53696",
"0.5367903",
"0.5367067",
"0.53615767",
"0.5361292",
"0.5360849",
"0.5359717",
"0.5355498",
"0.53544575",
"0.53482026",
"0.53478646",
"0.53447723",
"0.53396773"
] | 0.5856186 | 29 |
determine if the menu is a drop down | public function isDropdown()
{
return $this->dropdown;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"function hasDropDown() ;",
"function is_nav_menu($menu)\n {\n }",
"public function has_menu()\r\n {\r\n return false;\r\n }",
"public function isMenu()\n {\n // todo: it might be better to move this method to trait.\n return false;\n }",
"public function IsMenu() {\n\t\treturn $this -> _mIsMenu;\n\t}",
"private function checkMenu()\n {\n\n }",
"public static function canDisplayLeadTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_LEAD_TYPE);\n\t}",
"public static function canDisplaySuburbsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_SUBURB);\n\t}",
"protected function hasParentMenuItem() {}",
"function _is_valid_nav_menu_item($item)\n {\n }",
"public function isMenu($label) {\r\n\t\tglobal $WT_TREE;\r\n\t\t$module = Module::getModuleByName($label);\r\n\t\tif (in_array($module, Module::getActiveMenus($WT_TREE))) {\r\n\t\t\tif ($module->getMenu()) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"function is_nav_menu_item($menu_item_id = 0)\n {\n }",
"public function is_select()\r\n {\r\n return strpos($this->type, 'select') !== false;\r\n }",
"public static function canDisplayTransactionTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_TRANSACTION_TYPE);\n\t}",
"function _gwt_drupal_has_sub_menu($below_menu = array()){\n if(empty($below_menu)){\n return false;\n }\n\n foreach($below_menu as $key => $link_full){\n if($link_full['link']['hidden']){\n unset($below_menu[$key]);\n }\n }\n\n $has_item = !empty($below_menu);\n return $has_item;\n}",
"public function isOpen() {\n $form = $this->Html->peek();\n return isset($form) and ($form instanceof Field or\n array_search($form->tag, array('form', 'select', 'optgroup')) !== false);\n }",
"protected function hasParentMenuItemKey() {}",
"public function isNavbarMegamenu()\r\n\t{\r\n\t\treturn $this->navbarMegamenu;\r\n\t}",
"public function showInMenu()\n {\n $ctrs = PageCom::ctrs();\n return $ctrs && (count($ctrs) > 1);\n }",
"public function isMenuValidValidMenuWithDefaultsExpectTrue() {}",
"public function getDropDown() {}",
"public function getDropDown() {}",
"function getDropDown() ;",
"public function handle_sub_menu( $is_visible, $menu_id ) {\n\t\tif ( $menu_id == 'account' ) {\n\t\t\t$is_visible = false;\n\t\t}\n\n\t\treturn $is_visible;\n\t}",
"function has_nav_menu($location)\n {\n }",
"public function displayMenu($menu = 'show_sidebar_menu')\n\t{\n\t\t$option = get_option('social_curator_admin_menu');\n\t\treturn ( isset($option[$menu]) && $option[$menu] == '1' ) ? true : false;\n\t}",
"private function showAdminMenu() : bool\n {\n return \\apply_filters(self::FILTER_SHOW_ADMIN_MENU, true) === true;\n }",
"public function hasMenuActiveItem()\n {\n return $this->activeItem !== null;\n }",
"public static function canDisplayDocumentTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_DOCUMENT_TYPE);\n\t}",
"protected function hasParentMenuArr() {}",
"public function hasMenu(){\n return $this->_has(10);\n }",
"public static function canDisplayContractorTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_CONTRACTOR_TYPE);\n\t}",
"public function isNavbarLangmenu()\r\n\t{\r\n\t\treturn $this->navbarLangmenu;\r\n\t}",
"public static function canDisplayBanksMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_BANK);\n\t}",
"function render_submenu($arrMenu) {\n if (!empty($arrMenu)) {\n foreach ($arrMenu as $key => $menuobj) {\n $path = trim($menuobj['path'], \"/\");\n if (PageAccessManager::GetPageAccess($path) == 'AUTHORIZED') {\n ?>\n <b-dropdown-item to=\"/<?php echo($path); ?>\">\n <?php echo (!empty($menuobj['icon']) ? $menuobj['icon'] : null); ?> \n <?php echo $menuobj['label']; ?>\n <?php\n if (!empty($menuobj['submenu'])) {\n render_menu($menuobj['submenu']);\n }\n ?>\n </b-dropdown-item>\n <?php\n }\n }\n }\n}",
"public function isMenuItemValidOmittedTitleExpectFalse() {}",
"function getPlaceInMenu () {return $this->getFieldValue ('place_in_menu');}",
"public static function canDisplayEstateAgentTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ESTATE_AGENT_TYPE);\n\t}",
"public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}",
"protected function viewMenu(){\n\t\t$userStatus = $_SESSION[\"user_status\"];\n\t\t\n\t\t// menus\n\t\t$menu = false;\n\t\tif ($userStatus > 2){\n\t\t\t$menu = true;\n\t\t}\n\t\treturn $menu;\n\t}",
"function wp_nav_menu_disabled_check($nav_menu_selected_id, $display = \\true)\n {\n }",
"private function showAdminMenuBar() : bool\n {\n return \\apply_filters(self::FILTER_SHOW_ADMIN_BAR_MENU, \\is_admin_bar_showing()) === true;\n }",
"public static function canDisplayPropertyTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PROPERTY_TYPE);\n\t}",
"public static function canDisplayAttorneysMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY);\n\t}",
"public static function canDisplayAttorneyTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY_TYPE);\n\t}",
"public function hasMenuid(){\n return $this->_has(18);\n }",
"public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}",
"public function isMenu() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\t\n\t\tApp::import(\"Model\", \"Usermgmt.UserGroupPermission\"); \n\t\t$model = new UserGroupPermission(); \n\t\t$dados = $model->find(\"all\", array(\n\t\t\t'conditions'=>array('UserGroupPermission.user_group_id'=>$groupId,'UserGroupPermission.allowed'=>1),\n\t\t\t'fields' => array('UserGroupPermission.controller', 'UserGroupPermission.action')\n\t\t)); \n\t\t\n\t\treturn $dados;\n\t}",
"public static function canDisplayMilestoneTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_MILESTONE_TYPE);\n\t}",
"public function getHasMenuItem() {\n\t\treturn $this->hasMenuItem;\n\t}",
"public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}",
"public function getIsMenuLinkEnabled(): bool;",
"function gencwooc_gsm_subnav_type( $nav ) {\n\treturn 'nav-menu';\n}",
"public function getDropdownCssClass()\r\n\t{\r\n\t\treturn 'dropdown-submenu';\r\n\t}",
"function classGroupMenu($menu, $group)\r\n{\r\n echo isset($menu[0]) && ($menu[0] == $group) ? \"menu-open\" : \"\";\r\n}",
"function currSelection()\n{\n\tif(isset($_GET['p_drop']))\n\t\techo \"Municipality\";\n\telse if(isset($_GET['o_drop']))\n\t\techo \"District\";\n\telse if(isset($_GET['m_drop']))\n\t\techo \"Township\";\n\telse\n\t\techo \"Province\";\n}",
"public function isNavbarSectionmenu()\r\n\t{\r\n\t\treturn $this->navbarSectionmenu;\r\n\t}",
"function power_do_subnav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'secondary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-secondary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'secondary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}",
"function dropdown_menu($p_title, $p_items, $p_color = '', $p_icon = '', $p_class = ''){\n\t$t_padding_button = '0px';\n\t$t_padding_icon_left = '0px';\n\t$t_padding_icon_right = '10px';\n\n\tif($p_color == ''){\n\t\t$t_padding_button = '10px';\n\t\t$t_padding_icon_left = '5px';\n\t\t$t_padding_icon_right = '5px';\n\t}\n\n\t# button group and navigation bar header\n\techo '<div class=\"btn-group\">';\n\techo '<ul class=\"nav ace-nav\" style=\"padding-left:'. $t_padding_button . ';padding-right:' . $t_padding_button . '\">';\n\n\t# color\n\tif($p_color != '')\n\t\techo '<li class=\"' . $p_color . '\">';\n\n\techo '<a data-toggle=\"dropdown\" href=\"#\" class=\"dropdown-toggle\">';\n\n\t# title icon\n\tif($p_icon != '')\n\t\techo '<i class=\"ace-icon fa ' . $p_icon . '\" style=\"padding-right:' . $t_padding_icon_right . '\"></i>';\n\n\t# title\n\techo $p_title . '<i class=\"ace-icon ' . $p_color . ' fa fa-angle-down\" style=\"padding-left:' . $t_padding_icon_left . '\"></i>';\n\techo '</a>';\n\n\t# menu items\n\techo '<ul class=\"dropdown-menu scrollable-menu ' . $p_class . '\">';\n\n\tforeach($p_items as $t_item){\n\t\t$t_label = $t_item['label'];\n\t\t$t_data = $t_item['data'];\n\n\t\tif($t_label == 'header'){\n\t\t\techo '<li class=\"dropdown-header\">' . $t_data . '</li>';\n\t\t}\n\t\telse if($t_label == 'divider'){\n\t\t\techo '<li class=\"divider\"/>';\n\t\t}\n\t\telse if($t_label == 'bare'){\n\t\t\techo $t_data;\n\t\t}\n\t\telse{\n\t\t\t$t_class = '';\n\n\t\t\tif(isset($t_data['class']))\n\t\t\t\t$t_class = 'class=\"' . $t_data['class'] . '\"';\n\n\t\t\techo '<li><a ' . $t_class . ' href=\"' . $t_data['link'] . '\">';\n\n\t\t\tif(isset($t_data['icon']) && $t_data['icon'] != '')\n\t\t\t\techo '<i class=\"ace-icon fa ' . $t_data['icon'] . '\" style=\"padding-right:5px\"></i>';\n\t\t\t\t\n\t\t\techo $t_label;\n\t\t\techo '</a></li>';\n\t\t}\n\t}\n\n\techo '</ul>';\n\n\tif($p_color)\n\t\techo '</li>';\n\n\techo '</ul>';\n\techo '</div>';\n}",
"public function menuIsReal($title_menu)\n\t{\n\t\t$out = false;\n\t\n\t\t$sql = \"SELECT\n\t\t\t\t\t`link_id`\n\t\t\t\tFROM\n\t\t\t\t\t`menu`\n\t\t\t\tWHERE\n\t\t\t\t\t`title_menu` = ?\n\t\t\t\t\";\n\t\t\t\t\n\t\t$stmt = $this->db->prepare($sql);\n\t\t$stmt->bind_param('s',$title_menu);\n\t\t$stmt->bind_result($link_id);\n\t\t$stmt->execute();\n\t\tif($stmt->fetch())\n\t\t{\n\t\t\t$out = true;\n\t\t} \n\t\t$stmt->close();\n\t\t\n\t\treturn $out;\n\t}",
"function bwsocial_maybe_has_menu( $args ) {\n\t\n\t// Check theme location\n\t$location = isset( $args[ 'theme_location' ] ) ? $args[ 'theme_location' ] : false;\n\tif ( $location && 'bw-social' === $location ) {\n\t\treturn true;\n\t}\n\t\n\t// Check Menu\n\t$menu = isset( $args[ 'menu' ] ) ? $args[ 'menu' ] : false;\n\tif ( ! $menu ) {\n\t\treturn false;\n\t}\n\t\n\t// Get menu object\n\t$menu_object = wp_get_nav_menu_object( $menu );\n\tif ( $menu_object && is_a( $menu_object, 'WP_Term' ) ) {\n\t\t$menu_locations = get_nav_menu_locations();\n\t\tforeach( $menu_locations as $menu_location => $menu_term_id ) {\n\t\t\tif ( 'bw-social' === $menu_location && $menu_term_id === $menu_object->term_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false;\n}",
"public function isDropTarget() {}",
"public function getParentMenuItem() {}",
"public function isOptions(): bool {}",
"public function getMenu();",
"public function getMenuWithDropDownWrapper($item)\n {\n }",
"public function option_menu()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n global $bmlt_localization;\n \n $this->adapt_to_lang($bmlt_localization);\n if (function_exists('add_options_page') && (self::get_plugin_object() instanceof BMLTPlugin)) {\n $options_title = $this->my_current_language->local_options_title;\n $menu_string = $this->my_current_language->local_menu_string;\n \n add_options_page($options_title, $menu_string, 9, basename(__FILE__), array ( self::get_plugin_object(), 'admin_page' ));\n } elseif (!function_exists('add_options_page')) {\n echo \"<!-- BMLTPlugin ERROR (option_menu)! No add_options_page()! -->\";\n } else {\n echo \"<!-- BMLTPlugin ERROR (option_menu)! No BMLTPlugin Object! -->\";\n }\n }",
"function getMenu()\n {\n return $this->getAttribute(\"menu\");\n }",
"public static function locationHasMenu(string $name)\n\t{\n\t\treturn has_nav_menu($name);\n\t\treturn call_user_func(self::FUNCTION_HAS_NAV_MENU, $name);\n\t}",
"public static function canDisplayAccountsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ACCOUNT);\n\t}",
"public function admin_head(){\r\n global $submenu;\r\n \r\n if(isset( $submenu[self::menu_tag] ) \r\n &&isset($submenu[self::menu_tag][0])\r\n &&isset($submenu[self::menu_tag][0][2])\r\n &&$submenu[self::menu_tag][0][2]==self::menu_tag){\r\n \r\n unset( $submenu[self::menu_tag][0] );\r\n }\r\n }",
"public function dropdown_level()\n {\n //Menyusun value pada dropdown\n $value[''] = '--CHOOSE--';\n $value['Admin'] = 'Admin';\n $value['Technician'] = 'Technician';\n $value['User'] = 'User';\n\n return $value;\n }",
"protected function formats_dropdown($post_type)\n {\n }",
"public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}",
"public function getContextMenuType() {}",
"function selected_droplist($a1,$a2){\n\tif($a1==$a2){\n\t\treturn 'Selected';\n\t}else{\n\t\treturn 0;\n\t}\n}",
"function menu_fallback(){ ?>\n\t\t\t<div id=\"menu\">\n\t\t\t\t<ul>\n\t\t\t\t\t<li> <?php _e( 'Go to Admin > Appearance > Menus, to create your menu.', 'basetheme_td' ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t<?php\n\t\t}",
"function bp_nav_item_has_subnav( $nav_item = '' ) {\n\tglobal $bp;\n\n\tif ( !$nav_item )\n\t\t$nav_item = bp_current_component();\n\n\t$has_subnav = isset( $bp->bp_options_nav[$nav_item] ) && count( $bp->bp_options_nav[$nav_item] ) > 0;\n\n\treturn apply_filters( 'bp_nav_item_has_subnav', $has_subnav, $nav_item );\n}",
"function checkNavGebruiker($conn){\n\n $id_medewerker = $_SESSION['id_medewerker'];\n\n if ($id_medewerker == 1){\n echo \"<li><a class='dropdown-item' href='./pages/instellingen.php'>Instellingen</a></li>\";\n }\n\n if ($id_medewerker){\n echo \"<li><a class='dropdown-item' href='./pages/reservering_medewerker.php'>Reservering </a></li>\";\n echo \"<li><a class='dropdown-item' href='./pages/voertuigen.php'>Voertuigen</a></li>\";\n }\n\n else if ($id_medewerker && $_SESSION['id_medewerker'] !== 1){\n echo \"\";\n }\n}",
"public function getMenu($instance=false){\n if ($instance && !is_object($this->_data['menu'])){\n $this->setMenu('',array('required'=>false));\n }\n return $this->_data['menu'];\n }",
"public function getMenuVisible(): ?bool {\n return $this->menuVisible;\n }",
"public static function canDisplayRolesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ROLE);\n\t}",
"function DependantDropdown(){\r\n }",
"public function menu_dropdown($id){\n\t\t$q = $this->db->query('\n\t\t\tSELECT * FROM tb_menu,tb_content \n\t\t\tWHERE tb_menu.id_menu = tb_content.id_menu \n\t\t\tAND tb_content.id_content = '.$id\n\t\t);\n\t\treturn $q->result();\n\t}",
"function beginSubMenu() {\n\t\treturn html_ao('ul', array('class' => 'submenu'));\n\t}",
"function flexfour_submenu_add_dropdown($text){\n $replace = array(\n //List of menu item classes that should be changed to \"active\"\n \n\t\t\t\t'sub-menu' =>'dropdown',\n );\n $text = str_replace(array_keys($replace), $replace, $text);\n return $text;\n }",
"function showMenu()\n {\n $menu = config('app.menu') ;\n\n $text = '' ;\n \n\n foreach ($menu as $name => $item)\n {\n $active = false ;\n \n if(isset($item['dropdown']))\n {\n $text .= '<li class=\"dropdown menu-'. $name .'\">' . PHP_EOL ;\n $text .= '<a href=\"javascript:;\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"> '. PHP_EOL;\n }\n else \n {\n $text .= '<li class=\"menu-'. $name .'\">' . PHP_EOL ;\n $text .= '<a href=\"'.(isset($item['action']) ? route($item['action']) : '' ).'\">' . PHP_EOL;\n }\n\n $text .= '<i class=\"'. $item['icon'] .'\"></i>'. PHP_EOL;\n $text .= '<span>'. $item['title'] .'</span>'. PHP_EOL;\n \n if(isset($item['dropdown']))\n {\n $text .= '<b class=\"caret\"></b>';\n $text .= '</a>'. PHP_EOL;\n $text .= '<ul class=\"dropdown-menu\">' ;\n foreach ($item['dropdown'] as $subName => $subItem) \n {\n $text .= '<li>' . PHP_EOL ;\n $text .= '<a href=\"'.(isset($subItem['action']) ? route($subItem['action']) : '' ).'\">' . PHP_EOL;\n $text .= '<span>'. $subItem['title'] .'</span>'. PHP_EOL;\n $text .= '</a>'. PHP_EOL; \n $text .= '</li>'. PHP_EOL;\n\n $active = (!$active && isset($subItem['action'])) \n ? $subItem['action'] == Request::route()->getName() : $active ; \n }\n $text .= '</ul>' ;\n }\n else \n {\n $text .= '</a>'. PHP_EOL;\n $active = (!$active && isset($item['action'])) \n ? $item['action'] == Request::route()->getName() : $active ;\n }\n\n $text .= '</li>'. PHP_EOL;\n\n if($active)\n {\n $text = str_replace('menu-'. $name , 'active', $text);\n }\n }\n\n return $text ;\n }",
"public static function canDisplayTitlesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_TITLE);\n\t}",
"public static function canDisplayAuditTrailMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AUDIT_TRAIL);\n\t}",
"public function getHasMenuSection() {\n\t\treturn $this->hasMenuSection;\n\t}",
"public function viewMenu()\n {\n $data = $this->getPublisher()->getPagination()['view_menu'];\n $button_label = $data['label_view_as'].' '.$data['views'][$data['selected']]['display'];\n\n $html = \"\\n <li class=\\\"dropdown\\\">\";\n\n $html .= \"\\n <a href=\\\"\\\" class=\\\"dropdown-toggle\\\" role=\\\"button\\\" id=\\\"viewMenu\".\n \"\\\" data-toggle=\\\"dropdown\\\" aria-haspopup=\\\"true\\\" aria-expanded=\\\"true\\\">\".\n $button_label.\" <span class=\\\"caret\\\"></span></button>\";\n\n $html .= \"\\n <ul class=\\\"dropdown-menu\\\" aria-labelledby=\\\"viewMenu\\\">\";\n\n\n foreach ($data['views'] as $name => $view) {\n $html .= \"\\n \".($name == $data['selected'] ? \"<li class=\\\"disabled\\\">\" : \"<li>\").\n \"<a href=\\\"\".($name == $data['selected'] ? \"#\" : $view['url']).\"\\\">\".$view['display'].' ('.$view['limit'].')'.\"</a></li>\";\n }\n\n\n $html .= \"\\n </ul>\\n </li>\\n\";\n\n return $html;\n }"
] | [
"0.7517986",
"0.7517986",
"0.7517402",
"0.7517402",
"0.7517402",
"0.75169575",
"0.75169575",
"0.75169575",
"0.75169575",
"0.74934447",
"0.6695153",
"0.6656782",
"0.66252035",
"0.66081226",
"0.6338886",
"0.628152",
"0.621831",
"0.62165284",
"0.6094535",
"0.6076582",
"0.5982561",
"0.59356683",
"0.5907826",
"0.5899312",
"0.58167195",
"0.57826555",
"0.5722479",
"0.5712643",
"0.5696814",
"0.56943345",
"0.56943345",
"0.5642759",
"0.5630155",
"0.5624971",
"0.56215143",
"0.55954385",
"0.5586196",
"0.5559058",
"0.5529202",
"0.5504811",
"0.55016625",
"0.548425",
"0.54672205",
"0.54432994",
"0.5432821",
"0.5431963",
"0.54298985",
"0.5418054",
"0.5410664",
"0.53897256",
"0.5367874",
"0.5367129",
"0.5345653",
"0.53444666",
"0.5335441",
"0.5322615",
"0.5319014",
"0.53183955",
"0.53153735",
"0.52964264",
"0.5275806",
"0.5269445",
"0.5257412",
"0.5233587",
"0.5216409",
"0.52144086",
"0.5192255",
"0.51860493",
"0.5167549",
"0.51640534",
"0.51613516",
"0.514635",
"0.5144516",
"0.51421756",
"0.51376855",
"0.51374495",
"0.5126886",
"0.5122215",
"0.51091456",
"0.51056737",
"0.51009697",
"0.51008993",
"0.5097009",
"0.5092941",
"0.5087151",
"0.5072867",
"0.5069135",
"0.5058702",
"0.50570875",
"0.50491744",
"0.5048499",
"0.50431156",
"0.50422627",
"0.50394917",
"0.5038307",
"0.50359964",
"0.5035329",
"0.5032183",
"0.5027739",
"0.5016579"
] | 0.74125695 | 10 |
the label of the menu | public function getLabel()
{
return $this->label;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function menu_label()\n\t{\n\t\t$label = $this->p('menu_label')->text();\n\t\t$label = $this->render($label);\n\n\t\tif ( ! $label && $p = $this->p('title') ) {\n\t\t\t$label = $p->text();\n\t\t}\n\n\t\tif ( ! $label && $p = $this->p('name') ) {\n\t\t\t$label = $p->text();\n\t\t}\n\n\t\treturn $label;\n\t}",
"public static function label()\n {\n return __('Menus');\n }",
"public function getMenuLabel(): ?string;",
"public function get_label();",
"public function get_label();",
"function getMenuTitle();",
"function glass_change_post_menu_label() {\n\tglobal $menu;\n\tglobal $submenu;\n\t$menu[5][0] = 'News';\n\t$submenu['edit.php'][5][0] = 'News';\n\t$submenu['edit.php'][10][0] = 'Add News';\n\t$submenu['edit.php'][16][0] = 'News Tags';\n\techo '';\n}",
"public function MenuTitle() {\n\t\treturn $this->Name();\n\t}",
"public static function singularLabel()\n {\n return __('Menu');\n }",
"public function getName()\n {\n return \"menu\";\n }",
"public function get_menu_label() {\n\t\treturn __( 'Import', 'the-events-calendar' );\n\t}",
"function getLabel()\n\t{\n\t\treturn '';\n\t}",
"function label() {\n return \"<label>\".$this->label.\": </label>\";\n }",
"function _title()\n {\n return _(\"Menu\");\n }",
"public function get_label(){ return $this->label; }",
"function maker_4ym_menu_posts_label() {\n global $menu;\n global $submenu;\n\n $menu[5][0] = 'Blog 4YM';\n $submenu['edit.php'][5][0] = 'Artículos del Blog';\n $submenu['edit.php'][10][0] = 'Agregar un Nuevo Artículo'; \n}",
"public function get_name()\n {\n return 'akash-menu';\n }",
"function getLabel(){\r\n\t\treturn $this->label;\r\n\t}",
"public function getMenuTitle(): string;",
"function getMenuSubTitle();",
"public function GetLabel();",
"public function label()\n {\n return $this->label;\n }",
"protected\n\tfunction getLabel()\n\t{\n\t\tPluginHelper::importPlugin(\"jevents\");\n\t\t$id = $this->id;\n\t\tif (version_compare(JVERSION, '3.3.0', '<'))\n\t\t{\n\t\t\t$res = Factory::getApplication()->triggerEvent('onEditMenuItem', array(&$this->data, &$this->value, $this->type, $this->name, $this->id, $this->form));\n\t\t}\n\t\tif (isset($this->data[$id]))\n\t\t{\n\t\t\t$this->element['label'] = $this->data[$id]->label;\n\t\t\t$this->description = $this->data[$id]->description;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->element['label'] = \"\";\n\t\t\t$this->description = \"\";\n\t\t}\n\n\t\treturn parent::getLabel();\n\n\t}",
"function getLabelField() \n {\n return \"navbarlink_textKey\";\n }",
"public function get_label()\n\t{\n\t\treturn $this->_label;\n\t}",
"public static function label()\n {\n return 'Bukeri';\n }",
"protected function getActionLabel() {}",
"public function getLabel()\n {\n return P4Cms_Navigation::expandMacros(parent::getLabel(), $this);\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 function get_title() {\n return esc_html__( 'Nav menu', 'Alita-extensions' );\n }",
"public function getLabel()\n\t{\t\t\t\n\t\treturn $this->label;\n\t}",
"public function get_title()\n {\n return __('Primary Menu', 'akash-hp');\n }",
"public function get_label() {\n\t\treturn $this->label;\n\t}",
"public function getLabel() {\n\t}",
"private function getCurrentMenuName(){\n \n if(!$this->currentmenuname)\n $this->setCurrentMenuName();\n \n return $this->currentmenuname;\n \n }",
"public function get_label() {\n return $this->_label;\n }",
"public function getLabel() {}",
"public function getLabel() {}",
"public function getDisplayLabel();",
"function change_post_menu_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'News';\n $submenu['edit.php'][5][0] = 'News';\n $submenu['edit.php'][10][0] = 'Add News Item';\n //$submenu['edit.php'][15][0] = 'Status'; // Change name for categories\n //$submenu['edit.php'][16][0] = 'Labels'; // Change name for tags\n echo '';\n}",
"protected function _getMenuName()\n\t{\n\t\treturn self::$_sMenuName;\n\t}",
"public function menu_get_active_title()\n {\n return menu_get_active_title();\n }",
"function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Aktualności';\n // $submenu['edit.php'][5][0] = 'Blog';\n // $submenu['edit.php'][10][0] = 'Add News';\n // $submenu['edit.php'][16][0] = 'News Tags';\n}",
"function change_post_menu_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'News';\n $submenu['edit.php'][5][0] = 'News';\n $submenu['edit.php'][10][0] = 'Add News Item';\n $submenu['edit.php'][15][0] = 'News Category'; // Change name for categories\n //$submenu['edit.php'][16][0] = 'Labels'; // Change name for tags\n echo '';\n}",
"public function getTabLabel()\n {\n return Mage::helper('temando')->__('General');\n }",
"public function label() { }",
"function change_admin_post_label() {\n\tglobal $menu;\n\tglobal $submenu;\n\t$menu[5][0] = 'Recipes';\n\t$submenu['edit.php'][5][0] = 'Recipes';\n\t$submenu['edit.php'][10][0] = 'Add Recipe';\n\t$submenu['edit.php'][16][0] = 'Tags';\n\techo '';\n}",
"public function getFrontendLabel();",
"public function getTabLabel()\n {\n return Mage::helper('lavi_news')->__('News Info');\n }",
"public function label()\n {\n return self::GAME_LABEL;\n }",
"public function label()\n {\n return self::GAME_LABEL;\n }",
"public function label()\n\t{\n\t\treturn \"$this->merk $this->jenis\";\n\t}",
"function change_post_menu_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = \"Blog\";\n $submenu['edit.php'][5][0] = \"Blog\";\n // $submenu['edit.php'][10][0] = 'Add Contacts';\n // $submenu['edit.php'][15][0] = 'Status'; // Change name for categories\n // $submenu['edit.php'][16][0] = 'Labels'; // Change name for tags\n echo '';\n}",
"public function getTabLabel()\n {\n return __('Slider Information');\n }",
"public function getTabLabel()\r\n {\r\n return Mage::helper('slideshow')->__('Slide Information');\r\n }",
"public function getLabel()\n\t{\n\t\treturn $this->get('label');\n\t}",
"public function getLabel()\n {\n }",
"public function getLabel()\n {\n }",
"public function label()\n {\n return $this->label ?? class_basename($this);\n }",
"function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Videos';\n $submenu['edit.php'][5][0] = 'All Videos';\n $submenu['edit.php'][10][0] = 'Add Video';\n $submenu['edit.php'][16][0] = 'Video Tags';\n echo '';\n}",
"public function getLabel()\n {\n return $this->oxselectlist__oxtitle->value;\n }",
"function change_post_menu_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Articles';\n $submenu['edit.php'][5][0] = 'Articles';\n $submenu['edit.php'][10][0] = 'Add Article';\n echo '';\n}",
"public function getLabel() {\n return $this->Title;\n }",
"public function getNavigationActionLabel()\r\n\t{\r\n\t\treturn $this->label;\r\n\t}",
"public function getLabel(): string;",
"public function getLabel(): string;",
"function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Artists';\n $submenu['edit.php'][5][0] = 'Artists';\n $submenu['edit.php'][10][0] = 'Add Artist';\n $submenu['edit.php'][16][0] = 'Artist Tags';\n}",
"public function getTabLabel()\r\n\t{\r\n\t\treturn Mage::helper('slider')->__('Banner Info');\r\n\t}",
"public function getTabLabel()\r\n {\r\n return __('Designer Information');\r\n }",
"function getLabel(): string;",
"public function getLabel()\n\t{\n\t\treturn $this->_label;\n\t}",
"public function getTabLabel() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }",
"public function get_menu()\r\n {\r\n return '';\r\n }",
"public function getLabel() {\n return $this->label;\n }",
"public function getLabel() {\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\t\treturn $this->label;\n\t}",
"public function getLabel() {\n\t\treturn $this->label;\n\t}",
"public function getLabel() {\n\t\treturn $this->label;\n\t}",
"public function getLabel() {\n\t\treturn $this->label;\n\t}"
] | [
"0.8315228",
"0.81985664",
"0.78218484",
"0.7588768",
"0.7588768",
"0.7502874",
"0.74609715",
"0.74482507",
"0.73544335",
"0.7326071",
"0.73221505",
"0.7302083",
"0.7269052",
"0.7221061",
"0.71713895",
"0.7146429",
"0.7081851",
"0.7058183",
"0.7044115",
"0.7032086",
"0.70132816",
"0.6993616",
"0.69859827",
"0.69699466",
"0.6951111",
"0.6945613",
"0.6944769",
"0.69386333",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.69237685",
"0.6919838",
"0.6906301",
"0.68970335",
"0.68964475",
"0.6896241",
"0.68894917",
"0.6885347",
"0.68676347",
"0.68676347",
"0.6867242",
"0.684245",
"0.6829129",
"0.6818126",
"0.68061465",
"0.67990875",
"0.6795722",
"0.67925334",
"0.67880356",
"0.6782354",
"0.6764572",
"0.675898",
"0.675898",
"0.67555577",
"0.673864",
"0.6737293",
"0.67340016",
"0.67128533",
"0.6712733",
"0.6712733",
"0.67115736",
"0.67078316",
"0.6707747",
"0.6698538",
"0.6697293",
"0.6692949",
"0.6691092",
"0.6691092",
"0.66753286",
"0.6667729",
"0.66520274",
"0.66481775",
"0.6631756",
"0.66317505",
"0.6619592",
"0.66042066",
"0.66042066",
"0.6588017",
"0.6588017",
"0.6584321",
"0.6584321",
"0.6584321",
"0.6584321"
] | 0.0 | -1 |
the icon of the menu | public function getIcon()
{
return $this->icon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_icon()\n {\n return 'eicon-nav-menu';\n }",
"public function get_menu_icon() {\n\t\treturn 'gform-icon--akismet';\n\t}",
"public function get_menu_icon() {\n\n\t\treturn file_get_contents( $this->get_base_path() . '/images/menu-icon.svg' );\n\n\t}",
"public function icon(): string;",
"public function icon($icon);",
"public function get_icon() {\n\t\treturn 'eicon-image';\n\t}",
"function get_icon() {\n\t\treturn $this->settings['icon'];\n\t}",
"private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}",
"private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}",
"public function get_icon() {\n\t\treturn 'eicon-icon-box';\n\t}",
"public function get_icon()\n\t{\n\t\treturn 'fab fa-algolia';\n\t}",
"public function get_icon()\n {\n return 'fa fa-image';\n }",
"public function get_icon() {\n\t\treturn 'eicon-eye';\n\t}",
"public function icon()\n {\n return $this->icon;\n }",
"public function getIcon() {}",
"public function postTypeIcon() {\n return static::$menuIcon;\n }",
"function plugin_geticon_nexmenu()\n{\n global $_CONF;\n\n return $_CONF['layout_url'] .'/nexmenu/images/admin/nexmenu.gif';\n}",
"public function get_icon() {\n\t\treturn 'fa fa-images';\n\t}",
"public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}",
"public function get_icon() {\n return 'fa fa-plug';\n }",
"public function get_icon() {\n return 'fa fa-plug';\n }",
"public function get_icon() {\n return 'fa fa-plug';\n }",
"public function get_icon()\n {\n return 'eicon-post-list';\n }",
"protected function get__icon()\n\t{\n\t\treturn NULL;\n\t}",
"public function get_icon() {\n\t\treturn 'eicon-slider-album';\n\t}",
"public function get_icon() {\n\t\treturn 'eicon-slider-album';\n\t}",
"public function getIcon();",
"public function getIcon();",
"public function getIcon()\n {\n }",
"protected function establish_icon() {\n\t\t$this->icon = \"<i class='sw swp_{$this->key}_icon'></i>\";\n\t}",
"protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}",
"function atom_site_icon()\n {\n }",
"function wp_site_icon()\n {\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/tool.png';\n }",
"public function get_icon() {\n return 'eicon-heading apr-badge';\n }",
"public function get_icon() {\n return 'eicon-slideshow';\n }",
"public function getIcon()\n {\n return $this->get(self::_ICON);\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }",
"public function get_default_icon()\n {\n return 'themes/default/images/icons/48x48/menu/_generic_admin/component.png';\n }",
"public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}",
"public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}",
"public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}",
"public function get_icon()\n {\n return 'fa fa-filter';\n }",
"public static function icon()\n {\n return '<i class=\"fas fa-plane-departure sidebar-icon\"></i>';\n }",
"public function get_icon() {\n\t\treturn 'fa fa-pencil';\n\t}",
"public function get_icon() {\n\t\treturn 'fa fa-pencil';\n\t}",
"public function getIcon()\n {\n return $this->_icon;\n }",
"public function getIcon() {\n\t\treturn $this->icon;\n\t}",
"public function getIcon()\n\t{\n\t\treturn $this->icon;\n\t}",
"public static function getIcon(): string\n {\n }",
"public static function getIcon(): string\n {\n }",
"public function get_icon() {\n\t\treturn 'eicon-product-images';\n\t}",
"public function getIcon()\n {\n return $this->Icon;\n }",
"public function get_icon() {\n\t\treturn 'fa fa-code';\n\t}",
"public function get_icon() {\n\t\treturn 'fa fa-code';\n\t}",
"function block_core_navigation_submenu_render_submenu_icon() {\n\treturn '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M1.50002 4L6.00002 8L10.5 4\" stroke-width=\"1.5\"></path></svg>';\n}",
"public function getIcon()\n {\n return empty($this->model->icon) ? 'globe' : $this->model->icon;\n }",
"public function getIcon() {\n return $this->icon;\n }",
"public function getIcon() {\n return $this->icon;\n }",
"public function getStrIcon() {\n return \"icon_folderClosed\";\n }",
"public function getIconName() {}",
"public function getIconName() {}",
"public function getIconName() {}",
"public function getIconName() {}",
"function icon() {\n global $CFG;\n\n return \"<img src='$CFG->wwwroot/blocks/ilp/pix/graphicon.jpg' height='24' width='24' />\";\n }",
"public function getBsShowIcon($icon = null);",
"public function getIcon(): string\n {\n return $this->icon ?: static::DEFAULT_ICON;\n }",
"function screen_icon()\n {\n }",
"public function get_icon()\n {\n return 'fa fa-heading';\n }",
"public function get_icon() {\n\t\treturn parent::get_widget_icon( 'Team_Member' );\n\t}",
"public function get_icon()\n {\n return 'fa fa-file-video-o';\n }",
"function image() {\n return data_field_admin::field_icon($this);\n }",
"public function get_icon() {\n\t\treturn 'fa fa-cloud';\n\t}",
"private function _renderIcon()\n {\n return !empty($this->_icon) ? '<i class=\"' . $this->_icon . '\"></i>' : '';\n }",
"function block_core_navigation_render_submenu_icon()\n {\n }",
"function rss2_site_icon()\n {\n }",
"public function getCategoryIcon();",
"function wpvideocoach_custom_menu_icon()\r\n{\r\n\tglobal $wpvideocoach_custom_menu_icon;\r\n\tif(empty($wpvideocoach_custom_menu_icon)){\r\n\t\t$wpvideocoach_custom_menu_icon = plugins_url('wp-video-coach/images/icon.png');\r\n\t}\r\n\treturn $wpvideocoach_custom_menu_icon;\r\n}",
"public function getSpriteIconCode() {}",
"public function icon() {\n\t\treturn 'column';\n\t}",
"public function getArticleListIcon();",
"function addIcon($i){\n return $this->add('Icon',null,'Icon')->set($i)->addClass('atk-size-mega');\n }",
"function block_core_navigation_submenu_render_submenu_icon()\n {\n }",
"function get_screen_icon()\n {\n }",
"function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}",
"public function setIcon($icon);",
"protected function iconHelp()\n {\n return 'For more icons please see <a href=\"http://fontawesome.io/icons/\" target=\"_blank\">http://fontawesome.io/icons/</a>';\n }",
"function news_icon() { ?>\n <style type=\"text/css\" media=\"screen\">\n #adminmenu .menu-icon-news div.wp-menu-image:before {\n content: \"\\f464\";\n }\n </style>\n <?php }",
"public function getIcon() {\n\t\t//regex is used to check if there's a filename within the iconFile string\n\t\treturn preg_replace('/^.*\\/([^\\/]+\\.(gif|png))?$/i', '\\1', $this->iconFile) ? $this->iconFile : '';\n\t}",
"public function Icon()\n {\n $ext = strtolower($this->getExtension());\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = $this->appCategory();\n }\n\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = \"generic\";\n }\n\n return FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\";\n }"
] | [
"0.8474718",
"0.82366705",
"0.7769332",
"0.76465166",
"0.7626438",
"0.76087695",
"0.75570613",
"0.7461263",
"0.7461263",
"0.74576277",
"0.7365608",
"0.733108",
"0.7324433",
"0.7318327",
"0.7286427",
"0.727601",
"0.7245814",
"0.72271657",
"0.7217184",
"0.7168878",
"0.7168878",
"0.7168878",
"0.714361",
"0.71411246",
"0.713947",
"0.713947",
"0.7121195",
"0.7121195",
"0.7109653",
"0.71044976",
"0.71019787",
"0.7064293",
"0.70515233",
"0.7022072",
"0.70061547",
"0.6993013",
"0.6987623",
"0.6976557",
"0.6976557",
"0.6976557",
"0.6976557",
"0.6976557",
"0.6976557",
"0.6950882",
"0.6950882",
"0.6950882",
"0.6946222",
"0.6938748",
"0.6924206",
"0.6924206",
"0.6912136",
"0.6905532",
"0.6899282",
"0.6893816",
"0.6893816",
"0.68928456",
"0.6892148",
"0.6886827",
"0.6886827",
"0.6862694",
"0.68588203",
"0.6851632",
"0.6851632",
"0.68369013",
"0.683591",
"0.683591",
"0.683575",
"0.683575",
"0.68220776",
"0.68149173",
"0.68111104",
"0.680672",
"0.68016165",
"0.67850745",
"0.67564774",
"0.6728207",
"0.67246956",
"0.6717213",
"0.671668",
"0.6715871",
"0.67142844",
"0.6701918",
"0.66999084",
"0.66967726",
"0.6691233",
"0.66859573",
"0.6680927",
"0.6671771",
"0.6650154",
"0.6649954",
"0.6633531",
"0.6630409",
"0.66119486",
"0.6594972"
] | 0.6913925 | 56 |
the required permissions of the menu | public function getRequiredPermissions()
{
return $this->requiredPermissions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function isMenu() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\t\n\t\tApp::import(\"Model\", \"Usermgmt.UserGroupPermission\"); \n\t\t$model = new UserGroupPermission(); \n\t\t$dados = $model->find(\"all\", array(\n\t\t\t'conditions'=>array('UserGroupPermission.user_group_id'=>$groupId,'UserGroupPermission.allowed'=>1),\n\t\t\t'fields' => array('UserGroupPermission.controller', 'UserGroupPermission.action')\n\t\t)); \n\t\t\n\t\treturn $dados;\n\t}",
"function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}",
"public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}",
"public function permissionedControlled() {\r\n return [\r\n '#markup' => $this->t('This menu entry will not show and the page will not be accessible without the \"access protected menu example\" permission to current user.'),\r\n ];\r\n }",
"public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }",
"public function permissioned() {\r\n $url = Url::fromUri('internal:/examples/menu-example/permissioned/controlled');\r\n $link = Link::fromTextAndUrl($this->t('examples/menu-example/permissioned/controlled'), $url)->toString();\r\n return [\r\n '#markup' => $this->t('A menu item that requires the \"access protected menu example\" permission is at @link', ['@link' => $link]),\r\n ];\r\n }",
"static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }",
"public function getPermission(){\n\t\tif (Yii::$app->getUserOpt->Modul_akses('11')){\n\t\t\treturn Yii::$app->getUserOpt->Modul_akses('11');\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }",
"private function checkMenu()\n {\n\n }",
"public function accesspermissionAction()\r\n {\r\n \r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $this->view->keyy=$key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n $this->view->menu_table=$temp_menu_arr;\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }",
"public function providePermissions() {\n return array(\n 'CMS_ACCESS_KapostBridgeLogViewer'=>array(\n 'name'=>_t(\n 'CMSMain.ACCESS',\n \"Access to '{title}' section\",\n \"Item in permission selection identifying the admin section. Example: Access to 'Files & Images'\",\n array('title'=>_t('KapostBridgeLogViewer.MENUTITLE', 'Kapost Bridge Logs'))\n ),\n 'category'=>_t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')\n )\n );\n }",
"function role_permission() {\n\t\tif(!has_permission(2)) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->output_head['function'] = __FUNCTION__;\n\n\t\t$this->output_head['style_extras'] = array(assets_url() . '/plugins/datatables/dataTables.bootstrap.css');\n\t\t$this->output_head['js_extras'] = array(assets_url() . '/plugins/datatables/jquery.dataTables.min.js',\n\t\t\t\t\t\t\t\t\t\t\t\tassets_url() . '/plugins/datatables/dataTables.bootstrap.min.js');\n\t\t$this->output_head['js_function'] = array();\n\t\t$this->load->model('user_model');\n\t\t\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'Role & Permission Manager';\n\t\t$this->load->view('role_permission', $this->output_data);\n\t\t$this->load->view('global/footer');\n\t}",
"protected function getPermission(){\n if(Session::getKey(\"loggedIn\")):\n $userPermissions = array();\n $userPermission = Session::getKey(\"level\");\n if($userPermission[0]) { // tiene permiso para crear\n $userPermissions[] = \"create\";\n }\n if($userPermission[1]) { // tiene permiso para crear\n $userPermissions[] = \"read\";\n }\n if($userPermission[2]) { // tiene permiso para crear\n $userPermissions[] = \"update\";\n }\n if($userPermission[3]) { // tiene permiso para crear\n $userPermissions[] = \"delete\";\n }\n return $userPermissions; \n else:\n return false;\n endif;\n }",
"public function & GetPermissions ();",
"public function get_available_rights();",
"public function get_item_permissions_check( $request ) {\n\t\treturn current_user_can( 'manage_options' );\n\t}",
"function virustotalscan_admin_permissions(&$admin_permissions)\r\n{\r\n \tglobal $lang;\r\n // se incarca fisierul de limba\r\n \t$lang->load(\"virustotalscan\", false, true);\r\n // se seteaza textul permisiunii\r\n\t$admin_permissions['virustotalscan'] = $lang->virustotalscan_canmanage;\r\n}",
"function mainMenu() \r\n\t\t{\r\n\t\t\tif($this->RequestAction('/external_functions/verifiedAccess/'.$this->Auth->user('id').\"/1/mainMenu\") == true)\r\n\t\t\t{\r\n\t\t\t\t$this->set('title_for_layout', 'Fondos por rendir :: Menu Principal');\r\n\t\t\t\t$this->set('userAdmin', $this->Auth->user('admin'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->Session->setFlash('No tienes permisos para ver esta pagina, consulta con el administrador del sistema.', 'flash_alert');\r\n\t\t\t\t$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));\r\n\t\t\t}\r\n\t\t}",
"public function checkPermissions();",
"function permissions() {\r\n\t\treturn false;\r\n\t}",
"protected function checkAccess() {\n\t\t$hasAccess = static::hasAccess();\n\n\t\tif (!$hasAccess) {\n\t\t\tilUtil::sendFailure($this->pl->txt(\"permission_denied\"), true);\n if (self::version()->is6()) {\n $this->ctrl->redirectByClass(ilDashboardGUI::class, 'jumpToSelectedItems');\n } else {\n\t\t\t$this->ctrl->redirectByClass(ilPersonalDesktopGUI::class, 'jumpToSelectedItems');\n\t\t\t}\n\t\t}\n\t}",
"public function accesspermission1Action()\r\n {\r\n Zend_Loader::loadClass('Permission');\r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n //print \"<pre>\"; print_r($this->view->user_permission_table); print \"</pre>\";\r\n //print \"<pre>\"; print_r($temp_menu_arr); print \"</pre>\";\r\n $this->view->menu_table=$temp_menu_arr;\r\n\r\n //exit;\r\n /*$this->view->user_detail=$ob_User->getUserDetails($user_id);\r\n $ob_Credit\t= new Credit();\r\n $user_current_balance=$ob_Credit->get_current_balance($user_id);\r\n $this->view->user_expiary_date=$user_current_balance[$user_id]['expiary_date'];\r\n\r\n $subusers=$ob_User->get_sub_user_ids($user_id,0,0);\r\n $this->view->subusers_count=($subusers)?count(explode(',',$subusers)):0;*/\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n\r\n\r\n /*\r\n $ob_User\t= new User();\r\n $this->view->user_rows=$ob_User->get_user_list_rows(0,$quick_search,$arr_limit,$arr_order);\r\n $row_count=$ob_User->get_user_list_rows_count(0,$quick_search);\r\n $arr_rows=array('user_id','account_name','phone','email','nric');\r\n $this->view->page_sorting_images=$this->sessionAuth->get_sorting_html($arr_rows,$arr_order);\r\n\r\n $this->view->page_peginetion=$this->sessionAuth->get_peginetion($row_count,$page,$num_row);*/\r\n//print \"<pre>\"; print_r($aaaaaaa); print \"</pre>\"; exit;\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }",
"function check_role_access(){\n if(!is_user_logged_in()){\n return 0;\n }\n //Make sure its not admin\n if(in_array(\"administrator\", wp_get_current_user()->roles)){\n return 0;\n }\n\n\n //Get capabilities\n $allcaps = wp_get_current_user()->allcaps;\n $can_access = array();\n //Get manu slugs user can access from capabilities\n foreach($allcaps as $key=>$value){\n if(strpos($key,$this->wp_user_role_customizer) !== FALSE){\n //Remove wp_user_role_customizer from capability name to get menu-slug\n array_push($can_access, substr($key, strlen($this->wp_user_role_customizer . \"_\"), strlen($key)));\n\n }\n }\n\n if(empty($can_access)){\n return 0;\n }\n\n // array_push($can_access, 'post.php');\n\n\n\n //Get path and query of requested page\n $uri = wp_parse_url($_SERVER['REQUEST_URI']);\n $path = (isset($uri['path']) ? $uri['path'] : null);\n $query = (isset($uri['query']) ? $uri['query'] : null);\n $user_can_access = FALSE;\n //Make sure its wp-admin page\n if(strpos($path, 'wp-admin') !== FALSE){\n //Redirect to dashboard if requested page is either about.php or index.php\n if(strpos($path, '/wp-admin/about.php') !== FALSE || strpos($path, '/wp-admin/index.php') !== FALSE){\n wp_redirect(get_dashboard_url());\n exit();\n }\n\n if( strpos($path,'.php') !== FALSE || $query !== null){\n foreach($can_access as $menu_slug){\n //Access page if user can access requested page\n if($this->check_for_url_access($path,$query,$menu_slug)){\n $user_can_access = TRUE;\n break;\n\n }\n }\n //Exit if user can't access requested page\n if($user_can_access === FALSE){\n wp_die('You Cannot Access This Page', 'Access Denied',['exit'=> true]);\n }\n }\n }\n\n }",
"abstract public function getPermissions();",
"public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public static function canDisplayAttorneysMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY);\n\t}",
"public function getPermissions() {}",
"public function getPermissions() {}",
"protected function getModuleMenu() {}",
"protected function getModuleMenu() {}",
"protected function getModuleMenu() {}",
"public function permissions()\n {\n return [\n 'add parcels', 'edit parcels', 'delete parcels', 'send parcels', 'pick parcels'\n ];\n }",
"function cp_menu_array($menu)\n\t{\n\t\tif (ee()->extensions->last_call !== FALSE)\n\t\t{\n\t\t\t$menu = ee()->extensions->last_call;\n\t\t}\n\n\t\t// If this isn't a Super Admin, let's check to see if they can modify\n\t\t// the RTE module\n\t\tif (ee()->session->userdata('group_id') != 1)\n\t\t{\n\t\t\t$access = (bool) ee()->db->select('COUNT(m.module_id) AS count')\n\t\t\t\t->from('modules m')\n\t\t\t\t->join('module_member_groups mmg', 'm.module_id = mmg.module_id')\n\t\t\t\t->where(array(\n\t\t\t\t\t'mmg.group_id' \t=> ee()->session->userdata('group_id'),\n\t\t\t\t\t'm.module_name' => ucfirst($this->module)\n\t\t\t\t))\n\t\t\t\t->get()\n\t\t\t\t->row('count');\n\n\t\t\t$has_access = $access AND ee()->cp->allowed_group('can_access_addons');\n\t\t}\n\n\t\tif (ee()->session->userdata('group_id') == 1 OR $has_access)\n\t\t{\n\t\t\tee()->lang->loadfile($this->module);\n\t\t\t$menu['admin']['admin_content']['rte_settings'] = BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module='.$this->module;\n\t\t}\n\n\t\treturn $menu;\n\t}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestudy_Menu::first_index');\n }",
"function menu_permissions($controller,$action,$userID) {\n\t\t App::import('Model','Permission');\n\t\t $this->Permission= new Permission;\n\t\t $cond = \"WHERE controller='$controller' AND action='$action'\";\n\t\t $permissionsResult = $this->Permission->find('first',array(\n\t\t 'fields' => array('user_id'),\n\t\t 'conditions' => $cond,\n\t\t ));\n\t\t if(!empty($permissionsResult)){\n\t\t $users = explode(\",\",$permissionsResult['Permission']['user_id']);\n\t\t\tif (in_array($userID,$users)) {\n\t\t\treturn true;\n\t\t }\n\t\t else{\n\t\t\treturn false;\n\t\t }\n\t\t }\n\t\t return true;\n\t\t \n\t}",
"static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }",
"function adminMenu()\n{\n if (function_exists('rstCheckAccessPermissions') && rstCheckAccessPermissions()) {\n // available for Contributors\n $capability = 'edit_posts';\n } else {\n // available only for Administrators\n $capability = 'manage_options';\n }\n // available only for Administrators\n $capability_for_settings = 'manage_options';\n add_menu_page(__('Row Seats', 'menu-test'), __('Row Seats', 'menu-test'), $capability, 'rst-intro', 'rst_intro_page', RSTPLN_URL . 'images/row-seat-ico.png');\n add_submenu_page('rst-intro', __('Row Seats Settings', 'menu-test'), __('Row Seats Settings', 'menu-test'), $capability_for_settings, 'rst-settings', 'rst_settings');\n\tadd_submenu_page('rst-intro', __('Payment Settings', 'menu-test'), __('Payment Settings', 'menu-test'), $capability_for_settings, 'rst-pay-settings', 'rst_pay_settings');\n add_submenu_page('rst-intro', __('Manage Seats', 'menu-test'), __('Manage Seats', 'menu-test'), $capability, 'rst-manage-seats', 'rst_manage_seats');\n\t///add_submenu_page('rst-intro', __('Special Price', 'menu-test'), __('Special Price', 'menu-test'), $capability, 'rst-special-price', 'rst_special_price');\n\tadd_submenu_page('rst-intro', __('Transactions', 'menu-test'), __('Transactions', 'menu-test'), $capability, 'rst-transactions', 'rst_transactions');\n add_submenu_page('rst-intro', __('Add an Event', 'menu-test'), __('Add an Event', 'menu-test'), $capability, 'rst-manage-seats-moncal', 'rst_manage_seats_moncalender');\n\tadd_submenu_page('rst-intro', __('Reports', 'menu-test'), __('Reports', 'menu-test'), $capability, 'rst-reports', 'rst_reports');\n //add_submenu_page('rst-intro', __('Wpuser Access', 'menu-test'), __('Wpuser Access', 'menu-test'), $capability, 'wpuser-access', 'wpuser_access');\n\t//add_submenu_page('rst-intro', __('Seat color', 'menu-test'), __('Seat color', 'menu-test'), $capability, 'seat-color', 'seat_color');\n\t\t//wp_register_script('jscolor.js', plugin_dir_url(__FILE__) . 'js/jscolor/jscolor.js', array('jquery'));\n\t\t//wp_enqueue_script('jscolor.js');\n}",
"function check_permission()\n\t{\n\t\t$CFG = $this->config->item('language_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}",
"function modMenu() {\n\t\tglobal $LANG;\n\n\t\treturn Array (\n\t\t\t\"tx_dam_ivs_videobasic_modfunc_status_check\" => \"\",\n\t\t);\n\t}",
"public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"function statsMenu() \r\n\t\t{\r\n\t\t\tif($this->RequestAction('/external_functions/verifiedAccess/'.$this->Auth->user('id').\"/1/statsMenu\") == true)\r\n\t\t\t{\r\n\t\t\t\t$this->set('title_for_layout', 'Fondos por rendir :: Informes y estadisticas');\r\n\t\t\t\t$this->set('userAdmin', $this->Auth->user('admin'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->Session->setFlash('No tienes permisos para ver esta pagina, consulta con el administrador del sistema.', 'flash_alert');\r\n\t\t\t\t$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));\r\n\t\t\t}\t\r\n\t\t}",
"static function getPermissions() {\n if(self::$permissions === false) {\n self::$permissions = new NamedList(array(\n\n ));\n\n EventsManager::trigger('on_system_permissions', array(&self::$permissions));\n } // if\n\n return self::$permissions;\n }",
"public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }",
"function check_permission()\n\t{\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}",
"public function getPossiblePermissions();",
"public function getMenu();",
"function user_can_access_admin_page()\n {\n }",
"public function customAccessPage() {\r\n return [\r\n '#markup' => $this->t('This menu entry will not be visible and access will result\r\n in a 403 error unless the user has the \"authenticated\" role. This is\r\n accomplished with a custom access check plugin.'),\r\n ];\r\n }",
"public function authorize()\n {\n return auth()->user()->ability('admin','update_pages');\n }",
"function get_permission_list() {\n\t\treturn $this->db->get('system_security.security_permission');\n\t\t\n\t}",
"function admin()\n{\n return current_user_can('manage_options');\n}",
"public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}",
"function okr_module_init_menu_items()\n{\n $CI = &get_instance();\n \n if(has_permission('okr','','view') || is_admin() || has_permission('okr','','view_own')){\n $CI->app_menu->add_sidebar_menu_item('OKR', [\n 'name' => _l('okr'),\n 'icon' => 'fa fa-crosshairs', \n 'position' => 30,\n ]);\n\n $CI->app_menu->add_sidebar_children_item('OKR', [\n 'slug' => 'okr_dashboard',\n 'name' => _l('okr_dashboard'),\n 'icon' => 'fa fa-pie-chart',\n 'href' => admin_url('okr/dashboard'),\n 'position' => 1,\n ]);\n\n $CI->app_menu->add_sidebar_children_item('OKR', [\n 'slug' => 'okr_report',\n 'name' => _l('okr_report'),\n 'icon' => 'fa fa-signal',\n 'href' => admin_url('okr/report'),\n 'position' => 2,\n ]);\n\n $CI->app_menu->add_sidebar_children_item('OKR', [\n 'slug' => 'okrs',\n 'name' => _l('okrs'),\n 'icon' => 'fa fa-crosshairs',\n 'href' => admin_url('okr/okrs'),\n 'position' => 3,\n ]);\n\n $CI->app_menu->add_sidebar_children_item('OKR', [\n 'slug' => 'okr_checkin',\n 'name' => _l('okr_checkin'),\n 'icon' => 'fa fa-calendar-check-o',\n 'href' => admin_url('okr/checkin'),\n 'position' => 4,\n ]);\n\n \n }\n if(is_admin()){\n $CI->app_menu->add_sidebar_children_item('OKR', [\n 'slug' => 'okr_setting',\n 'name' => _l('okr_setting'),\n 'icon' => 'fa fa-cog',\n 'href' => admin_url('okr/setting'),\n 'position' => 5,\n ]);\n }\n \n}",
"private static function menu($data) {\n\t\t$functions = [];\n\t\tforeach (self::SUBFUNCTIONS as $key => $function) {\n\t\t\tif (empty($function['permission']) || self::pw('user')->hasPermissionCode($function['permission'])) {\n\t\t\t\t$functions[$key] = $function;\n\t\t\t}\n\t\t}\n\t\treturn self::displayMenu($data, $functions);\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 // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }",
"public static function get_menu_perms($conn) \n {\n Ossim_db::check_connection($conn);\n \n $list = array();\n $perms_check = array();\n \n $query = \"SELECT * FROM acl_perm WHERE acl_perm.type = 'MENU' AND enabled = 1 ORDER BY ord ASC\";\n \n $rs = $conn->Execute($query); \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return array($list, $perms_check);\n } \n \n if (!$rs->EOF) \n { \n while (!$rs->EOF) \n { \n if (self::menu_perms($rs->fields['name'], $rs->fields['value']))\n {\n $list[$rs->fields['name']][$rs->fields['id']] = ($rs->fields['description'] != '') ? $rs->fields['description'] : \"<span style='color:#444444'>[\".$rs->fields['value'].\"]</span>\";\n \n \n $perms_check[$rs->fields['name']][$rs->fields['id']] = (self::menu_perms($rs->fields['name'], $rs->fields['value'])) ? 1 : 0;\n }\n \n $rs->MoveNext();\n }\n }\n \n return array($list, $perms_check);\n }",
"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 // Add a new Match Server Attribute?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Match Server Attribute?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Match Server Attribute?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n // View all existing Match Server Attributes?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Match Server Attribute?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n $this->set('permissions', $p);\n return $p[$this->action];\n }",
"function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}",
"public function authorize()\n {\n return PerfilPermissao::AcessoAction('CATEGORIAS');\n }",
"public function getPermissions();",
"public static function uses_permissions(): bool;",
"private function setUser() {\n if (Request::has(\"include-user-read\") && Request::input(\"include-user-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-user-write\") && Request::input(\"include-user-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-user-execute\") && Request::input(\"include-user-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }",
"function check_permission()\n {\n // Make sure the user is logged-in\n require_course_login($this->course, true, $this->cm);\n\n add_to_log($this->course->id, 'sloodle', 'view sloodle module', \"view.php?id={$this->cm->id}\", \"{$this->sloodle->id}\", $this->cm->id);\n \n // Check for permissions\n $this->module_context = get_context_instance(CONTEXT_MODULE, $this->cm->id);\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\n if (has_capability('moodle/course:manageactivities', $this->module_context)) $this->canedit = true;\n\n // If the module is hidden, then can the user still view it?\n if (empty($this->cm->visible) && !has_capability('moodle/course:viewhiddenactivities', $this->module_context)) notice(get_string('activityiscurrentlyhidden'));\n }",
"public function getAdminPermissions(): array;",
"public function Menu() {\n $user_role = get_option('oxi_addons_user_permission');\n $role_object = get_role($user_role);\n $first_key = '';\n if (isset($role_object->capabilities) && is_array($role_object->capabilities)) {\n reset($role_object->capabilities);\n $first_key = key($role_object->capabilities);\n } else {\n $first_key = 'manage_options';\n }\n add_submenu_page('oxi-addons', 'Elementor Addons', 'Elementor Addons', $first_key, 'oxi-el-addons', [$this, 'oxi_addons_elementors']);\n }",
"public function permission(): string;",
"public static function getAdminMenu()\n {\n return [\n 'label' => Yii::t('rbac', 'Access control'),\n 'icon' => FA::_WRENCH,\n 'order' => 6,\n 'roles' => ['rbac'],\n 'items' => [\n [\n 'label' => Yii::t('rbac', 'Action access'),\n 'icon' => FA::_MAP_SIGNS,\n 'url' => '/rbac/access/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Elements Access'),\n 'icon' => FA::_EXTERNAL_LINK,\n 'url' => '/rbac/element/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Fields Access'),\n 'icon' => FA::_TEXT_HEIGHT,\n 'url' => '/rbac/field/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Assignments'),\n 'icon' => FA::_GAVEL,\n 'url' => '/rbac/assignment/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Auth items'),\n 'icon' => FA::_GEARS,\n 'url' => '/rbac/auth-item/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Roles'),\n 'icon' => FA::_GEAR,\n 'url' => '/rbac/role/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Permissions'),\n 'icon' => FA::_GEAR,\n 'url' => '/rbac/permission/',\n 'roles' => ['rbac'],\n ],\n [\n 'label' => Yii::t('rbac', 'Rules'),\n 'icon' => FA::_GAVEL,\n 'url' => '/rbac/rule/',\n 'roles' => ['rbac'],\n ],\n ],\n ];\n }",
"public function index()\n {\n if (Auth::user()->ability('superadministrator', 'read-permissions')){\n return view('permission.read',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'列表',\n 'permissions'=>Permission::all(),\n 'enableUpdate'=>Auth::user()->hasPermission('update-permissions'),\n 'enableDelete'=>Auth::user()->hasPermission('delete-permissions'),\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }",
"public function getPermissionOptions()\n {\n return [\n 'read' => 'View changes of all content',\n ];\n }",
"public function privileges()\n {\n $this->privileges = $this->Acces->list($_SESSION['guild_id'],'privilege');\n }",
"function getAdminRights($type, $id_admin, $menu_path, $current_file)\n{\n\t$current_file\t= '|'. $current_file .'|';\n\tif($type == '1')\n\t{\n\t\treturn array(true, '1');\n\t}\n\telse\n\t{\n\t\t$query\t= \"* FROM admin_menu as AM, admin_access as AC where AM.id_menu = AC.id_menu and AM.status='1' and AC.id_admin = '\". $id_admin .\"' and AM.menu_path like '\". $menu_path .\"%' and (AM.view_files like '%\". $current_file .\"%' or AM.edit_files like '%\". $current_file .\"%') order by AM.id_menu limit 1 \";\n\t\t$data\t= getLoopData($query);\n\t\t\n\t\tif(isset($data) && count($data) > 0) //if admin access exist\n\t\t{\n\t\t\t$data\t= $data[0];\n\t\t\t//var_dump($data);\n\t\t\t//exit;\n\t\t\t\n\t\t\t//checking if admin has access\n\t\t\tif($data['allow_edit'] == '1')\n\t\t\t{\n\t\t\t\treturn array(true, $data['allow_edit']);\n\t\t\t}\n\t\t\telse if($data['allow_edit'] == '0' && (strrpos($data['view_files'], $current_file) !== false))\n\t\t\t{\n\t\t\t\treturn array(true, $data['allow_edit']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array(false, $data['allow_edit']);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array(false, $data['allow_edit']);\n\t\t}\n\t}\n}",
"public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}",
"function wpdmpp_menu()\n {\n add_submenu_page('edit.php?post_type=wpdmpro', __('Orders', \"wpdm-premium-packages\"), __('Orders', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'orders', array( $this, 'wpdmpp_orders' ) );\n add_submenu_page('edit.php?post_type=wpdmpro', __('License Manager', \"wpdm-premium-packages\"), __('License Manager', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'pp-license', array( $this, 'wpdmpp_license' ) );\n add_submenu_page('edit.php?post_type=wpdmpro', __('Coupon Codes', \"wpdm-premium-packages\"), __('Coupon Codes', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'pp-coupon-codes', array( $this, 'wpdmpp_all_coupons' ) );\n add_submenu_page('edit.php?post_type=wpdmpro', __('Payouts', \"wpdm-premium-packages\"), __('Payouts', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'payouts', array( $this, 'wpdmpp_all_payouts' ) );\n }",
"public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}",
"public static function getMenu(): array {\n\t\treturn [\n\t\t\t[\n\t\t\t\t'text' => 'ROLES',\n\t\t\t\t'order' => 5,\n\t\t\t\t'permission' => 'manage-roles',\n\t\t\t\t'icon' => 'fa fa-user-tag',\n\t\t\t\t'submenu' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'text' => 'Roles List',\n\t\t\t\t\t\t'route' => 'admin.roles.index',\n\t\t\t\t\t\t'icon' => 'fa fa-user-tag',\n\t\t\t\t\t\t'permission' => 'list-roles',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'text' => 'Create Role',\n\t\t\t\t\t\t'route' => 'admin.roles.create',\n\t\t\t\t\t\t'icon' => 'fa fa-plus-square',\n\t\t\t\t\t\t'permission' => 'create-roles',\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t],\n\t\t];\n\t}",
"public static function permissions(): array\n {\n return [];\n }",
"public function widget_privileges()\n {\n $site_id = Model_Site::current()->id;\n if ($site_id === NULL)\n {\n return $this->_widget_error('Выберите портал!');\n }\n\n $order_by = $this->request->param('acl_prorder', 'position');\n $desc = (bool) $this->request->param('acl_prdesc', '0');\n\n $privileges = Model::fly('Model_Privilege')->find_all_by_site_id($site_id, array(\n 'order_by' => $order_by,\n 'desc' => $desc\n ));\n\n // Set up view\n $view = new View('backend/privileges');\n\n $view->order_by = $order_by;\n $view->desc = $desc;\n\n $view->privileges = $privileges;\n\n return $view->render();\n }",
"function admin_menu() {\n\t\t// Set Admin Access Level\n\t\tif(!$this->options['access_level']): \n\t\t\t$access = 'edit_dashboard';\n\t\telse: \n\t\t\t$access = $this->options['access_level'];\n\t\tendif;\n\t\t\n\t\t// Create Menu Items \n\t\tadd_options_page('Escalate Network', 'Escalate Network', $access, 'escalate-network-options', array($this, 'settings_page'));\n\t}",
"public function check_capabilities() {\n\n add_action('admin_init', array( $this, 'init' ) );\n\n // Make sure user can edit theme options\n if ( ! current_user_can('edit_theme_options') ) {\n return;\n }\n\n // Add the menu item\n add_action('admin_menu', array( $this, 'create_menu' ) );\n\n // Load required asstes\n add_action('admin_enqueue_scripts', array( $this, 'load_assets' ) );\n\n }",
"protected function viewMenu(){\n\t\t$userStatus = $_SESSION[\"user_status\"];\n\t\t\n\t\t// menus\n\t\t$menu = false;\n\t\tif ($userStatus > 2){\n\t\t\t$menu = true;\n\t\t}\n\t\treturn $menu;\n\t}",
"public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\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 // Add a new Vetting Step?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Vetting Step?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing Vetting Steps?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step's order?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX\n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Vetting Step?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }",
"private function drawPermissions($menu, $roleId, $level = 0)\n {\n $this->id++;\n if(!is_array($menu)) \n {\n return;\n }\n \n $ret = $ret . \"<ul class='permission \"\n . ($level==0?\"root-permission\":\"sub-permission\")\n . \" permission-level-$level' id='permission-{$this->id}'>\";\n\n foreach($menu as $item)\n {\n $link = is_array($item[\"permissions\"]) ? \"<b>{$item[\"title\"]}</b>\" : \"<a href='{$this->urlPath}/permissions/$roleId{$item[\"path\"]}'>{$item[\"title\"]}</a>\";\n\n $ret = $ret . \"<li $style $extra >$link\";\n\n if(is_array($item[\"permissions\"]))\n {\n $this->save = \"<div id='fapi-submit-area'><input type='submit' value='Save'/>\";\n $ret =$ret . \"<div class='permission-box' style='padding-bottom:20px;width:500px'>\n <table width='100%'>\n <thead><tr><td width='50%'></td><td><center>Enabled</center></td><td><center>Disabled</center></td></tr></thead>\";\n foreach($item[\"permissions\"] as $permission)\n {\n $permissionName = str_replace(\".\", \"_\", $permission[\"name\"]);\n $enableChecked = User::getPermission($permissionName, $roleId) == true ? \"checked='checked'\" : \"\";\n $disabledChecked = User::getPermission($permissionName, $roleId) == true ? \"\" : \"checked='checked'\";\n \n $ret .= \"<tr>\n <td>{$permission[\"label\"]}</td>\n <td><center><input type='radio' name='{$permission[\"name\"]}[]' value='1' $enableChecked /></center></td>\n <td>\n <center><input type='radio' name='{$permission[\"name\"]}[]' value='0' $disabledChecked /></center>\n <input type='hidden' name='{$permission[\"name\"]}[]' value = '{$item[\"path\"]}' />\n </td>\n </tr>\";\n }\n $ret .= \"</table></div>\";\n }\n\n if(count($item[\"children\"]>0))\n {\n $ret = $ret \n . $this->drawPermissions($item[\"children\"],$roleId,$level+1);\n }\n $ret = $ret . \"</li>\";\n }\n\n $ret = $ret . \"</ul>\";\n return $ret;\n }",
"function restrict_menus() {\n if (!current_user_can('manage_options') && is_user_logged_in()) {\n $path = get_site_url();\n $screen = get_current_screen();\n $base = $screen->id;\n\n if( 'profile' == $base || 'edit-contact' == $base || 'contact' == $base || 'edit-category' == $base ) {\n // only load these pages\n } else {\n wp_redirect($path.'/wp-admin/edit.php?post_type=contact');\n }\n }\n}",
"public function accessRules()\r\n\t{\r\n\t\t $funcionesAxu = new funcionesAux();\r\n $funcionesAxu->obtenerActionsPermitidas(Yii::app()->user->getState(\"Menu\"), Yii::app()->controller->id);\r\n \r\n $arr =$funcionesAxu->actiones; // give all access to admin\r\n if(count($arr)!=0){\r\n return array( \r\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n 'actions'=>$arr, \r\n 'users'=>array('@'),\r\n ),\r\n array('deny', // deny all users\r\n 'users'=>array('*'),\r\n 'deniedCallback' => function() { \r\n Yii::app()->user->setFlash('error', \"Usted no tiene permiso para relizar la acción solicitada. Inicie sesión con el usuario correspondiente \"); \r\n // Yii::app()->controller->redirect(array ('/site/index'));\r\n Yii::app()->controller->redirect(Yii::app()->request->urlReferrer); \r\n }\r\n ),\r\n );\r\n }else{\r\n return array(\r\n array('deny', // deny all users\r\n 'users'=>array('*'),\r\n 'deniedCallback' => function() { \r\n Yii::app()->user->setFlash('error', \"Usted no tiene permiso para relizar la acción solicitada. Inicie sesión con el usuario correspondiente \"); \r\n // Yii::app()->controller->redirect(array ('/site/index'));\r\n Yii::app()->controller->redirect(Yii::app()->request->urlReferrer); \r\n }\r\n ),\r\n );\r\n }\r\n \r\n\t}",
"function sld_manage_menu_items() {\n\tif( !current_user_can( 'administrator' ) ) {\n\t}\n\tremove_menu_page('link-manager.php'); // Links\n\t// remove_menu_page('edit.php'); // Posts\n\tremove_menu_page('upload.php'); // Media\n\t// remove_menu_page('edit-comments.php'); // Comments\n\t// remove_menu_page('edit.php?post_type=page'); // Pages\n\t// remove_menu_page('plugins.php'); // Plugins\n\t// remove_menu_page('themes.php'); // Appearance\n\t// remove_menu_page('users.php'); // Users\n\t// remove_menu_page('tools.php'); // Tools\n\t// remove_menu_page('options-general.php'); // Settings\n}",
"function SettingsController_DefineAdminPermissions_Handler(&$Sender) {\n if (isset($Sender->RequiredAdminPermissions)) {\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Settings.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Categories.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Spam.Manage';\n }\n }",
"public function permissions_callback(){\n $wp_roles = new WP_Roles();\n\t\t$roles = $wp_roles->get_names();\n $checked_values = !isset($this->general_options['permissions']) ? array(BK_DEFAULT_ROLE) : $this->general_options['permissions'];\n\n\t\tforeach ($roles as $role_value => $role_name) {\n\t\t\t$checked = $role_value == 'administrator' || in_array($role_value, $checked_values) ? 'checked' : '';\n\n\t\t\techo '<p><input type=\"checkbox\"'.disabled(\"administrator\", $role_value, false).' name=\"fo_general_options[permissions][]\" value=\"' . $role_value . '\" '.$checked.'>'.translate_user_role($role_name).'</input></p>';\n \t\t}\n }",
"function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}",
"function checkMenuAccess($menu_access) {\n\t\tglobal $login_name,$login_access;\n\t\tglobal $f;\n\n\t\t#$useraccess=$f->convert_value(array(\"table\"=>\"tbl_user\",\"cs\"=>\"access\",\"cd\"=>\"username\",\"vd\"=>$login_name));\n\t\t$useraccess=$login_access;\n\t\tif (!$menu_access){\n\t\t\t$menuAccessChecked= ($useraccess ==4)?\"1\":\"0\";\n\t\t}\n\n\t\t$Data = explode(\"|\",$menu_access);\n\n\t\tfor($i=0;$i<count($Data);$i++) {\n\t\t\tif ( trim($Data[$i]) == trim($useraccess) ) $menuAccessChecked = 1;\n\t\t}\n\t\treturn $menuAccessChecked;\n\t}",
"public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->User->hasAccess('image_sizes', 'themes'))\n\t\t{\n\t\t\t$this->log('Not enough permissions to access the image sizes module', __METHOD__, TL_ERROR);\n\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t}\n\t}",
"public static function menu_perms($menu, $submenu) \n { \n if (self::am_i_admin())\n { \n return TRUE;\n }\n \n //You need to be logged in the system!!\n if (!isset($_SESSION['_user']))\n {\n return FALSE;\n }\n \n if (is_array($menu) && is_array($submenu)) \n {\n $i = 0; \n $sm = count($submenu);\n \n foreach ($menu as $menu_value)\n {\n if (is_array($_SESSION['_allowed_menus'][$menu_value]) && (!$sm || in_array($submenu[$i],$_SESSION['_allowed_menus'][$menu_value])))\n { \n return TRUE;\n }\n \n $i++;\n }\n }\n elseif (!is_array($menu))\n {\n if ($_SESSION['_allowed_menus'][$menu] == '')\n {\n return FALSE;\n }\n \n if (in_array($submenu, $_SESSION['_allowed_menus'][$menu]))\n { \n return TRUE;\n }\n }\n \n return FALSE;\n }",
"protected function check_permission()\n {\n return true;\n }",
"public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }"
] | [
"0.7443708",
"0.7443708",
"0.7443708",
"0.7443708",
"0.7443708",
"0.73184884",
"0.7232795",
"0.7090475",
"0.7000019",
"0.69724286",
"0.69053465",
"0.6860679",
"0.6840959",
"0.68005604",
"0.676996",
"0.6761293",
"0.67384106",
"0.67368174",
"0.66741806",
"0.66626114",
"0.6657333",
"0.6649596",
"0.6647534",
"0.6644427",
"0.66271186",
"0.6623124",
"0.6609712",
"0.66016257",
"0.6594328",
"0.65534484",
"0.65388924",
"0.6512488",
"0.6508097",
"0.6508097",
"0.64929676",
"0.64929676",
"0.6492193",
"0.64815396",
"0.6468762",
"0.64395654",
"0.6439007",
"0.6437608",
"0.64325005",
"0.64313567",
"0.6427278",
"0.6405693",
"0.6404533",
"0.6399704",
"0.6398379",
"0.6392962",
"0.638192",
"0.63752604",
"0.6374415",
"0.63669384",
"0.635899",
"0.63501024",
"0.63433295",
"0.633611",
"0.63194793",
"0.6308031",
"0.6305507",
"0.63041323",
"0.62983227",
"0.6286375",
"0.62776977",
"0.627689",
"0.62763846",
"0.6268921",
"0.62609214",
"0.62608343",
"0.6254362",
"0.62472534",
"0.62426776",
"0.6240672",
"0.6239611",
"0.6237722",
"0.6233036",
"0.6228737",
"0.6224971",
"0.6224743",
"0.6223289",
"0.6223011",
"0.62223125",
"0.62216955",
"0.62196666",
"0.6218648",
"0.62102264",
"0.6205839",
"0.6196403",
"0.6193373",
"0.6185325",
"0.6181333",
"0.61791694",
"0.6172848",
"0.61715096",
"0.61704093",
"0.61689603",
"0.61656284",
"0.616261",
"0.6162509",
"0.6161035"
] | 0.0 | -1 |
Charge le contenu de la page velo bleu | function findKeyAndUriFromVeloWebsite()
{
$urlBase = $this->CI->config->item('UrlBase', 'velobleuconf');
$urlCarte = $this->CI->config->item('UrlCarteVeloBleu', 'velobleuconf');
$pageHTML = @file_get_contents($urlBase . $urlCarte);
if(isset($http_response_header) && isValidHttpRequest($pageHTML, $http_response_header))
{
// Trouve la variable mapdb et prend ce qui est contenu entre quotes pour connaitre son contenu
$posMapDb = strpos($pageHTML, 'var mapdb');
$posQote1MapDb = strpos($pageHTML, "'", $posMapDb) + 1;
$posQote2MapDb = strpos($pageHTML, "'", $posQote1MapDb);
$varMapDb = substr($pageHTML, $posQote1MapDb, $posQote2MapDb - $posQote1MapDb);
log_message('debug', 'found mapdb : ' . $varMapDb);
$this->mapDb = $varMapDb;
// Idem pour var networks
$posNetworks = strpos($pageHTML, 'var networks');
$posQote1Networks = strpos($pageHTML, '"', $posNetworks) + 1;
$posQote2Networks = strpos($pageHTML, '"', $posQote1Networks);
$varNetworks = strtolower(substr($pageHTML, $posQote1Networks, $posQote2Networks - $posQote1Networks));
log_message('debug', 'found networks : ' . $varNetworks);
$this->networks = $varNetworks;
// Idem pour var mapdbkey
$posMapdDbKey = strpos($pageHTML, 'var mapdbkey');
$posQote1MapDbKey = strpos($pageHTML, "'", $posMapdDbKey) + 1;
$posQote2MapDbKey = strpos($pageHTML, "'", $posQote1MapDbKey);
$varMapDbKey = substr($pageHTML, $posQote1MapDbKey, $posQote2MapDbKey - $posQote1MapDbKey);
log_message('debug', 'found mapdbkey : ' . $varMapDbKey);
$this->mapDbKey = $varMapDbKey;
$this->jsonUrl = $this->getJsonUrl();
log_message('debug', 'found jsonUrl : ' . $this->jsonUrl);
}
else
{
$httpError = "Aucune information";
if(isset($http_response_header))
$httpError = getHttpError($http_response_header);
log_message('error', 'Chargement des données contenant la clé impossible : ' . $httpError);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function affichePiedPage()\r\n\t\t{\r\n\t\t//appel de la vue du pied de page\r\n\t\trequire 'Vues/piedPage.php';\r\n\t\t}",
"private function pagProbleem()\n\t{\n\t\t$pageOutput = $this->menu();\n\t\t$pageOutput.= $this->div('open', 'id=\"inhoud\"');\n\t\t$pageOutput.= $this->h1('full', '', 'Er is iets misgelopen!');\n\t\t$pageOutput.= $this->div('close');\n\t\treturn $pageOutput;\n\t}",
"public function indexTypo3PageContent() {}",
"public function contenuAutrePage(){\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['AUTRE'])) {\n\t\t\t$this->ajouterErreur(\"Les autres pages ne sont pas définie !\");\n\t\t\treturn;\n\t\t}\n\t\treturn $this->dataInfos['XMLPM']['PAGES']['AUTRE'];\n\t}",
"protected function getPage() {}",
"protected function getPage() {}",
"public function prePageContent();",
"public function getPage() {}",
"public function getPage() {}",
"public function pagelisteMembre(){\n \n $userModel = new User();\n $lisAllUser = $userModel->getAllUser(bdd::GetInstance());\n\n //Récupération du rôle du compte\n $role = UserController::roleNeed();\n $isConnected = 1;\n\n return $this->twig->render('Dashboard/listeMembre.html.twig',[\n 'allContact'=> $lisAllUser,\n 'role'=>$role,\n 'isConnected' => $isConnected\n ]);\n\n }",
"public function get_page();",
"public function contenuPremierePage(){\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['PREMIERE'])) {\n\t\t\t$this->ajouterErreur(\"La première page n'est pas définie !\");\n\t\t\treturn;\n\t\t}\n\t\treturn $this->dataInfos['XMLPM']['PAGES']['PREMIERE'];\n\t}",
"function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }",
"public function pageAccueilAction(){\n\t\t$cm = new ColumnManager();\n\t\t$tm = new TaskManager();\n\n\t\t$columns = $cm->getColumns(10); // arg : limit\n\t\trequire (\"vue/vue_accueil.php\");\n\n\t}",
"abstract protected function view_generatePageContent();",
"public function contenuDernierePage(){\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['DERNIERE'])) {\n\t\t\t$this->ajouterErreur(\"La dernière page n'est pas définie !\");\n\t\t\treturn;\n\t\t}\n\t\treturn $this->dataInfos['XMLPM']['PAGES']['DERNIERE'];\n\t}",
"public function getData(): ContuctUsPage;",
"public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}",
"public function getPage();",
"private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\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 function main()\n {\n $lang = $this->getLanguageService();\n // Access check...\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $access = is_array($this->pageinfo) ? 1 : 0;\n // Content\n $content = '';\n if ($this->id && $access) {\n // Initialize permission settings:\n $this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);\n $this->EDIT_CONTENT = $this->contentIsNotLockedForEditors();\n\n $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);\n\n // override the default jumpToUrl\n $this->moduleTemplate->addJavaScriptCode('jumpToUrl', '\n function jumpToUrl(URL,formEl) {\n if (document.editform && TBE_EDITOR.isFormChanged) { // Check if the function exists... (works in all browsers?)\n if (!TBE_EDITOR.isFormChanged()) {\n window.location.href = URL;\n } else if (formEl) {\n if (formEl.type==\"checkbox\") formEl.checked = formEl.checked ? 0 : 1;\n }\n } else {\n window.location.href = URL;\n }\n }\n ');\n $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '\n if (top.fsMod) {\n top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';\n top.fsMod.navFrameHighlightedID[\"web\"] = \"pages' . (int)$this->id . '_\"+top.fsMod.currentBank; ' . (int)$this->id . ';\n }\n ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '\n function deleteRecord(table,id,url) { //\n window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')\n . ' + table + \"][\" + id + \"][delete]=1&redirect=\" + encodeURIComponent(url) + \"&prErr=1&uPT=1\";\n return false;\n }\n ');\n\n // Find backend layout / columns\n $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);\n if (!empty($backendLayout['__colPosList'])) {\n $this->colPosList = implode(',', $backendLayout['__colPosList']);\n }\n // Removing duplicates, if any\n $this->colPosList = array_unique(GeneralUtility::intExplode(',', $this->colPosList));\n // Accessible columns\n if (isset($this->modSharedTSconfig['properties']['colPos_list']) && trim($this->modSharedTSconfig['properties']['colPos_list']) !== '') {\n $this->activeColPosList = array_unique(GeneralUtility::intExplode(',', trim($this->modSharedTSconfig['properties']['colPos_list'])));\n // Match with the list which is present in the colPosList for the current page\n if (!empty($this->colPosList) && !empty($this->activeColPosList)) {\n $this->activeColPosList = array_unique(array_intersect(\n $this->activeColPosList,\n $this->colPosList\n ));\n }\n } else {\n $this->activeColPosList = $this->colPosList;\n }\n $this->activeColPosList = implode(',', $this->activeColPosList);\n $this->colPosList = implode(',', $this->colPosList);\n\n $content .= $this->getHeaderFlashMessagesForCurrentPid();\n\n // Render the primary module content:\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n $content .= '<form action=\"' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '\" id=\"PageLayoutController\" method=\"post\">';\n // Page title\n $content .= '<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';\n // All other listings\n $content .= $this->renderContent();\n }\n $content .= '</form>';\n $content .= $this->searchContent;\n // Setting up the buttons for the docheader\n $this->makeButtons();\n // @internal: This is an internal hook for compatibility7 only, this hook will be removed without further notice\n if ($this->MOD_SETTINGS['function'] != 1 && $this->MOD_SETTINGS['function'] != 2) {\n $renderActionHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'];\n if (is_array($renderActionHook)) {\n foreach ($renderActionHook as $hook) {\n $params = [\n 'deleteButton' => $this->deleteButton,\n ''\n ];\n $content .= GeneralUtility::callUserFunction($hook, $params, $this);\n }\n }\n }\n // Create LanguageMenu\n $this->makeLanguageMenu();\n } else {\n $this->moduleTemplate->addJavaScriptCode(\n 'mainJsFunctions',\n 'if (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';'\n );\n $content .= '<h1>' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '</h1>';\n $view = GeneralUtility::makeInstance(StandaloneView::class);\n $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));\n $view->assignMultiple([\n 'title' => $lang->getLL('clickAPage_header'),\n 'message' => $lang->getLL('clickAPage_content'),\n 'state' => InfoboxViewHelper::STATE_INFO\n ]);\n $content .= $view->render();\n }\n // Set content\n $this->moduleTemplate->setContent($content);\n }",
"function Pagina() {\r\n extract($GLOBALS);\r\n\r\n if ($w_menu == '') {\r\n $sql = new db_getLinkData; $RS = $sql->getInstanceOf($dbms, $w_cliente, $SG);\r\n $w_modulo = f($RS,'sq_modulo');\r\n $sql = new db_getMenuData; $RS_Menu = $sql->getInstanceOf($dbms,f($RS,'sq_menu'));\r\n } else {\r\n $sql = new db_getMenuData; $RS_Menu = $sql->getInstanceOf($dbms,$w_menu);\r\n $w_modulo = f($RS_Menu,'sq_modulo');\r\n } \r\n\r\n Cabecalho();\r\n head();\r\n ShowHTML('<TITLE>'.$conSgSistema.' - Ajuda - '.f($RS_Menu,'nome').'</TITLE>');\r\n ShowHTML('</HEAD>');\r\n BodyOpenClean('onLoad=this.focus();');\r\n ShowHTML('<B><FONT COLOR=\"#000000\">'.$w_TP.'</font></B>');\r\n\r\n ShowHTML('<div align=center><center>');\r\n if ($w_sq_modulo>\"\") {\r\n ShowHTML('<center><B>Clique <a class=\"HL\" href=\"javascript:history.back(1);\">aqui</a> para voltar à tela anterior</b></center>');\r\n } \r\n\r\n\r\n ShowHTML('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n\r\n ShowHTML(' <tr valign=\"top\"><td colspan=2>');\r\n ShowHTML(' <font face=\"Arial\" size=\"3\"><b>'.upper(f($RS_Menu,'nome')).'</font></b><hr>');\r\n ShowHTML(' <font size=\"2\"><DL><DT><b>Finalidade:</b><DD>'.f($RS_Menu,'finalidade').'</DD></DT>');\r\n if (f($RS_Menu,'tramite')=='S') ShowHTML(' <DT><br><b>Como funciona:</b><DD>'.crlf2br(f($RS_Menu,'como_funciona')));\r\n ShowHTML(' </td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><br></td></tr>');\r\n \r\n // Verifica se tem sub-menu e exibe\r\n $SQL = new db_getLinkdataHelp; $RS = $SQL->getInstanceOf($dbms, $w_cliente,$w_modulo,0,f($RS_Menu,'sq_menu'));\r\n if (count($RS)>0) {\r\n ShowHTML(' <tr><td colspan=\"2\"><br><font size=\"2\"><b>TELAS CONTIDAS<hr NOSHADE color=#000000 SIZE=1></b></font></td></tr>');\r\n ShowHTML(' <tr valign=\"top\"><td colspan=2><font size=2><DL>');\r\n $w_cont1 = 0;\r\n foreach ($RS as $row) {\r\n $w_cont1++;\r\n ShowHTML(' <DT><B>'.$w_cont1.'. '.f($row,'nome').'</B><DD>'.crlf2br(f($row,'finalidade')));\r\n }\r\n ShowHTML(' </DL>');\r\n }\r\n \r\n // Verifica se tem trâmites e exibe\r\n if (f($RS_Menu,'tramite')=='S') {\r\n $SQL = new db_getTramiteList; $RS_Tramite = $SQL->getInstanceOf($dbms, f($RS_Menu,'sq_menu'),null, null, null);\r\n if (count($RS_Tramite) > 0) {\r\n ShowHTML(' <tr><td colspan=\"2\"><font size=\"2\"><b>FASES<hr NOSHADE color=#000000 SIZE=1></b></font></td></tr>');\r\n ShowHTML(' <tr valign=\"top\"><td colspan=2><table width=100% border=\"1\" bordercolor=\"#00000\">');\r\n ShowHTML(' <tr align=\"center\" valign=\"top\">');\r\n ShowHTML(' <td><b>Ordem</td>');\r\n ShowHTML(' <td><b>Nome</td>');\r\n ShowHTML(' <td><b>Descricao</td>');\r\n ShowHTML(' <td><b>Quem cumpre</td>');\r\n ShowHTML(' </tr>');\r\n foreach ($RS_Tramite as $row_tramite) {\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td align=\"center\">'.f($row_tramite,'ordem').'</td>');\r\n ShowHTML(' <td>'.f($row_tramite,'nome').'</td>');\r\n ShowHTML(' <td>'.Nvl(f($row_tramite,'descricao'),\"---\").'</td>');\r\n ShowHTML(' <td>'.Nvl(f($row_tramite,'nm_chefia'),\"---\").'</td>');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n } \r\n ShowHTML(' </table>');\r\n } \r\n } \r\n ShowHTML(' </table></td></tr>');\r\n ShowHTML(' </tr></tr></td></table>');\r\n ShowHTML(' </table>');\r\n ShowHTML('</table>');\r\n\r\n if ($w_sq_modulo>'') {\r\n ShowHTML('<center><B>Clique <a class=\"HL\" href=\"javascript:history.back(1);\">aqui</a> para voltar à tela anterior</b></center>');\r\n } \r\n\r\n ShowHTML('</center>');\r\n Rodape();\r\n\r\n return $function_ret;\r\n}",
"public static function getPage() {\n $page = self::$_folder . DS . self::cPage() . \".php\";\n //bien page tra ve duong dan den mot trang nao do trong folder pages\n //dem vao trong phan core de require\n //vd nhu vao trang chu ecommerce/index.php thi se ham nay se require trang pages/index.php\n $error = self::$_folder . DS . \"error.php\";\n //bien error tra ve trang error, la trang 404 trang nay khong ton tai\n return is_file($page) ? $page : $error;\n //kiem tra xem co ton tai file nhu vay o duong dan trong bien page khong, neu co thi tra ve duong dan do\n //neu khong ton tai thi tra ve file error\n //sau do ham core se require error php, dem noi dung cua trang php ra cho ng xem\n \n }",
"private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }",
"public function index()\n\t{\n\t\t$data['title'] = \"Lettre d'engagement - Fiche de renseignement personnel\";\n\t\t$page = $this->load->view('V_lettre', $data, true);\n $pagescript = $this->load->view('commun/V_scriptmain', $data, true);\n\n $this->load->view('commun/V_template', array('contenu' => $page , 'scripts' => $pagescript));\n\n \n\n\t}",
"function index() {\r\n $this->page();\r\n }",
"public function ee_breakouts_page_load() {}",
"static public function page($contenu, $title=\"\") {\n\t\t$resultat = '';\n\t\t$resultat .= static::page_avant($title);\n\t\t$resultat .= $contenu;\n\t\t$resultat .= static::page_apres();\n\t\treturn $resultat;\n\t}",
"function cao_vip_page() {\r\n}",
"abstract protected function render_page_content(): void;",
"abstract protected function getPage() ;",
"protected function getPage(){\n // print_r($_GET);\n // sprawdzanie czy jest sie na podstronie\n if($page_action = ClassTools::getValue('page_action')){\n switch($page_action){\n case 'dodaj':\n // ladowanie strony z formularzem\n return $this->getPageAdd();\n break;\n case 'edytuj':\n // ladowanie strony z formularzem\n return $this->getPageEdit();\n break;\n case 'podglad':\n // ladowanie strony z podgladem\n return $this->getPageView();\n break;\n }\n }\n \n return $this->getPageList();\n }",
"public function contato() {\n $this->load_template('contato');\n }",
"public static function cPage() {\n return isset($_GET[self::$_page]) ?\n $_GET[self::$_page] : 'index';\n //neu nhu bien page da duoc set thi ten trang chinh la bien page, neu chua duoc set thi la trang chu index\n }",
"public function get_page_info()\n {\n }",
"public function getContent(){\n return $this->getPage();\n }",
"public function Carregar_Pagina() : void\n {\n $view = $this->Retornar_Pagina();\n \n $view->set_peca_id($this->obj_contato_anunciante->get_obj_peca()->get_id());\n \n $view->Executar();\n }",
"public function pagesOnly() {}",
"function get(){\n\t$temp = $this->page;\n\t$this->addFooter();\n\t//restore the page for next call for\n\t$page= $this->page;\n\t$this->page = $temp;\n\n return $this->page;\n}",
"public function getPageData();",
"public function mostrarPagina() {\n $objCliente = new CadastroView();\n $objCliente->mostrarTopo();\n $objCliente->mostrarConteudo();\n $objCliente->mostrarRodape();\n }",
"public function profil()\n {\n # echo '<h1>JE SUIS LA PAGE PROFIL</h1>';\n $this->render('membre/profil');\n }",
"public function tempPageCacheContent() {}",
"public function pageOne()\n {\n\n\n View::show(\"pageOne.php\", \"pageOne\");\n }",
"public function reqBiblePage() {\n $this->instance = new Bible();\n $this->view($this->instance->getBible(false, false), 'bible', 'Bíblia');\n }",
"public function realPageCacheContent() {}",
"public function accueil(){\n\t\t$data = array(\n\t\t\t'title'=> $this->titre\n\t\t);\n\n\t\t$this->load->view('common/header', $data);\n $this->load->view('site/index', $data);\n $this->load->view('common/footer', $data);\n\t}",
"public function allpagesActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla pages i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n CASE \n WHEN (deleted <= NOW()) THEN \"isDeleted\"\n WHEN (published <= NOW()) THEN \"isPublished\"\n ELSE \"notPublished\"\n END AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"page\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allpages\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }",
"public function enlazarPagina()\n\t\t{\n\t\t\t//Se obtiene la accion por medio de paso de variable y entonces se incluye la vista segun sea la accion\n\t\t\tif(isset($_GET['action']))\n\t\t\t{\n\t\t\t\t$enlace = $_GET['action'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$enlace = 'inicio';\n\t\t\t}\n\n\t\t\t$respuesta = Informacion::enlazador($enlace);\n\t\t\tinclude($respuesta);\n\t\t}",
"public function accueil()\n {\n $this->view->articles = ArticleModel::getAllArticles();\n $this->view->display(\"home/home\");\n }",
"public function pageconnexionerreur(){\n\t\t$vue = new Vue(\"ConnexionErreur\");\n\t\t$vue->generer(array());\n\t}",
"public function initPage() {}",
"public function initPage() {}",
"function load_page($args=''){//$page,$maxrows,$order,$ordertype,$capa,\n\t\t$r= getResponse();\t\t\n\t\tsetLocaleMode();\n\t\tif (!xvalidaAcceso($r,PAGE_PRIV)){\n\t\t\t$r->assign($capa,inner,'Acceso denegado');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t//$r->alert($args);\n\t\t$c = new connection();\n\t\t$c->open();\n\t\t\n\t\t\n\t\t$sa_paquetes = $c->sa_v_paquetes;\n\t\t$query = new query($c);\n\t\t$query->add($sa_paquetes);\n\t\t$paginador = new fastpaginator('xajax_load_page',$args,$query);\n\t\t$arrayFiltros=array(\n\t\t\t'Empresa'=>array(\n\t\t\t\t'change'=>'h_empresa',\n\t\t\t\t'addevent'=>\"obj('empresa').value='';\"\n\t\t\t),\n\t\t\t'busca'=>array(\n\t\t\t\t'title'=>'Búsqueda',\n\t\t\t\t'event'=>'restablecer();'\n\t\t\t),\n\t\t\t'fecha'=>array(\n\t\t\t\t'title'=>'Fecha'\n\t\t\t)\n\t\t);\n\t\t$argumentos = $paginador->getArrayArgs();\n\t\t$aplica_iva=($argumentos['iva']==1);\n\t\t$id_empresa=$argumentos['h_empresa'];\n\t\t$query->where(new criteria(sqlEQUAL,$sa_paquetes->id_empresa,$id_empresa));\n\t\t\n\t\tif($id_empresa==null){\n\t\t\t$r->assign($paginador->layer,inner,'Seleccione una Empresa');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t$rec=$paginador->run();\n\t\tif($rec){\n\t\t\tforeach($rec as $v){\n\t\t\t\t//buscando las unidades basicas del paquete\n\t\t\t\t$unidades=$c->sa_v_informe_tempario_unidades->doSelect($c, new criteria(sqlEQUAL,'id_paquete',$v->id_paquete))->getAssoc('id_paq_unidad','nombre_unidad_basica');\n\t\t\t\t$lista_unidades=implode(',',$unidades);\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"40%\" /><thead>';\n\t\t\t\t\n\t\t\t\t$html.='<tr><td>PAQUETE</td><td>Descripción</td><td>Unidades</td></tr></thead><tbody>';\n\t\t\t\t$html.='<tr><td>'.$v->codigo_paquete.'</td><td>'.$v->descripcion_paquete.'</td><td>'.$lista_unidades.'</td></tr></tbody></table>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"20%\" /><thead><tr><td>Codigo</td><td>Descripción</td><td>Unidad</td><td>Cantidad</td><td style=\"display:none;\">Precio</td><td style=\"display:none;\">Importe</td></tr></thead><tbody>';\n\t\t\t\t//cargando los detalles de tempario\n\t\t\t\t$sa_v_paq_tempario=$c->sa_paq_tempario;\n\t\t\t\t$sa_tempario= new table('sa_v_tempario','',$c);\n\t\t\t\t$join= $sa_tempario->join($sa_v_paq_tempario,$sa_tempario->id_tempario,$sa_v_paq_tempario->id_tempario);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_tempario->id_paquete,$v->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $temp){\n\t\t\t\t\t\t$html.='<tr><td>'.$temp->codigo_tempario.'</td><td>'.$temp->descripcion_tempario.'</td><td>'.$temp->descripcion_modo.'</td><td>N/A</td><td style=\"display:none;\">'.$temp->precio.'</td><td style=\"display:none;\">'.$temp->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sa_v_paq_repuestos=$c->sa_paquete_repuestos;\n\t\t\t\t$iv_articulos= new table('iv_articulos','',$c);\n\t\t\t\t$join= $iv_articulos->join($sa_v_paq_repuestos,$iv_articulos->id_articulo,$sa_v_paq_repuestos->id_articulo);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_repuestos->id_paquete,$rec->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $rep){\n\t\t\t\t\t\t$html.='<tr><td>'.$rep->codigo_articulo.'</td><td>'.$rep->descripcion.'</td><td>'.$rep->unidad.'</td><td>'.$rep->cantidad.'</td><td style=\"display:none;\">'.$rep->precio.'</td><td style=\"display:none;\">'.$rep->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html.='</tbody></table><br />';\n\t\t\t}\n\t\t}\n\t\t$html.='<br />Informe Generado el '.date(DEFINEDphp_DATETIME12).' - Empresa: '.$argumentos['Empresa'].'<strong>'.$tiva.'</strong>';\n\t\t$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div>');\n\t\t\n\t\t/*if($argumentos['busca']!=''){\n\t\t\t$query->where(\n\t\t\t\tnew criteria(sqlOR, array(\n\t\t\t\t\tnew criteria(' like ',$sa_paquetes->descripcion_paquete,\"'%\".$argumentos['busca'].\"%'\")//,\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->chasis,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->color,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$c->pg_empresa->nombre_empresa,\"'%\".$argumentos['busca'].\"%'\")\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t}\n\t\tif($argumentos['fecha']!=''){\n\t\t\t$query->where(new criteria(' = ',\"DATE_FORMAT(\".$sa_paquetes->fecha_rev.\",'%d-%m-%Y')\",\"'\".$argumentos['fecha'].\"'\"));\t\t\t\n\t\t}\n\t\tif($argumentos['h_empresa']!=''){\n\t\t\t$query->where(new criteria(sqlEQUAL,\"id_empresa\",\"'\".$argumentos['h_empresa'].\"'\"));\t\t\t\n\t\t}else{\n\t\t\t$arrayFiltros['Empresa']['hidden']=1;\n\t\t}*/\n\t\t//$r->alert($argumentos['h_empresa']);\n\t\t\n\t\t//$rec=$paginador->run();\n\t\t\n\t\t/*if($rec){\n\t\t\tif($rec->getNumRows()==0){\n\t\t\t\t$html.='<div class=\"order_empty\">No se han encontrado registros</div>';\n\t\t\t}else{\n\t\t\t\t$html.='<table class=\"order_table\"><thead><tr class=\"xajax_order_title\">\n\t\t\t\t\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->id_paquete,'ID').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->codigo_paquete,'Código').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->descripcion_paquete,'Descripción').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->nombre_empresa_sucursal,'Empresa').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->fecha_rev,'Fecha').'</td>\n\t\t\t\t</tr></thead><tbody>';\n\t\t\t\t$class='';\n\t\t\t\tforeach($rec as $v){\n\t\t\t\t\tif ($rec->parcial == '1')\n\t\t\t\t\t\t$parcial = 'Si';\n\t\t\t\t\telse\n\t\t\t\t\t\t$parcial = 'No';\n\t\t\t\t\t$html.='<tr class=\"'.$class.'\">\n\t\t\t\t\t\n\t\t\t\t\t<td align=\"center\">'.$rec->id_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->codigo_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->descripcion_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->nombre_empresa_sucursal.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->fecha_rev.'</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t\tif($class==''){\n\t\t\t\t\t\t$class='impar';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$class='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html.='</tbody></table>';\n\t\t\t}\n\t\t\t\n\t\t}*/\n\t\t\n\t\t$r->assign($paginador->layer,inner,$html);\n\t\t\n\t\t\n\t\t//$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div><div class=\"ifilter\">'.$paginador->getRemoveFilters('datos',$arrayFiltros).'</div>');\n\n\t\t$r->assign('campoFecha','value',$fec);\n\t\t\n\t\t$r->script($paginador->fillJS('datos'));\n\t\n\t\t$c->close();\n\t\treturn $r;\n\t}",
"function afficher()\r\n\t{\r\n\t\t\r\n\t\tif (!empty($this->zones) || !empty($this->blocs) )\r\n\t\t{\r\n\t\t\t//:: On configure les zones obligatoires\r\n\t\t\t\tif (empty($this->zones['Menu_Log'])) $this->zone('Menu_Log', menu('membre'));\r\n\r\n\t\t\t\tif (empty($this->zones['description'])) $this->zone('description', DESCRIPTION);\r\n\t\t\t\tif (empty($this->zones['keywords'])) $this->zone('keywords', KEYWORDS);\r\n\t\t\t\t$this->zone('nom', NOM);\r\n\t\t\t\t\r\n\t\t\t\t// On s'occupe du chemin des fichiers\r\n\t\t\t\t$this->zone( 'baseUrl', URL ); $this->zone( 'design', $this->style );\r\n\t\t\t\t\r\n\t\t\t\tif (is_admin()) $this->zone('jvs-admin', '<script type=\"text/javascript\" src=\"javascript/-admin.js\"></script>');\r\n\t\t\t\t\r\n\t\t\t\t// Nouveaux messages \r\n\t\t\t\r\n\t\t\t\t// Antibug\r\n\t\t\t\tif ($this->zones['img_titre']!=\"<!-- rien -->\") $this->zone('img_titre', '<img src=\"theme/images/content.png\" class=\"title\" alt=\"\" />');\r\n\t\t\t\t\t\t\t\r\n\t\t\t// Ouverture du template //\r\n\t\t\t$fichier=$this->chemin.$this->template.'.tpl.php';\r\n\t\t\t$source = fopen($fichier, 'r');\r\n\t\t\t$this->design = fread($source, filesize ($fichier));\r\n\t\t\tfclose($source);\r\n\t\t\t\r\n\t\t\t// Parsage du template\r\n\t\t\tforeach ($this->zones as $zone => $contenu)\r\n\t\t\t{\r\n\t\t\t\t$this->design = preg_replace ('/{::'.$zone.'::}/', $contenu, $this->design);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Suppresion des {::xxxx::} inutilisées\r\n\t\t\t$this->design = preg_replace ('/{::[-_\\w]+::}/', '', $this->design);\r\n\r\n\t\t\t// On remplace les blocs par leurs contenus //\r\n\t\t\tforeach($this->blocs as $nomBloc => $occurences)\r\n\t\t\t{\r\n\t\t\t\tpreg_match( '#{--'.$nomBloc.'--}(.*){--/'.$nomBloc.'/--}#ms', $this->design, $contenuBloc );\r\n\t\t\t\t$contenuBloc=$contenuBloc[1];\r\n\t\t\t\t\r\n\t\t\t\t$idNewTab=0; unset($nomZones);\r\n\t\t\t\tforeach($occurences as $occurence => $zones)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($nomZones))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$nomZones=$zones;\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$i=0;\r\n\t\t\t\t\t\t$newBloc[$idNewTab]=$contenuBloc;\r\n\t\t\t\t\t\tforeach($zones as $remplacement)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$newBloc[$idNewTab]=preg_replace ('/{:'.$nomZones[$i].':}/', $remplacement, $newBloc[$idNewTab]);\r\n\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$idNewTab++;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t$newContenuBloc=implode(\"\", $newBloc);\r\n\t\t\t\t$this->design = preg_replace ('#{--'.$nomBloc.'--}(.*){--/'.$nomBloc.'/--}#ms', $newContenuBloc, $this->design);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Suppression des blocs inutilisés\r\n\t\t\t$this->design = preg_replace ('#{--(.*)--}(.*){--/(.*)/--}#ms', '', $this->design);\r\n\r\n\t\t\t\r\n\t\t\t// Affichage du résultat final\r\n\t\t\t//$this->design = preg_replace ('/('.CHR(9).'|'.CHR(13).'|'.CHR(10).')/', \"\", $this->design);\r\n\r\n\t\t\t// Affichage du résultat final\r\n\t\t\techo $this->design;\r\n\t\t}\r\n\t}",
"function main()\n {\n $this->page_id = 113;\n $this->get_text();\n $this->body .= \"<table cellpadding=5 cellspacing=1 border=0 width=\\\"100%\\\">\\n\";\n if (strlen(trim($this->messages[500021])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_title\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500021] . \"</td>\\n</tr>\\n\";\n }\n if (strlen(trim($this->messages[500022])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_message\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500022] . \"</td>\\n</tr>\\n\";\n }\n $this->body .= \"<tr>\\n\\t<td valign=top>\\n\\t\";\n if (!$this->browse_main()) {\n $this->browse_error();\n }\n $this->body .= \"</td>\\n</tr>\\n\";\n $this->body .= \"</table>\\n\";\n $this->display_page();\n return true;\n }",
"public function pagina_principal() {\n\t\t$customData['barrios'] = $this->Data_model->list_barrios();\n\t\t$customData['generos'] = $this->Data_model->list_generos();\n\t\treturn $this->parser->parse('content.html', $customData, true);\n\t}",
"public function connexion()\n {\n # echo '<h1>JE SUIS LA PAGE CONNEXION</h1>';\n $this->render('membre/connexion');\n }",
"protected function mainContent()\n {\n ob_start();\n\n $personne = $this->personne;\n\n $mort = $personne->getMort();\n if ($mort == -1) {\n $mort = \"AUJOURD'HUI\";\n }\n ?>\n <article class=\"show\" id=\"<?php echo $personne->getId(); ?>\">\n <header>\n <?php echo $personne->getNom() . ' ' . $personne->getPrenom() . '<br />' . utf8_encode($personne->getNaissance()) . ' - ' . $mort; ?>\n </header>\n <aside>\n <?php\n if ($personne->portrait) {\n foreach($personne->portrait as $photo) {\n echo '<img src=\"' . $photo->getSrc() . '\"/>';\n }\n } else {\n echo '<div class=\"noimage\">PAS DE PHOTO</div>';\n }\n ?>\n </aside>\n <section>\n <h2>Filmographie</h2>\n <h3>Rôles</h3>\n <p>\n <?php\n $roles = $this->roles;\n $films_roles = $this->films_roles;\n if(!$roles) { ?>\n Cette personne n'a joué dans aucun film.<br/><br/>\n <?php } else {\n foreach($roles as $role) {\n echo '<u>'.$role->getTitreFilm().'</u> en tant que <b>'.$role->getRole()->nom.'</b><br />';\n } ?>\n <?php } ?>\n </p>\n <h3>Productions</h3>\n <p>\n <?php\n $productions = $this->productions;\n if(!$productions) { ?>\n Cette personne n'a réalisé aucun film.<br/><br/>\n <?php } else {\n echo 'Voir la liste ci-après';\n } ?>\n </p>\n </section>\n <section class=\"right\">\n <p>Nationalité :\n <?php echo $personne->getNationalite(); ?>\n </p>\n\n <p>Sexe :\n <?php\n if ($personne->isSexeFeminin()) {\n echo 'Femme';\n } else {\n echo 'Homme';\n }\n ?>\n </p>\n </section>\n <footer>\n <?php\n if (isset($_SESSION['id'])) {\n echo '<a id=\"iframe\" href=\"./index.php?controller=ActeurRea&action=edit&id='. $personne->getId() .'\">Editer</a> ';\n echo '<a id=\"iframe\" href=\"./index.php?controller=ActeurRea&action=delete&id=' . $personne->getId() . '\">Supprimer</a>';\n }\n ?>\n </footer>\n </article>\n <articles id=\"liste\">\n <?php if($productions) {\n $params['films'] = $productions;\n (new Print_Films_View($params))->display();\n } elseif($films_roles) {\n $params['films'] = $films_roles;\n (new Print_Films_View($params))->display();\n } ?>\n </articles>\n<?php\n $content = ob_get_contents();\n ob_end_clean();\n\n return $content;\n }",
"function getPageContent($pageName){\n\t\t\t$pageContent = $this->manage_content->getValue_where('otherpage','*','page',$pageName);\n\t\t\techo $pageContent[0]['content'];\n\t\t}",
"public function showAction()\n {\n $em =$this->getDoctrine()->getManager();\n $liste = $em->getRepository('ProduitBundle:PanierProduit')->findAll();\n\n $prixtotal=0;\n $somme=0;\n foreach ($liste as $value)\n {\n $prixtotal=$value->getPrix();\n $somme=$prixtotal+$somme;\n }\n\n $tab=array(\"somme\"=>$somme);\n\n return $this->render('@Eco/Panier/page_index_panier.html.twig', array(\n 'liste'=> $liste,'tab'=> $tab));\n\n }",
"function page()\n {\n $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n # print_r($data);\n # exit();\n\n #Get the paginated list of the news items\n $data = add_msg_if_any($this, $data);\n\n //if user has permission\n if (check_user_access($this, 'view_procurement_plans')) \n {\n $search_str = '';\n if($this->session->userdata('isadmin') == 'N')\n {\n $userdata = $this->db->get_where('users', array('userid'=>$this->session->userdata('userid')))->result_array();\n $search_str = ' AND PP.pde_id=\"'. $userdata[0]['pde'] .'\"';\n }\n \n \n #Get the paginated list of plans\n $data['procurement'] = paginate_list($this, $data, 'procurement_plans', array('orderby'=>'PP.financial_year DESC', 'searchstring'=>$search_str));\n #exit($this->db->last_query());\n $data['page_title'] = 'Manage procurement plans';\n $data['current_menu'] = 'view_procurement_plans';\n $data['view_to_load'] = 'procurement/admin/all_procurement_plans_v';\n $data['view_data']['form_title'] = $data['page_title'];\n $this->load->view('dashboard_v', $data);\n \n } else {\n //load access denied page\n load_restriction_page();\n\n }\n\n\n }",
"function renderResponse() {\n // le header contient le début de la page jusqu'à la balise <body>\n // on redéclare title pour le header\n $header = new View('global.header', array('title' => $this->title));\n echo $header->getHtml();\n\n\n // le menu est composé de la balise <nav> et de ses items\n $menu = new View('global.menu');\n echo $menu->getHtml();\n\n /* début corps de page */\n\n // on affiche les messages éventuels\n $this->showMessages();\n\n // on affiche le contenu principal de la page\n\n echo $this->content;\n\n /* fin corps de page */\n\n // on affiche le footer et on ferme la page html\n $footer = new View('global.footer');\n echo $footer->getHtml();\n }",
"public function page_tindakan(){\n\t\t$data['list'] = $this->tindakan_m->list_tindakan();\n\t\t$data['list_tindakan_golongan'] = $this->tindakan_m->list_tindakan_golongan();\n\t\t$data['isi'] = \"tindakan/page-tindakan\";\n\t\t$data['title'] = 'Daftar Tindakan';\n\t\t$this->load->view('layout',$data);\n\t}",
"private function pagERROR404()\n\t{\n\t\t$tekst = new TekstVerwerken;\n\t\t\n\t\t$pageOutput = $this->menu();\n\t\t$pageOutput.= $this->div('open', 'id=\"inhoud\"');\n\t\t$pageOutput.= $this->h2('full', '', 'De pagina die je zoekt kon niet worden gevonden.');\n\t\t$pageOutput.= $this->p('full', 'style=\"padding: 10px\"', 'De pagina \"'.$tekst->cleanHTML($_SESSION['page']).'\" bestaat niet op de website.<br>Denk je dat dit een vergissing is, gelieve dan het contactformulier te gebruiken om dit probleem te melden. Vermeld in dit bericht zeker het gedeelte dat tussen quotes staat.');\n\t\t$pageOutput.= $this->div('close');\n\t\treturn $pageOutput;\n\t}",
"private static function getControle() {\n\n\t\t$classe = \"Index\";\n\t\t\n\t\tif( !empty( self::$rota[1] ) && self::$rota[1] != \"index.php\" ){\n\t\t\t$classe = ucfirst( self::$rota[1] );\n\t\t\tif( !class_exists( $classe ))\n\t\t\t\t$classe = \"QuatroZeroQuatro\";\n\t\t}\n\n\t\ttry {\n\t\t\n\t\t\tself::$pagina = new $classe( self::$rota );\n\t\t\tself::$pagina->init();\n\t\t\tself::$pagina->render();\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\tvar_dump( $e );\n\t\t}\n\t}",
"public function getPage()\n\t{\n\t $url = URL::segment(1);\n\t\treturn $this->crud->_where(\"url = $url\")\n\t\t\t\t\t->read('row')\n\t\t;\n\t}",
"public function page_content() {\n\t\t$tab = empty( $_REQUEST['tab'] ) ? 'new' : wp_strip_all_tags( wp_unslash( $_REQUEST['tab'] ) ); // Input var okay.\n\t\t$paged = ! empty( $_REQUEST['paged'] ) ? (int) $_REQUEST['paged'] : 1; // Input var okay.\n\n\t\t$tab = esc_attr( $tab );\n\t\t$paged = esc_attr( $paged );\n\n\t\t$filters = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'filters' );\n\t\t$defaults = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'defaults' );\n\n\t\t$args = array(\n\t\t\t'tab' => $tab,\n\t\t\t'page' => $paged,\n\t\t\t'filters' => $filters,\n\t\t\t'defaults' => $defaults,\n\t\t);\n\n\t\t$table = $this->create_list_table( $this->args['page_slug'], $this->args['parent'], $args );\n\n\t\t// Outputs the tabs, filters and search bar.\n\t\t$table->views();\n\n\t\t/**\n\t\t * Fires on the Add-ons browser tab after the top navigation bar.\n\t\t *\n\t\t * The dynamic part of the hook name refers to the tab slug (i.e. new or popular)\n\t\t *\n\t\t * @param APP_Addons_List_Table $table The content generator instance.\n\t\t */\n\t\tdo_action( \"appthemes_addons_mp_{$tab}\", $table );\n\t}",
"function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"public function getPageOpen() {}",
"public function homePage() {\n #$this->view->loadTemplate( 'elements_example');\n $this->view->loadTemplate( LNG . '/centercontent');\n $this->commitReplace($this->view->render(), '#two', true);\n }",
"public function render_content() {\n\t}",
"public function main() {\r\n // Access check!\r\n // The page will show only if there is a valid page and if this page may be viewed by the user\r\n $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);\r\n $access = is_array($this->pageinfo) ? 1 : 0;\r\n\r\n if (($this->id && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$this->id)) {\r\n\r\n // Draw the header.\r\n $this->doc = t3lib_div::makeInstance('bigDoc');\r\n $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('medbootstraptools').'res/css/bemodul.css'); \r\n $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('medbootstraptools').'res/bootstrap/css/bootstrap.min.css'); \r\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\r\n $this->doc->form = '<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\r\n\r\n // JavaScript\r\n $this->doc->JScode = '\r\n <script src=\"../typo3conf/ext/medbootstraptools/res/js/jquery-1.8.3.min.js\"></script>\r\n <script src=\"../typo3conf/ext/medbootstraptools/res/js/functions.js\"></script>\r\n <script language=\"javascript\" type=\"text/javascript\">\r\n script_ended = 0;\r\n function jumpToUrl(URL) {\r\n document.location = URL;\r\n }\r\n </script>\r\n ';\r\n $this->doc->postCode = '\r\n <script language=\"javascript\" type=\"text/javascript\">\r\n script_ended = 1;\r\n if (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\r\n </script>\r\n ';\r\n\r\n $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'\r\n . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\r\n\r\n $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));\r\n //$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));\r\n //$this->content .= $this->doc->spacer(5);\r\n //$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));\r\n //$this->content .= $this->doc->divider(5);\r\n // Render content:\r\n $this->moduleContent();\r\n\r\n // Shortcut\r\n if ($GLOBALS['BE_USER']->mayMakeShortcut()) {\r\n $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));\r\n }\r\n\r\n $this->content .= $this->doc->spacer(10);\r\n } else {\r\n // If no access or if ID == zero\r\n\r\n $this->doc = t3lib_div::makeInstance('bigDoc');\r\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\r\n\r\n $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));\r\n $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));\r\n $this->content .= $this->doc->spacer(5);\r\n $this->content .= $this->doc->spacer(10);\r\n }\r\n }",
"function printContent()\t{\n\n\t\t\t\t\t$this->content.=$this->doc->endPage();\n\t\t\t\t\techo $this->content;\n\t\t\t\t}",
"function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form = '<form action=\"\" method=\"post\">';\n\n\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL) {\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . intval($this->id) . ';\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content .= $this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content .= $this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content .= $this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}",
"public function pageContent()\r\n\t{\r\n\t\t$this->displayList();\r\n\t\t$content = '\r\n<div align=\"center\"><table width=\"60%\" border=\"1\" class=\"infoView\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"col\">Manage a Department</th>\r\n </tr>\r\n \t '.$this->dList.'\r\n </tbody>\r\n</table></div>\r\n\t\t';\r\n\t\treturn $content;\r\n\t}",
"public function loket()\n\t{\n\n\t\t$data['data_loket'] = $this->model_admin->get_loket();\n\t\t$data['halaman'] = 'view_loket';\n\t\t$this->load->view('admin/page', $data);\n\t}",
"public function contuctUs()\n {\n return view('Front.page.contuctus');\n }",
"function printContent()\t{\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function pasien()\n\t{\n\t\t$data['pasien'] \t\t= $this->Kesehatan_M->readS('pasien')->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/daftar_pasien',$data);\n\t\t$this->load->view('static/footer');\n\t}",
"public static function showHomePage()\n {\n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_home_azienda.php\");\n $vd->setContentFile(\"../view/in/azienda/home_page_azienda.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once \"../view/Master.php\";\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 }",
"public function getPage(){\n return $this->page;\n }",
"public function action() {\n // $this->view->page();\n }",
"function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"bigDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form='<form action=\"index.php?id='.$this->id.'\" method=\"POST\">';\n\n\t\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br />\".$LANG->sL(\"LLL:EXT:lang/locallang_core.xml:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\t\n\t\t\texec('hostname',$ret);\n\t\t\t$ret=implode(\"\",$ret);\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\") .\" on: $ret\");\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}",
"function CK04()\n {\n global $template;\n global $id,$param, $top_url;\n\n//echo \"top: $top_url\";\n\n // 상세 정보 가져온다\n $data = $this->get_detail( $id );\n\n $master_code = substr( $template, 0,1);\n include \"template/\" . $master_code .\"/\" . $template . \".htm\";\n }",
"public function show() {\n $this->buildPage();\n echo $this->_page;\n }",
"public function constancia()\n {\n $data['pdf'] = $this->Encuentro_model->list_encuentro_pdf(1);\n $this->load->view(\"theme/header\");\n $this->load->view(\"theme/menu\");\n $this->load->view(\"encuentro/constancia\",$data);\n $this->load->view(\"theme/footer\");\n }",
"function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}",
"public function AfficherPageEnCache()\n\t\t{\n\t\t\tif(!$this->cache_date_is_dispo)\n\t\t\t\texit('Affichage cache à la date '.$this->cache_date_tableau.' impossible. Class:'.__CLASS__.' - fonction: '.__FUNCTION__);\n\n\t\t\t$filename = $this->getCacheFileNameOfDate($this->cache_date_tableau);\n\t\t\trequire_once($this->chemin_dossier_cache.$filename);\n\t\t}",
"protected function makePage() {\n // \n // get the user's constituency\n // \n // get the candidates for this election in this constituency\n // \n // make the page output\n }",
"public function indexAction()\n {\n session_start();\n // On vérifie si le visiteur viens pour la premier fois sur le site\n $this->session();\n // On récuper la liste des contents\n $contents = $this->contentManager->findAllPerPage(\"index\");\n // On va récupérer le dernier article publier\n $chapterManager = new ChapterManager();\n $chapter = $chapterManager->findLastPublished();\n if (!$contents || !$chapter) {\n throw new \\Exception(\"Page introuvable\");\n }\n echo $this->render(\n 'index.html.twig',\n array('contents' => $contents, 'chapter' => $chapter),\n $_SESSION\n );\n }",
"public function page_header(){\n\t\t$e = $this->Empresa->salida;\n\t\t$this->Empresa->where('id',$this->Empresa->user);\n\t\t$fondo = $this->Empresa->getOne('empresa_fondo','img_fondo');\n\t\t\n\t\t$link = 'index.php?inmv='.$e['nik_empresa'];\t\t\n\t\t$return = '<div class=\"page-header\" style=\"background-image: url(imagenes/fondos/'.$fondo['img_fondo'].');\">';\n\t\t$return .= '<div class=\"header-info\">';\n\t\t$return .= '<div class=\"row\">';\n\t\t$return .= '<div class=\"logo-header\"><a href=\"'.$link.'\"><img src=\"imagenes/logo/'.$e['img'].'\" /></a></div>';\n\t\t$return .= '<div class=\"header-desc col-md-6 visible-md visible-lg\">';\n\t\t$return .= '<h1>'.$e['descripcion'].'</h1>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\t\treturn $return;\n\t}",
"public static function renderContent($page_data) {\n\t\techo '<h1>SOFTBAL</h1>'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Jak říká <a href=\"http://cs.wikipedia.org/wiki/Softball\" target=\"_blank\" title=\"Softbal na wikipedii\">wikipedie</a>: \"Softbal je kolektivní míčový sport, vyvinutý z baseballu jako jeho rychlejší a na prostor méně náročná verze.\" Rozepisovat tu pravidla podle mého cenu nemá, každý nechť si to v případě zájmu dohledá. Důležitější je, že je pro mě softbal důležitou součástí života, oblíbenou volnočasovou aktivitou, záminkou k cestování a také společenskou záležitostí.'.PHP_EOL;\n\t\techo '</p>'.PHP_EOL;\n\t\techo '<h2>KARIÉRA</h2>'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Softbalisti hrají na statistiky. Kdo říká, že ne, tak kecá :) Současný klub <strong>Mistrál Praha</strong> mi mé výkony posledních dvou sezón zatím tají, tak aspoň přehled z předchozích šesti let v <strong>MFF Neratovice</strong>'.PHP_EOL;\n\t\techo '</p>'.PHP_EOL;\n\t\t// stats\n\t\techo '<table>'.PHP_EOL;\n\t\t\techo '<tr>'.PHP_EOL;\n\t\t\t\techo '<th>Sezóna</th>'.PHP_EOL;\n\t\t\t\techo '<th></th>'.PHP_EOL;\n\t\t\t\techo '<th>G</th>'.PHP_EOL;\n\t\t\t\techo '<th>AB</th>'.PHP_EOL;\n\t\t\t\techo '<th>BA</th>'.PHP_EOL;\n\t\t\t\techo '<th>H</th>'.PHP_EOL;\n\t\t\t echo '<th>2B</th>'.PHP_EOL;\n\t\t\t\techo '<th>3B</th>'.PHP_EOL;\n\t\t\t\techo '<th>HR</th>'.PHP_EOL;\n\t\t\t\techo '<th>R</th>'.PHP_EOL;\n\t\t\t\techo '<th>RBI</th>'.PHP_EOL;\n\t\t\t\techo '<th>BB</th>'.PHP_EOL;\n\t\t\t\techo '<th>HB</th>'.PHP_EOL;\n\t\t\t\techo '<th>SH</th>'.PHP_EOL;\n\t\t\t\techo '<th>SB</th>'.PHP_EOL;\n\t\t\t\techo '<th>SO</th>'.PHP_EOL;\n\t\t\t\techo '<th>O</th>'.PHP_EOL;\n\t\t\t\techo '<th></th>'.PHP_EOL;\n\t\t\t\techo '<th>IP</th>'.PHP_EOL;\n\t\t\t\techo '<th>PO</th>'.PHP_EOL;\n\t\t\t\techo '<th>A</th>'.PHP_EOL;\n\t\t\t\techo '<th>E</th>'.PHP_EOL;\n\t\t\t\techo '<th>FA</th>'.PHP_EOL;\n\t\t\techo '</tr>'.PHP_EOL;\n\t\t\tif (!empty($page_data[\"stats\"])) {\n\t\t\t\tforeach ($page_data[\"stats\"] as $row) {\n\t\t\t\t\techo '<tr>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"year\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td></td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"G\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"AB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"BA\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"H\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"2B\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"3B\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"HR\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"R\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"RBI\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"BB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"HB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"SH\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"SB\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"SO\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"O\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td></td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"IP\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"PO\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"A\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"E\"].'</td>'.PHP_EOL;\n\t\t\t\t\t\techo '<td>'.$row[\"FA\"].'</td>'.PHP_EOL;\n\t\t\t\t\techo '</tr>'.PHP_EOL;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// no stats found\n\t\t\t\techo '<tr><td colspan=\"23\">Nenalezeny žádné statistiky</td></tr>'.PHP_EOL;\n\t\t\t}\n\t\techo '</table>'.PHP_EOL;\n\t\t// other soft\n\t\techo '<h2>ČESKÉ AKADEMICKÉ HRY</h2>'.PHP_EOL;\n\t\techo '<img src=\"/web/images/soft_akada.jpg\" title=\"ČAH\" alt=\"ČAH\" />'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Od roku 2009 se pravidelně účastním Českých akademických her v softbalu. Nejprve dvakrát v dresu Univerzity Karlovy a od roku 2011 zkoušíme prorazit s týmem VŠE. Jsem tronásobný akademický mistr republiky v tomto sportu: 2009 v Plzni s UK, 2010 v Praze s UK a 2014 v Liberci s VŠE.'.PHP_EOL;\n\t\techo '</p>'.PHP_EOL;\n\t\techo '<h2>ROZHODČÍ</h2>'.PHP_EOL;\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Krom toho, že mě softbal baví hrát, věnuju se také funkci rozhodčího. Rozhodčím není příliš těžké se u nás stát - stačí chtít, začít je možné prakticky hned. I já začal jako samouk v nižších soutěžích, kde si týmy často pískají navzájem, od počátku roku 2012 jsem pak oficiálně vyškolen ČSA. Od podzimu 2012 pak občas vypomáhám i v nižších soutěžích pražského baseballu. Ačkoliv je to občas vypjaté, tak mě baví zodpovědnost, kterou tato pozice přináší. A samozřejmě je tu motivační faktor finanční odměny, která není vůbec špatná.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\t\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'V roce 2012 jsem odřídil něco přes 40 zápasů, v roce 2013 celkem 110, v roce 2014 asi 35 a v roce 2015 kolem třiceti. Nakoukl jsem už i do nejvyšší mužské a ženské soutěže u nás a letos jsem byl dokonce vyslán na jeden dvojzápas do Rakouska.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\t\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'Zde je můj <a href=\"http://softball.cz/modules.php?op=modload&name=infosys&file=index&do=umpires&co=dirview&umid=85&pda=2\">rozhodcovský profil</a> na webu ČSA, kde jsou uvedeny počty nominací v nejvyšších dvou soutěžích a ligových pohárech.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\t\n\t\techo '<h2>ZAPISOVATEL</h2>'.PHP_EOL;\t\n\t\techo '<p>'.PHP_EOL;\n\t\t\techo 'O tomto víc <a href=\"/work-scorer\" title=\"Zápis baseball/softbal\">na jiné stránce</a>, ale patří to k softbalu také.'.PHP_EOL;\t\n\t\techo '</p>'.PHP_EOL;\n\t}",
"public function index()\n\t{\n\n\t\t$page_content = $this->Page_model->get_page_by_id(6);\n\n\t\t/*\n\t\t| -------------------------------------------------------------------------\n\t\t| SET DATA\n\t\t| -------------------------------------------------------------------------\n\t\t*/\n\n\t\t// Language\n\t\t$data['lang'] = $this->lang;\n\n\t\t// Title Page\n\t\t$data['title'] = unserialize($page_content->meta_tag_title)[$this->lang];\n\t\t$data['title_moblie'] = unserialize($page_content->meta_tag_moblie_title)[$this->lang];\n\n\t\t// Meta Tag\n\t\t$data['meta']['title'] = unserialize($page_content->meta_tag_title)[$this->lang];\n\t\t$data['meta']['description'] = unserialize($page_content->meta_tag_description)[$this->lang];\n\t\t$data['meta']['keyword'] = unserialize($page_content->meta_tag_keywords)[$this->lang];\n\t\t$data['meta']['title_moblie'] = unserialize($page_content->meta_tag_moblie_title)[$this->lang];\n\t\t$data['meta']['description_moblie'] = unserialize($page_content->meta_tag_moblie_description)[$this->lang];\n\t\t$data['meta']['keyword_moblie'] = unserialize($page_content->meta_tag_moblie_keywords)[$this->lang];\n\n\t\t// OG & Twitter\n\t\t$data['og_twitter']['title'] = unserialize($page_content->meta_tag_title)[$this->lang];\n\t\t$data['og_twitter']['description'] = unserialize($page_content->meta_tag_description)[$this->lang];\n\t\t$data['og_twitter']['title_moblie'] = unserialize($page_content->meta_tag_moblie_title)[$this->lang];\n\t\t$data['og_twitter']['description_moblie'] = unserialize($page_content->meta_tag_moblie_description)[$this->lang];\n\t\t$data['og_twitter']['image'] = base_url('storage/uploads/images/blogs/' . unserialize($page_content->img_og_twitter)[$this->lang]);\n\n\t\t// Content\n\t\t$data['content'] = 'blogs';\n\n\t\t// Load CSS & JS Critical\n\t\t$data['css_critical'] = $this->load_css_critical('blogs');\n\t\t$data['js_critical'] = $this->load_js_critical('blogs');\n\n\t\t// Utilities\n\t\t$data['blog_categories'] = $this->Blog_category_model->get_blog_category_active();\n\t\t$data['blogs'] = $this->filter_data_blogs($this->Blog_model->get_blog_by_category_blog_id($data['blog_categories'][0]->id));\n\t\t$data['banner'] = $this->Banner_model->get_banner_active_by_id(3);\n\t\t$data['category_id'] = $data['blog_categories'][0]->id;\n\n\t\t/*\n\t\t| -------------------------------------------------------------------------\n\t\t| EXECUTE VIEWS\n\t\t| -------------------------------------------------------------------------\n\t\t*/\n\n\t\t$this->load->view('app', $data);\n\t}",
"function cl_bomov() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bomov\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function pagina(){\n\t\t\tinclude \"views/template.php\";\n\t\t}",
"function getPage()\n {\n global $_ARRAYLANG, $objTemplate; \n\n if(!isset($_GET['act'])){\n $_GET['act']='';\n }\n\n $boolShowStatus = true;\n\n switch ($_GET['act']) {\n case 'Ftp':\n $this->showFtp();\n break;\n \n case 'cache':\n if (in_array('CacheManager', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->showSettings();\n } else {\n \\Permission::noAccess();\n }\n \n break;\n\n case 'Wysiwyg':\n if (in_array('Wysiwyg', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n $boolShowStatus = false;\n $this->showWysiwyg();\n } else {\n \\Permission::noAccess();\n }\n \n break;\n \n case 'cache_update':\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->updateSettings();\n $objCache->showSettings();\n break;\n\n case 'cache_empty':\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->forceClearCache(isset($_GET['cache']) ? contrexx_input2raw($_GET['cache']) : null);\n $objCache->showSettings();\n break;\n\n case 'smtp':\n $this->smtp();\n break;\n \n case 'image':\n try {\n $this->image($_POST);\n } catch (Exception $e) {\n \\DBG::msg('Image settings: '.$e->getMessage);\n }\n break;\n case 'thumbnail':\n $this->editThumbnails($_POST);\n break;\n\n case 'generateThumbnail':\n $this->generateThumbnail($_POST);\n break;\n\n case 'getThumbProgress':\n $this->getThumbProgress();\n break;\n\n default:\n $this->showSettings();\n }\n\n if ($boolShowStatus) {\n $objTemplate->setVariable(array(\n 'CONTENT_TITLE' => $this->strPageTitle,\n 'CONTENT_OK_MESSAGE' => $this->strOkMessage,\n 'CONTENT_STATUS_MESSAGE' => implode(\"<br />\\n\", $this->strErrMessage)\n ));\n }\n\n $this->act = isset($_REQUEST['act']) ? $_REQUEST['act'] : '';\n $this->setNavigation();\n }"
] | [
"0.7245893",
"0.7229632",
"0.68751216",
"0.68130076",
"0.665105",
"0.66504794",
"0.6621517",
"0.65520936",
"0.65520936",
"0.6538041",
"0.6490192",
"0.6485912",
"0.6485024",
"0.64840966",
"0.6473518",
"0.6461627",
"0.6457607",
"0.6429142",
"0.64167994",
"0.6398942",
"0.6393077",
"0.632352",
"0.6322807",
"0.63184357",
"0.62983704",
"0.6250959",
"0.6234512",
"0.62190354",
"0.6189965",
"0.61867094",
"0.6185658",
"0.6183488",
"0.61764145",
"0.6162329",
"0.6149342",
"0.61355084",
"0.61312366",
"0.6126381",
"0.6120181",
"0.6103435",
"0.60927784",
"0.6083726",
"0.60802764",
"0.6072677",
"0.6061995",
"0.6061874",
"0.60592824",
"0.6057139",
"0.60563797",
"0.6047035",
"0.603806",
"0.6038038",
"0.6035811",
"0.6035811",
"0.6026892",
"0.6015237",
"0.6010593",
"0.6004748",
"0.6003413",
"0.60024637",
"0.60016173",
"0.5994156",
"0.5987002",
"0.5983563",
"0.5976305",
"0.597488",
"0.59748656",
"0.59643847",
"0.5963376",
"0.5959728",
"0.5959728",
"0.5959728",
"0.5957202",
"0.59536695",
"0.59505063",
"0.5945806",
"0.59454834",
"0.59443516",
"0.59396034",
"0.59367466",
"0.59308803",
"0.5928491",
"0.59272486",
"0.59234387",
"0.5914866",
"0.59127915",
"0.5910755",
"0.5907308",
"0.5905607",
"0.5903887",
"0.5901608",
"0.5899635",
"0.5897941",
"0.5895032",
"0.58944416",
"0.5892228",
"0.5891893",
"0.58865047",
"0.58863765",
"0.5886322",
"0.58826935"
] | 0.0 | -1 |
Estce que la ligue existe ? | function Action ($params)
{ if (roleExiste($params['role']) != 'XXX') {
return __ERREURS__[roleExiste($params['role'])];
}
// On récupère la liste des joueurs avec ce rôle
$liste = getJoueursRole($params['role']);
$retour = "";
for ($i = 0; $i < count($liste); $i++) {
if ($retour != "") $retour .= " ";
$retour .= "\n" . $liste[$i]['pseudo'] . " (" . $liste[$i]['hash'] . ")";
}
return $retour;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _exists() {\n // taky typ uz existuje ?\n $id = $this->equipment->getID();\n if ($id > 0) {\n $this->flash(\"Také vybavenie už existuje.<br/>Presmerované na jeho editáciu.\", \"error\");\n $this->redirect(\"ape/equipment/edit/$id\");\n }\n }",
"function exists()\n {\n return false;\n }",
"public function Exists();",
"public function existeLugar(){\n $modelSearch = new LugarSearch();\n $resultado = $modelSearch->busquedadGeneral($this->attributes);\n if($resultado->getTotalCount()){ \n foreach ($resultado->models as $modeloEncontrado){\n $modeloEncontrado = $modeloEncontrado->toArray();\n $lugar[\"id\"]=$modeloEncontrado['id']; \n #borramos el id, ya que el modelo a registrar aun no tiene id\n $modeloEncontrado['id']=\"\";\n \n //si $this viene con id cargado, nunca va a encontrar el parecido\n if($this->attributes==$modeloEncontrado){\n $this->addError(\"notificacion\", \"El lugar a registrar ya existe!\");\n $this->addError(\"lugarEncontrado\", $lugar);\n }\n }\n }\n }",
"function ifExists()\n\t {\n\t\t $file= CTRL.DS.$this->url[0].'.php';\n\t\t \n\t\t\n\t\t if(!file_exists($file))\n\t\t {\n\t\t\t $this->error(\"File does not exist \");\n\t\t\t echo\"<a href='\".DIR.\"index'>Back</a>\";\n\t\t\t exit();\n\t\t\t\n\t\t }\n\t\t\n\t }",
"function buscar() //funcion para ver si el registro existe \n\t{\n\t$sql=\"select * from slc_unid_medida where nomenc_unid_medida= '$this->abr' and desc_unid_medida= '$this->des'\"; \n\t $result=mysql_query($sql,$this->conexion);\n\t $n=mysql_num_rows($result);\n\t if($n==0)\n\t\t\t return 'false';\n\t\t\telse\n\t\t\t return 'true';\n\t}",
"function existe($id_desig){\r\n $sql=\"select * from suplente where id_desig_suplente=$id_desig\";\r\n $res=toba::db('designa')->consultar($sql);\r\n \r\n if(count($res)>0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"public function testExiste() {\n\n $mazo = new Mazo(\"Espanol\", [1,2,3,4,5]); //Creo un mazo\n \n $this->assertTrue(isset($mazo)); //Compruebo que fue creado correctamente\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 exists()\r\n {\r\n }",
"function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}",
"function check_exist( $pseudo ) {\n require ('config.php');\n $trouver_check_exist = false;\n\n mysql_connect($db_server, $db_user, $db_pass);\n mysql_select_db($db);\n\n $sql = 'SELECT `pseudo` FROM `tbl_tmp_user` UNION SELECT `pseudo` FROM `tbl_user`';\n $result = mysql_query($sql);\n\n $num = mysql_numrows($result);\n //mysql_close();\n\n $i = 0;\n while ($i < $num) {\n $pseude_name = mysql_result ($result, $i, 'pseudo');\n if ($pseude_name == $pseudo) {\n $trouver_check_exist = true;\n }\n $i++;\n }\n\n if ($trouver_check_exist == true) {\n return (TRUE);\n } else {\n return (FALSE);\n }\n}",
"function checarLexicoExistente($projeto, $nome) {\r\n //test if the variable is not null\r\n assert($projeto != NULL);\r\n assert($nome != NULL);\r\n //test if a variable has the correct type\r\n assert(is_string($projeto));\r\n assert(is_string($nome));\r\n\r\n $naoexiste = false;\r\n\r\n $r = bd_connect() or die(\"Erro ao conectar ao SGBD<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n $q = \"SELECT * FROM lexico WHERE id_projeto = $projeto AND nome = '$nome' \";\r\n //test if the variable is not null\r\n assert($q != NULL);\r\n $qr = mysql_query($q) or die(\"Erro ao enviar a query de select no lexico<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n //test if the variable is not null\r\n assert($qr != NULL);\r\n $resultArray = mysql_fetch_array($qr);\r\n if ($resultArray == false) {\r\n $naoexiste = true;\r\n } else {\r\n //nothing to do\r\n }\r\n\r\n $q = \"SELECT * FROM sinonimo WHERE id_projeto = $projeto AND nome = '$nome' \";\r\n //test if the variable is not null\r\n assert($q != NULL);\r\n $qr = mysql_query($q) or die(\"Erro ao enviar a query de select no lexico<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n //test if the variable is not null\r\n assert($qr != NULL);\r\n $resultArray = mysql_fetch_array($qr);\r\n\r\n if ($resultArray != false) {\r\n $naoexiste = false;\r\n } else {\r\n //nothing to do\r\n }\r\n\r\n return $naoexiste;\r\n}",
"public function exists()\n {\n return false;\n }",
"function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}",
"public function exists()\n {\n }",
"public function exists()\n {\n }",
"function alias_existente($alias) {\r\n $db = new MySQL();\r\n $existencia = $db->sql_query(\"SELECT * FROM `usuarios_usuarios` WHERE `alias`='\" . $alias . \"' ;\");\r\n $existe = $db->sql_numrows($existencia);\r\n $db->sql_close();\r\n if ($existe == 0) {\r\n return(false);\r\n } else {\r\n return(true);\r\n }\r\n }",
"function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}",
"function comprobar_si_existe_ya_imagen_lse_acepcion($id_palabra) {\n\t\t$query = \"SELECT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\tAND imagenes.id_tipo_imagen=12\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$numrows=mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\treturn $numrows;\n\t}",
"function lukasid_exists($lid = '')\r\n\t{\r\n\t\t$this->db->where('lukasid', $lid);\r\n\t\t$query = $this->db->get('users');\r\n\t\tif($query->num_rows == 1)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private function existe_usuario()\n\t{\n\t\t$data = $this->request->getRawInput();\n\t\t$ruc = $data['nick']; \n\t\t$usu = new Admin_model();\n\t\t$usuarioObject = $usu->where(\"nick\", $ruc) \n\t\t->first();\n\t\treturn !is_null($usuarioObject);\n\t\t \n\t}",
"function existenNotasRegistradas($matricula){\n return false;\n }",
"public function checkKlubExist()\n {\n $db = DB::conn();\n $found = $db->row(\"SELECT klub_name FROM klub\n WHERE klub_name = ? \" , array($this->klub_name));\n return $found;\n }",
"function check_exists()\n\t{\n\t\t$name = url_title($this->input->post('name'));\n\n\t\t$exists = $this->content_type_model->check_exists(\n\t\t\t'name',\n\t\t\t$name,\n\t\t\t$this->input->post('id_content_type')\n\t\t);\n\n\t\t$this->xhr_output($exists);\n\t}",
"function isAlreadyExist(){\n $query = \"SELECT *\n FROM\n \" . $this->db_table . \" \n WHERE\n username='\".$this->username.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }\n else{\n return false;\n }\n }",
"function checkExists($url)\n{\n\t$db = new SQLite3(DB_NAME);\n\t$query = \"SELECT * FROM URL WHERE url='$url' LIMIT 1\";\n\t$exec = $db->query($query);\n\t$count = count($exec->fetchArray());\n\tif($count==1)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t\treturn true;\n}",
"function testTableExist()\n{\n\tglobal $db,$conf,$langs;\n\t\n\t$checktable = $db->query(\"SHOW TABLES LIKE '\".MAIN_DB_PREFIX.\"materiels'\");\n\tif (($checktable)&&($db->num_rows($checktable)<=0))\n\t{\n\t\t$db->query(\"CREATE TABLE \".MAIN_DB_PREFIX.\"materiels (rowid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,ref VARCHAR(50) NOT NULL,socid INT(6),marque VARCHAR(50),model VARCHAR(50),noserie VARCHAR(50),options TEXT,note_public TEXT,date_achat DATE,garantie INT(1))\");\n\t}\n}",
"function existeLetra(/*>>> Completar parámetros <<<*/ ){\n \n /*>>> Completar cuerpo de la función <<<*/\n\n}",
"public function registrarPaginas($nome, $url){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as existe FROM tbpaginas WHERE paginas = '$url' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if ($row['existe'] >= 1) {\n return 0;\n }else{\n $sql = \"INSERT INTO tbpaginas (paginas, nome_paginas) VALUES ('$url','$nome')\";\n \n }\n\n return $this->conexao->query($sql);\n\n }",
"function objetosDuplicados($param){\r\n\t\tswitch ($param){\r\n\t\t\tcase 1:\r\n\t\t\t\treturn \"El usuario ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn \"El libro ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn \"El ejemplar ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn \"Error de Categoria. Sin embargo el objeto ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}",
"function existe_ocupacion ($ocupacion){\n\t\t\t\tinclude(\"bd_conection.php\");\n\t\t\t\t$result = @mysqli_query($con, \"SELECT * FROM ocupaciones WHERE ocupacion_tipo LIKE '$ocupacion'\");\n\t\t\t\t$rowcount=mysqli_num_rows($result);\n\t\t\t\tif ($rowcount > 0){\t\n\t\t\t\t\twhile($ocupacionExist = @mysqli_fetch_assoc($result)) { \n\t\t\t\t\t\treturn $ocupacionExist['ocupacion_tipo'];\n\t\t\t\t\t}\n\t\t\t\t}else if ($ocupacion !== \"\") {\n\t\t\t\t\t@mysqli_query($con, \"INSERT INTO ocupaciones (ocupacion_tipo) VALUES ('$ocupacion')\");\t\t\t\n\t\t\t\t\treturn $ocupacion;\n\t\t\t\t}\n\t\t\t}",
"protected function exists() {}",
"function chkExist($user){\n\tglobal $dbLink;\n\t\n\t$sqlChkExist = \"SELECT uid FROM users WHERE uid='$user'\";\n\t\n\t$dbLink->query($sqlChkExist);\n\t$rows = $dbLink->affected_rows;\n\t\n\tif($rows == 1){\n\t\t$ok==0;\n\t}\n\telse{\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user does not exist\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t}\n}",
"public function adicionarTela($nomeTela,$idpermissao){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as existe FROM tbpermissao_pages WHERE idpermissao = '$idpermissao' and permissao_pages = '$nomeTela' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if ($row['existe'] >= 1) {\n $sql = \"DELETE FROM tbpermissao_pages WHERE idpermissao = '$idpermissao' and permissao_pages = '$nomeTela' \";\n }else{\n $sql = \"INSERT INTO tbpermissao_pages (idpermissao, permissao_pages) VALUES ('$idpermissao','$nomeTela')\";\n \n }\n\n return $this->conexao->query($sql);\n\n }",
"function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}",
"public function testExisteSolicitud(){\n /*** CREAR REGISTRO */\n $user_id = 3;\n $controlador = new SolicitudesController();\n $nuevasolic = $controlador->crearSolicitud(0, $user_id, 4);\n\n $consultarsolicitud = Solicitud::where('solicitud_id', $nuevasolic->solicitud_id)->first();\n\n /** EJECUTAR LA PRUEBA */\n $this->assertEquals($nuevasolic->solicitud_id, $consultarsolicitud->solicitud_id);\n $nuevasolic->delete();\n }",
"public function existe (){\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); // Important : on libère le curseur pour la prochaine requête\n\t\tif ($donnees[0] == 0){ // Si l'id n'est pas dans la base de donnée, l'article n'existe pas\n\t\t\treturn false;\n\t\t}\n\t\treturn true ;\n\t}",
"function url_already_exists( $url, $db)\r\n{\r\n\t$query = \"SELECT * FROM articles WHERE urls = '$url'\";\r\n\t$result = mysqli_query($db, $query);\r\n\treturn mysqli_num_rows($result) == 1;\r\n}",
"function comprobar_si_existe_ya_video_lse_acepcion($id_palabra) {\n\t\t$query = \"SELECT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\tAND imagenes.id_tipo_imagen=11\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$numrows=mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\treturn $numrows;\n\t}",
"function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}",
"function verificar_existencia_profesor_espacio(){\n\t\t$sql_verif= \"SELECT * FROM \n \t\t\t\tPROF_ESPACIO\n \t\t\tWHERE(\n \t\t\t\tCODESPACIO = '$this->CODESPACIO'\n \t\t\t)\n \t\t\t\";\n\nreturn $this->mysqli->query($sql_verif)->num_rows>=1;\n\n}",
"public function checkExistRegiune($nume){\n $sql = \"SELECT nume from regiune WHERE nume = :nume\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':nume', $nume);\n $stmt->execute();\n if ($stmt->rowCount()> 0) {\n return true;\n }else{\n return false;\n }\n }",
"private function appConsolaExistencia() {\r\n\t\t\t$archivo = implode(DIRECTORY_SEPARATOR, array_merge(array($this->consolaRuta), $this->objeto)).'.php';\r\n\t\t\tif(file_exists($archivo) == true):\r\n\t\t\t\t$this->appConsolaLectura($archivo);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El Archivo de Consola: %s, de la aplicación: %s, no existe', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}",
"public function exist($s)\n\t{\n $cnx=new database();\n\n\t\t$req = $cnx->_db->prepare('SELECT * FROM joueurs WHERE id_joueur = ?');\n\t\t$req->execute(array($s));\t\t\n\t\t$reqmail_result = $req->rowCount();\n\t\t\tif ($reqmail_result==0) {\n\t\t\t\treturn true;\n\t\t\t}else return false;\n\t}",
"public function exists(): bool;",
"public function exists(): bool;",
"public function exists(): bool;",
"function isAuthorExists($author_name, $connection) {\n $q = mysqli_query($connection, 'SELECT * \n FROM authors\n WHERE author_name = \"' . $author_name . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка!';\n if ($debug) {\n echo mysqli_error($connection);\n }\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n return true;\n }\n }\n}",
"public function existAuthItem()\n {\n if ($this->type === Item::TYPE_PERMISSION) {\n $authItem = Yii::$app->authManager->getPermission($this->name);\n } else {\n $authItem = Yii::$app->authManager->getRole($this->name);\n }\n if ($this->getIsNewRecord()) {\n if (!empty($authItem)) {\n $this->addError('name', \"This name has already been taken.\");\n }\n } else {\n if (!empty($authItem) && $authItem->name !== $this->item->name) {\n $this->addError('name', \"This name has already been taken.\");\n }\n }\n }",
"public function exists() {}",
"function comprobarexiste($name)\n\t\t{\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"SELECT * FROM grupo where `NOMBRE_GRUPO` ='$name'\";\n\t\t\t$resultado=$mysqli->query($query);\n\t\t\tif(mysqli_num_rows($resultado)){\n\t\t\t\t$mysqli->close();\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$mysqli->close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"function checkUsername($id){\n\t\n\tglobal $link;\n\t$sql=\"SELECT username FROM user WHERE username='$id'\";\n\t\n\t$result=mysqli_query($link,$sql) or die(mysqli_error($link));\n\t\n\t$num=mysqli_num_rows($result);\n\t\n\tif($num>0){\n\t\treturn false;\t//this means that the user already exists and the user have to choose another one\n\t}else{\n\t\treturn true;\n\t}\n}",
"public function exist($id){\n $rq = \"SELECT * FROM Objets WHERE id = :id\";\n $stmt = $this->pdo->prepare($rq);\n $data = array(\":id\" => $id);\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n if($stmt->rowCount() > 0){\n return true;\n } else {\n $this->erreur = \"Objet inexistant\";\n return false;\n }\n }",
"function existeGrupo($base, $id, $id_asignatura)\n{\n $query = \"SELECT `id` FROM `grupos`\n WHERE `id`=\" . $id . \" AND `id_asignatura`=\" . $id_asignatura . \";\";\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}",
"private function new_account($username){\n\t\t\t\t\n\t\t$stmt = $this->db->prepare('SELECT * FROM account WHERE username=:username');\n\t\t$stmt->execute(['username'=>$username]);\n\t\t$result = $stmt->fetch();\n\t\t//the if loop checks if the account exists\n\t\tif(is_array($result) && count($result) > 0){\n\t\t\treturn false;//does exists\n\t\t}\n\t\treturn true;//does not exist\n\t}",
"public function exists()\n {\n return true;\n }",
"function name_exists($name){\n\t\t\t\n\t\t\t//var_dump($name);\n\t\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'users' ;\n\t\t\t$user_id = $wpdb->get_var( \"SELECT ID FROM $table WHERE user_login='$name'\" ) ;\n\t\t\t\n\t\t\t//return ($user_id) ? false: true ;\n\t\t\treturn $user_id ;\n\t\t}",
"function existe ($aulas, $aula){\n $existe=FALSE;\n \n if(count($aulas) != 0){\n $indice=0;\n $longitud=count($aulas);\n while(($indice < $longitud) && !$existe){\n //strcmp($aulas[$indice]['id_aula'], $aula['id_aula'])==0\n $existe=($aulas[$indice]['id_aula'] == $aula['id_aula']) ? TRUE : FALSE;\n $indice += 1;\n }\n }\n return $existe;\n }",
"public function existe()\n\t{\n\t\treturn CADModelo::existePorId($this->id);\n\t}",
"function is_kelas_exist()\n {\n $kelas_sekarang = $this->session->userdata('kelas_sekarang');\n $kelas_baru = $this->input->post('kelas');\n\n if ($kelas_baru === $kelas_sekarang) {\n return TRUE;\n } else {\n // cek database untuk nama kelas yang sama\n $query = $this->db->get_where('kelas', array('kelas' => $kelas_baru));\n if ($query->num_rows() > 0) {\n $this->form_validation->set_message(\n 'is_kelas_exist',\n \"Kelas dengan nama $kelas_baru sudah terdaftar\"\n );\n return FALSE;\n } else {\n return TRUE;\n }\n }\n }",
"function Register(){\n\n\t\t$sql = \"select * from USUARIOS where login = '\".$this->login.\"'\";\n\n\t\t$result = $this->mysqli->query($sql);\n\t\tif ($result->num_rows == 1){ // existe el usuario\n\t\t\t\treturn 'El usuario ya existe';\n\t\t\t}\n\t\telse{\n\t \t\treturn true; //TEST : El usuario no existe\n\n\t}\n}",
"public function alreadyExists()\n\t{\n\t\tif(file_exists($this->getSavePath())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function verificarLink($link){\n //se n tiver, adicionar. Caso contrário retorna\n //$da = new DataAccess();\n //$da->getLink();\n \n }",
"public function checkUsernameExists(){\r\n\t\t\t$objDBConn = DBManager::getInstance();\r\n\t\t\tif($objDBConn->dbConnect()){\r\n\t\t\t\t//echo \"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"'\";\r\n\t\t\t\t$result = mysql_query(\"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"' LIMIT 1\");\r\n\t\t\t\t$count= mysql_num_rows($result);\r\n\t\t\t\tif($count==0){\r\n\t\t\t\t\t//Username is available\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\t//return true;\r\n\t\t\t\t\techo $count;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//Username already taken.\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\t//return false;\r\n\t\t\t\t\techo $count;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t//echo 'Something went wrong ! ';\r\n\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t//return false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public function isNotFound();",
"function ajx_exists( $id = false )\n\t{\n\t\t// get language name\n\t\t$name = $_REQUEST['key'];\n\t\t$language_id = $_REQUEST['language_id'];\n\t\t\n\t\tif ( $this->is_valid_name( $name, $id, $language_id )) {\n\n\t\t// if the language name is valid,\n\t\t\t\n\t\t\techo \"true\";\n\t\t} else {\n\t\t// if invalid language name,\n\t\t\t\n\t\t\techo \"false\";\n\t\t}\n\t}",
"function ajoue_proprietaire($nom,$CA,$debut_contrat,$fin_contrat)\r\n{ $BDD=ouverture_BDD_Intranet_Admin();\r\n\r\n if(exist($BDD,\"proprietaire\",\"nom\",$nom)){echo \"nom deja pris\";return;}\r\n\r\n $SQL=\"INSERT INTO `proprietaire` (`ID`, `nom`, `CA`, `debut_contrat`, `fin_contrat`) VALUES (NULL, '\".$nom.\"', '\".$CA.\"', '\".$debut_contrat.\"', '\".$fin_contrat.\"')\";\r\n\r\n $result = $BDD->query ($SQL);\r\n\r\n if (!$result)\r\n {echo \"<br>SQL : \".$SQL.\"<br>\";\r\n die('<br>Requête invalide ajoue_equipe : ' . mysql_error());}\r\n}",
"function existUsername($username)\n{\n $c = conectar();\n $select = \"select * from USUARIOS where USERNAME='$username'\";\n // Ejecutamos la consulta recogiendo el resultado\n $resultado = mysqli_query($c, $select);\n // Comprobamos cuantas filas tiene\n if (mysqli_num_rows($resultado) === 1) {\n $resultado = true;\n } else {\n $resultado = false;\n }\n desconectar($c);\n return $resultado;\n}",
"public function exists($ret_obj = true){\t\t$exists_db = parent::exists(true);\n\t\tif($exists_db){\n\t\t\t$exists_db = new File($exists_db);\n\t\t\t//check if our file interface agrees\n\t\t\t$interface = new $exists_db['interface']($exists_db);\n\t\t\tif($interface->exists()){\n\t\t\t\t//honor the original exists return values\n\t\t\t\tif($ret_obj){\n\t\t\t\t\treturn $exists_db;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t//nope the actually file doesn't exist so delete the db record and return false;\n\t\t\t\t$exists_db->delete();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"function isBookExists($book, $connection) {\n $q = mysqli_query($connection, 'SELECT * \n FROM books\n WHERE book_title = \"' . $book . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка!';\n echo mysqli_error($connection);\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n return mysqli_fetch_assoc($q)['book_id'];\n }\n }\n}",
"private function existeusuario2($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `descuento` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n return $stmt->num_rows > 0;\n }",
"public function checkExistNume($nume){\n $sql = \"SELECT nume from servicii_prestate WHERE nume = :nume\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':nume', $nume);\n $stmt->execute();\n if ($stmt->rowCount()> 0) {\n return true;\n }else{\n return false;\n }\n }",
"function numeroExisteSalle($numero_salle) {\n\n // récupération accés base de données\n $bd = getConnexion();\n $rqt = \"SELECT numero_salle FROM salle WHERE numero_salle = :numero_salle\";\n $stmt = $bd->prepare($rqt);\n // ajout param\n $stmt->bindParam(\":numero_salle\", $numero_salle);\n // execution requette\n $stmt->execute();\n\n // récupération resultat\n $listResult = $stmt->fetchAll();\n\n if (count($listResult) == 0) {\n return false;\n } else {\n return true;\n }\n}",
"function existePseudo($pseudo) //test si le pseudo est deja utilisé\n {\n if( isset($pseudo) && !empty($pseudo) )\n {\n global $erreur;\n $erreur[] = \"Ce pseudo est déjà pris.\";\n return true;\n }\n else\n return false;\n }",
"function nameExists($newUname){\n\t\tglobal $servername, $username, $dbname, $password, $userid;\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\n\t\t// Check connection\n\t\tif ($conn->connect_error) {\n\t\t die(\"Connection failed: \" . $conn->connect_error);\n\t\t} \n\t\telse {\n\t\t\t$sql = \"SELECT * FROM users WHERE u_username = \\\"\".$newUname.\"\\\";\";\n\t\t\t$result = $conn->query($sql);\n\t\t\tif($result->num_rows > 0){ // if > 0, then obviously this name is taken\n\t\t\t\t$conn->close();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$conn->close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t}",
"public function verificarLoteExistente()\r\n {\r\n $datos = $_SESSION['idLote'];\r\n $anoImpositivo = $datos[0]->ano_impositivo;\r\n $rangoInicial = $datos[0]->rango_inicial;\r\n $rangoFinal = $datos[0]->rango_final;\r\n \r\n \r\n $busquedaLote = Calcomania::find()\r\n \r\n\r\n ->select('*')\r\n \r\n ->where('nro_calcomania between '. $rangoInicial .' and '.$rangoFinal)\r\n ->andWhere('estatus =:estatus' , [':estatus' => 0])\r\n ->andWhere('ano_impositivo =:ano_impositivo' , [':ano_impositivo' => $anoImpositivo])\r\n ->all();\r\n\r\n\r\n if ($busquedaLote == true){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM HISTORIC WHERE nameFile = ? AND idArt = ? \");\n\t\t\t$exist->execute(array($this->nameFile, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}",
"function does_exists($id, $type) {\n\n global $course_id;\n switch ($type) {\n case 'forum':\n $sql = Database::get()->querySingle(\"SELECT id FROM forum\n WHERE id = ?d\n AND course_id = ?d\", $id, $course_id);\n break;\n case 'topic':\n $sql = Database::get()->querySingle(\"SELECT id FROM forum_topic\n WHERE id = ?d\", $id);\n break;\n }\n if (!$sql) {\n return 0;\n } else {\n return 1;\n }\n}",
"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 }",
"function existe_tracker( $id ) {\n\treturn false !== obt_tracker($id);\n}",
"function existen_registros($tabla, $filtro = '') {\n if (!empty($filtro))\n $sql = \"select count(*) from \" . trim($tabla) . \" where {$filtro}\";\n else\n $sql = \"select count(*) from \" . trim($tabla);\n // print_r($sql);exit;\n $bd = new conector_bd();\n $query = $bd->consultar($sql);\n $row = pg_fetch_row($query);\n if ($row[0] > 0)\n return true;\n else\n return false;\n }",
"private function validate_exists() {\n\t\tif ( ! $this->exists ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_EXIST );\n\t\t}\n\t}",
"public function exists();",
"public function exists();",
"public function exists();",
"function exists() {\r\n\t\t$this->log .= \"exists() called<br />\";\r\n\t\tif (!isset($_COOKIE['sid'])) {\r\n\t\t $this->log .= \"sid cookie does not exist.<br />\";\r\n\t\t return false;\r\n\t\t}\r\n\t\t$this->id = $_COOKIE['sid'];\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\treturn true;\r\n\t}",
"public function exists(){\n\t\t$fichName = $this->getPath();\n\t\treturn file_exists($fichName);\n\t}",
"function franchiseIdExists($id) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT active\n\t\tFROM \" . $db_table_prefix . \"franchise\n\t\tWHERE\n\t\tid = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}",
"function is_id_kelas_exist()\n {\n $id_kelas_sekarang = $this->session->userdata('id_kelas_sekarang');\n $id_kelas_baru = $this->input->post('id_kelas');\n\n // jika id_kelas baru dan id_kelas yang sedang diedit sama biarkan\n // artinya id_kelas tidak diganti\n if ($id_kelas_baru === $id_kelas_sekarang) {\n return TRUE;\n }\n // jika id_kelas yang sedang diupdate (di session) dan yang baru (dari form) tidak sama,\n // artinya id_kelas mau diganti\n // cek di database apakah id_kelas sudah terpakai?\n else {\n // cek database untuk id_kelas yang sama\n $query = $this->db->get_where('kelas', array('id_kelas' => $id_kelas_baru));\n\n // id_kelas sudah dipakai\n if ($query->num_rows() > 0) {\n $this->form_validation->set_message(\n 'is_id_kelas_exist',\n \"Kelas dengan kode $id_kelas_baru sudah terdaftar\"\n );\n return FALSE;\n }\n // id_kelas belum dipakai, OK\n else {\n return TRUE;\n }\n }\n }",
"public static function estConnecte() {\n return key_exists(self::UTILISATEUR_REF, $_SESSION);\n }",
"function existeGrupo($entrada) {\n $grupo = trim(filter_var($entrada, FILTER_SANITIZE_STRING));\n $con = crearConexion();\n\n $query = \"SELECT `nombre` FROM `grupo` WHERE nombre = '$grupo'\";\n $result = mysqli_query($con, $query);\n\n cerrarConexion($con);\n return mysqli_num_rows($result) > 0;\n}",
"function check_exists()\r\n\t{\r\n\t\t$name = url_title($this->input->post('name'));\r\n\r\n\t\t$exists = $this->item_definition_model->check_exists(\r\n\t\t\t'name',\r\n\t\t\t$name,\r\n\t\t\t$this->input->post('id_item_definition')\r\n\t\t);\r\n\r\n\t\t$this->xhr_output($exists);\r\n\t}",
"function no_existe_versiculo_en_referencia($versiculo_id, $cita)\n{\n $dato = torrefuerte\\Models\\Referencia::where('versiculo_id', $versiculo_id)\n ->where('cita', $cita)->first();\n\n if( is_null($dato)){\n return true;\n }else{\n return false;\n }\n}",
"public function isExist(){\n\t\t\tif(file_exists($this->_nameFile)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"function exist($name, $table) {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t$name = strtolower($name); // ex: 'Pop' -> 'pop'\n\n\t# TABLE - CAT / SUB-CAT / ARTIST -----------------------\n\t$sql = \"SELECT EXISTS( SELECT * FROM \" . $table . \" WHERE NAME = '\" . $name . \"')\";\n\t$stmt = $dbh->prepare($sql);\n\t$stmt->execute() or die(error);\n\n\tforeach ($stmt as $variable) {\n\t\treturn($variable[0]);\n\t}\n}",
"function check_language_redirection_exists($country)\r\n\t{\r\n\t\t$query = $this->db->query(\"SELECT id FROM language_redirection WHERE country = ?\", array($country));\r\n\t\t\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function existe($funcion) {\n $f = $this->consultar($funcion);\n if (isset($f[\"funcion\"]) && $f[\"funcion\"] == $funcion) {\n $existe = true;\n } else {\n $existe = false;\n }\n return($existe);\n }",
"function url_exist($url)\r\n\t\t{\r\n\t\t\r\n\t\t}",
"private function existeUsuario()\n {\n $con = Conexion::getInstance();\n $sql = \"SELECT user \n FROM usuarios\n WHERE user = '{$this->usuario}' AND estado = 1 AND idUsuario != {$this->Id}\";\n\n $result = mysqli_query($con, $sql);\n\n if($result->num_rows >= 1 && $result != false)\n {\n return false;\n }\n\n return true;\n }"
] | [
"0.69145596",
"0.6885861",
"0.64912593",
"0.6457515",
"0.6370668",
"0.63411576",
"0.6312768",
"0.6197188",
"0.6142673",
"0.61098075",
"0.6099007",
"0.6094129",
"0.60878444",
"0.60661495",
"0.6060838",
"0.6053702",
"0.60518223",
"0.601455",
"0.5997253",
"0.59501517",
"0.5935099",
"0.5934475",
"0.5932546",
"0.59301096",
"0.5926983",
"0.5926513",
"0.5918086",
"0.591231",
"0.58912456",
"0.5882532",
"0.58731693",
"0.5870181",
"0.5869678",
"0.5867903",
"0.5866081",
"0.58460295",
"0.58385926",
"0.5832717",
"0.58171535",
"0.5809032",
"0.5796712",
"0.5795264",
"0.5792878",
"0.57870984",
"0.57857174",
"0.5781361",
"0.57717234",
"0.57717234",
"0.57717234",
"0.577117",
"0.576454",
"0.5749541",
"0.57434773",
"0.5736787",
"0.5732359",
"0.5711396",
"0.5709775",
"0.57097006",
"0.56927985",
"0.56803256",
"0.56749266",
"0.5671984",
"0.56704706",
"0.56574464",
"0.5654489",
"0.56537694",
"0.5641993",
"0.5637149",
"0.5635406",
"0.56275076",
"0.56267875",
"0.5626481",
"0.5621543",
"0.56206316",
"0.56201154",
"0.5618148",
"0.56086713",
"0.56050706",
"0.560266",
"0.5602383",
"0.560199",
"0.56007993",
"0.5597158",
"0.5595574",
"0.5594378",
"0.5594378",
"0.5594378",
"0.5588454",
"0.5588086",
"0.55880004",
"0.5587833",
"0.55875593",
"0.5583658",
"0.557863",
"0.55687875",
"0.55679965",
"0.55679125",
"0.5566176",
"0.5565937",
"0.55610853",
"0.5555544"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('statuses')->truncate(); // 既存データを削除する
DB::table('statuses')->insert([
[
'name' => '待機中',
],
[
'name' => '処理中',
],
[
'name' => '確認中',
],
[
'name' => '完了',
],
[
'name' => 'アーカイブ',
],
]);
} | {
"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 |
store a debug trace | protected function debugLog($message)
{
if (null !== $this->logger) {
$this->logger->addDebug($message);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function debugTrail() {}",
"function mytrace($s)\r\n{\r\n\t// see constants.php for TRACE_ENABLED flag\r\n\t\r\n\t// turn off trace?\r\n\tif (isset($_REQUEST[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_REQUEST[QS_DEBUG]==\"0\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"\";\r\n\t\t} \r\n\t}\r\n\t\r\n\t// Turn ON trace?\r\n\tif (isset($_REQUEST[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_REQUEST[QS_DEBUG]==\"1\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\t\r\n\t\t\tOutBR($s);\r\n\t\t\treturn;\r\n\t\t} \r\n\t}\r\n\t\r\n\tif (TRACE_ENABLED) \r\n\t{\r\n\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\r\n\t\tOutBR($s);\r\n\t\treturn;\r\n\t} \r\n\t\r\n\tif (isset($_SESSION[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_SESSION[QS_DEBUG]==\"1\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\t\r\n\t\t\tOutBR($s);\r\n\t\t\treturn;\r\n\t\t} \r\n\t}\r\n\t\r\n}",
"public function logTrace()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n \\DebugHelper::dump()->showtrace($output);\n $output->close();\n }",
"protected function _debug()\n {\n $file = self::DEFAULT_LOG_FILE;\n Mage::getModel('core/log_adapter', $file)->log($this->_debugData);\n }",
"function atkTrace($msg=\"\")\n{\n\tglobal $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $HTTP_POST_VARS;\n\n\t$log = \"\\n\".str_repeat(\"=\", 5).\"\\n\";\n\t$log.= \"Trace triggered: \".$msg.\"\\n\";\n\t$log.= date(\"r\").\"\\n\";\n\t$log.= $HTTP_SERVER_VARS[\"REMOTE_ADDR\"].\"\\n\";\n\t$log.= $HTTP_SERVER_VARS[\"SCRIPT_URL\"].\"\\n\";\n\t$log.= \"\\nSessioninfo: \".\"session_name(): \".session_name().\" session_id(): \".session_id().\" SID: \".SID.\" REQUEST: \".$_REQUEST[session_name()].\" COOKIE: \".$_COOKIE[session_name()].\"\\n\";\n\t$log.= \"\\n\\nHTTP_SERVER_VARS:\\n\";\n\t$log.= var_export($HTTP_SERVER_VARS, true);\n\t$log.= \"\\n\\nHTTP_SESSION_VARS:\\n\";\n\t$log.= var_export($HTTP_SESSION_VARS, true);\n\t$log.= \"\\n\\nHTTP_COOKIE_VARS:\\n\";\n\t$log.= var_export($HTTP_COOKIE_VARS, true);\n\t$log.= \"\\n\\nHTTP_POST_VARS:\\n\";\n\t$log.= var_export($HTTP_POST_VARS, true);\n\t$log.= \"\\n\\nHTTP_GET_VARS:\\n\";\n\t$log.= var_export($HTTP_GET_VARS, true);\n\n\t$log.= \"\\n\\nSession file info:\\n\";\n\t$log.= var_export(stat(session_save_path().\"/sess_\".session_id()), true);\n\n\t$tmpfile = tempnam(\"/tmp\",atkconfig(\"identifier\").\"_trace_\");\n\t$fp = fopen($tmpfile,\"a\");\n\tfwrite($fp, $log);\n\tfclose($fp);\n}",
"function debug_log($input,$debugflag=\"log\",$die=false){\n\tif(true){\n\t\t@$fp=fopen($_SERVER['DOCUMENT_ROOT'].\"/debug.txt\",'a');\n\t\t$val = vardump($input,$debugflag);\n\t\t$val = str_replace(\"__set_state\",\"\",$val);\n\t\t$val = str_replace(\"stdClass::(array(\",\"object((\",$val);\n\t\tfwrite($fp,$val);\n\t\tfclose($fp);\n\t\tif($die){\n\t\t\techo \"stoped\";\n\t\t\tdie();\n\t\t}\n\t}\n}",
"public static function Debug($str){\r\n\t\tif(!self::$Debugging)\r\n\t\t\treturn;\r\n\t\t$temp=date('Y-m-d H:i:s').\"\\t\".$str;\r\n\t\tif(self::$DebugBackTrace){\r\n\t\t\t$trace=debug_backtrace();\r\n\t\t\t$temp.=\" ('\".$trace[1]['function'].\"' in '\".basename($trace[1]['file']).\"' at line #\".$trace[1]['line'].\")\";\r\n\t\t}\r\n\t\tself::$DebugInfo[]=$temp;\r\n\t\tif(!is_null(self::$DebugFile))\r\n\t\t\tif(file_put_contents(self::$DebugFile,$temp.\"\\n\",FILE_APPEND)===false){\r\n\t\t\t\tself::Debug('Could not write to debug file '.self::$DebugFile);\r\n\t\t\t\tself::$DebugFile=null;\r\n\t\t\t}\r\n\t}",
"function insertBugTrace($UUID, $data, $debugInfo) {\n\tob_start();\n\t//$firephp = FirePHP::getInstance(true);\n\t//$firephp->log(\"insertBugTrace entered.\");\n\t$time = time();\n\t$fullTrace = \"$data\\n<!-- $debugInfo -->\";\n\t$filename = \"bugtraces/$time\" . \"_\" . $UUID . \".xml\";\n\t// $firephp->log(\"putting bug trace ($filename) to disk: $fullTrace\");\n\t//$firephp->log(\"putting bug trace ($filename) to disk.\");\n file_put_contents($filename, $fullTrace);\n}",
"function trace($msg)\n{\n $file = CIMAGE_DEBUG_FILE;\n if (!is_writable($file)) {\n return;\n }\n\n $timer = number_format((microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"]), 6);\n $details = \"{$timer}ms\";\n $details .= \":\" . round(memory_get_peak_usage()/1024/1024, 3) . \"MB\";\n $details .= \":\" . count(get_included_files());\n file_put_contents($file, \"$details:$msg\\n\", FILE_APPEND);\n}",
"function trace( $message )\n{\n\t$registry = Registry::getInstance();\n\tif ( $registry->keyExists( 'trace_messages' ) )\n\t{\n\t\t$trace_messages = $registry->get( 'trace_messages' );\n\t}\n\t$trace_messages[] = $message;\n\t$registry->set( \"trace_messages\", $trace_messages );\n}",
"function Trace($msg)\r\n{\r\n\tglobal $debug;\r\n\tif ($debug) echo $msg;\r\n}",
"function e107_db_debug() {\n\t\tglobal $eTimingStart;\n\n\t\t$this->aTimeMarks[0]=array(\n\t\t'Index' => 0,\n\t\t'What' => 'Start',\n\t\t'%Time' => 0,\n\t\t'%DB Time' => 0,\n\t\t'%DB Count' => 0,\n\t\t'Time' => ($eTimingStart),\n\t\t'DB Time' => 0,\n\t\t'DB Count' => 0\n\t\t);\n\t\t\n\t\tregister_shutdown_function('e107_debug_shutdown');\n\t}",
"final function getTrace();",
"public static function trace($s)\n {\n if($_SERVER['SERVER_NAME'] == 'localhost')\n {\n ///NEED TO UPDATE PERMISSIONS TO BE ABLE TO WRITE FILES :(\n // open file\n if(self::$LOG_PATH == '') self::$LOG_PATH = self::$DEFAULT_PATH;\n $filePath = $_SERVER['DOCUMENT_ROOT'].'/utils/loggers/'.self::$LOG_PATH;\n\n $contents = file_get_contents($filePath);\n $mode = (strlen($contents) > self::LOG_LIMIT) ? 'w' : 'a';\n $fd = fopen($filePath, $mode) or die('could not open or create phplog file!');\n\n // write string\n fwrite($fd, $s . \"\\r\\n\");\n// fwrite($fd, 'count: '.strlen($contents) . \"\\r\\n\");\n\n // close file\n fclose($fd);\n }\n }",
"public function init_trace()\n {\n }",
"public static function debug_data()\n {\n }",
"public function debug($var){\n\t\t////$this->core->log($var);\n\t}",
"public function d() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n\n $this->debugInternal($variables, $trace);\n }",
"function debug($str){\r\n\t\tif (DEVELOPMENT_ENVIRONMENT){\r\n\t\t\t$trace = debug_backtrace();\r\n\t\t\t// warning(print_r($trace,true));\r\n\t\t\t$file = $trace[0]['file'];\r\n\t\t\t$file = str_replace($_SERVER['DOCUMENT_ROOT'],'',$file);\r\n\t\t\t$line = $trace[0]['line'];\r\n\t\t\tif (isset($trace[1]['object'])){\r\n\t\t\t\t$object = $trace[1]['object'];\r\n\t\t\t\tif (is_object($object)) { $object = get_class($object); }\r\n\t\t\t}else{\r\n\t\t\t\t$object = \"View\";\r\n\t\t\t}\r\n\t\t\t// echo style();\r\n\t\t\t// echo \"<pre class='debug'><strong>DEBUG:</strong> In <strong>$object</strong> -> Line <strong>$line</strong>\\n(file <strong>$file</strong>)\";\r\n\t\t\t// echo \"<pre class='debug' style='font-size: 80%'>\";\r\n\t\t\t// print_r($str);\r\n\t\t\t// echo \"</pre></pre>\";\r\n\t\t\t$GLOBALS['_debug'][$object][$file][$line] = print_r($str,true); \r\n\t\t}\r\n\t}",
"function _trace($message) {\n if ($trace = TRUE) {\n _log($message);\n } \n}",
"function debugPair($key,$value){\n debugLog(\"<b>$key</b> -> $value\");\n}",
"function save_debug($txt,$file) {\n\n// ECRITURE FICHIER\n\t// ENREGISTREMENT LOG\n\tif ($fp=fopen($file, \"a\")) {\n\t\tfwrite($fp, \"\\n---------------------------------------------------------\\n\");\n\t\tfwrite($fp, $txt);\n\t\tfwrite($fp, \"\\n---------------------------------------------------------\\n\\n\");\n\t\tfclose($fp);\n\t} else {\n\t\techo \"Erreur d'ouverture de \".$file;\n\t}\n}",
"function _dbg($value)\n{\n echo \"<pre>[DBG]: \";\n print_r($value);\n echo \"</pre>\";\n}",
"public function debugToFile() {\n // data we are going to log\n $variables = func_get_args();\n $logFile = $variables[0];\n $trace = debug_backtrace(null, 1);\n $this->debugInternal(array_slice($variables, 1), $trace, $logFile);\n }",
"public function getTrace();",
"function Debug($bug){\n\tMagratheaDebugger::Instance()->Add($bug);\n}",
"public static function trace($str) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::trace($str);\t\t\n\t}",
"protected function getDebugBacktrace() {}",
"function get_trace(){\n\t\tglobal $database_queries,$database_query_count,$is_connected_to_db,$global_link;\n\t\treturn(\"<div style='width:100%'></div>\".$this->get_shadow(\"<h1>Mysql Trace information</h1>Note: this information s for debug purposes only, and will not be shown in the final product.<br/>Query Count:\".\n\t\t\t'db used:'.$this->dbdatabase.'<br/>Connected to Database:'.(int)$is_connected_to_db.'<br/>Link:'.$global_link.'<br/> Query Count: '.\n\t\t\t$database_query_count.'<br/>'.$database_queries,$this->default_style,'center','80%'));\n\t}",
"public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}",
"public static function addDebug($msg)\r\n\t{\r\n\t\tif(self::$debug)\r\n\t\t\tself::$debugData .= self::makePrintable($msg) . \"\\n\";\r\n\t}",
"function turk_debug($mt) {\n\t\techo \"<br /><br />\\n\\nRawData<br />\\n\".$mt->RawData.\"\\n\\n<br /><br />\";\n\t\techo \"<br /><br />\\n\\nSOAPData<br />\\n\".$mt->SOAPData.\"\\n\\n<br /><br />\";\n\n\t\techo $mt->Fault;\n\t\techo $mt->Error;\t\n\t}",
"protected function updateLastTrace() {\n $this->last_trace = time();\n }",
"public function setDebugInfo($file,$line)\n\t{\n\t\t$this->file = $file;\n\t\t$this->line = $line;\n\t}",
"public function setTrace($cat) {\n $this->cat= $cat;\n }",
"public function setTrace($cat) {\n $this->cat= $cat;\n }",
"public function trace()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array(\n 'caption' => 'trace',\n 'channel' => $this->cfg['channelName'],\n 'columns' => array('file','line','function'),\n )\n );\n $backtrace = $this->errorHandler->backtrace();\n // toss \"internal\" frames\n for ($i = 1, $count = \\count($backtrace)-1; $i < $count; $i++) {\n $frame = $backtrace[$i];\n $function = isset($frame['function']) ? $frame['function'] : '';\n if (!\\preg_match('/^'.\\preg_quote(__CLASS__).'(::|->)/', $function)) {\n break;\n }\n }\n $backtrace = \\array_slice($backtrace, $i-1);\n // keep the calling file & line, but toss ->trace or ::_trace\n unset($backtrace[0]['function']);\n $this->appendLog('trace', array($backtrace), $meta);\n }",
"function DbgAddSqlLog() {\r\n if ($this->err_level <= $this->DebugLevel) {\r\n $DBGcurrent=time();\r\n $DBGquery=\"insert into debuglog values($DBGcurrent,'$this->sid','$this->uid', '$this->err_no',' $this->err' )\";\r\n $DBGresult=mysqli_query($this->linkid,$DBGquery);\r\n if (!$DBGresult) {\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=901;\r\n return;\r\n }\r\n $this->err_no=999;\r\n }\r\n return;\r\n }",
"function set_debug($debug)\n\t{\n\t\t$this->debug = $debug;\n\t}",
"public function enableDebug();",
"static function PrintTrace()\n {\n self::$yyTraceFILE = fopen('php://output', 'w');\n self::$yyTracePrompt = '';\n }",
"static function PrintTrace()\r\n {\r\n self::$yyTraceFILE = fopen('php://output', 'w');\r\n self::$yyTracePrompt = '<br>';\r\n }",
"function debug($message) {\n $_SESSION[\"debug\"][] = $message;\n }",
"public function setDebugTimestamp($timestamp)\n {\n $this->debugTimestamp = $timestamp;\n }",
"function d() {\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n \\Yii::$app->logger->debugInternal($variables, $trace);\n }",
"public function debuglog($variable,$desc=\"\",$exit=1) {\n\t}",
"public function debug($var){\n\t\tif ($this->env['debug'] !== false){\n\t\t\techo \"<pre>\";\n\t\t\tprint_r($var);\n\t\t\techo \"</pre>\";\n\t\t}\n\t}",
"private function debug($file_name, $data) {\n file_put_contents('debug/' . $file_name . '.txt', $data);\n }",
"public function setdebug($d = true){\n\t\t$this->debug = $d;\n\t}",
"private function dbug() {\n if (!isset($doc_root)) {\n $doc_root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\n }\n $back = debug_backtrace();\n // you may want not to htmlspecialchars here\n $line = htmlspecialchars($back[0]['line']);\n $file = htmlspecialchars(str_replace(array('\\\\', $doc_root), array('/', ''), $back[0]['file']));\n\n $k = ($back[1]['class'] == 'SQL') ? 3 : 1;\n\n $class = !empty($back[$k]['class']) ? htmlspecialchars($back[$k]['class']) . '::' : '';\n $function = !empty($back[$k]['function']) ? htmlspecialchars($back[$k]['function']) . '() ' : '';\n $args = (count($back[0]['args'] > 0)) ? $back[0]['args'] : $back[0]['object'];\n $args = (count($args) == 1 && $args[0] != '') ? $args[0] : $args;\n\n print '<div style=\"background-color:#eee; width:100%; font-size:11px; font-family: Courier, monospace;\" class=\"myDebug\"><div style=\" font-size:12px; padding:3px; background-color:#ccc\">';\n print \"<b>$class$function =>$file #$line</b></div>\";\n print '<div style=\"padding:5px;\">';\n if (is_array($args) || is_object($args)) {\n print '<pre>';\n print_r($args);\n print '</pre></div>';\n } else {\n print $args . '</div>';\n }\n print '</div>';\n }",
"protected function Debug($var){\n\t\t$bt = debug_backtrace();\n\t\t$dump = new CVarDumper();\n\t\t$debug = '<div style=\"display:block;background-color:gold;border-radius:10px;border:solid 1px brown;padding:10px;z-index:10000;\"><pre>';\n\t\t$debug .= '<h4>function: '.$bt[1]['function'].'() line('.$bt[0]['line'].')'.'</h4>';\n\t\t$debug .= $dump->dumpAsString($var);\n\t\t$debug .= \"</pre></div>\\n\";\n\t\tYii::app()->params['debugContent'] .=$debug;\n\t}",
"function debug ( $str ) {\n\t\tt3lib_div::debug( \n\t\t\tarray( 'debug' => '(' . strval ( $this->pline ) . ') ' . strval ( $str ) )\n\t\t);\n\t}",
"function disableTrace($value = true) {\n\t\t$GLOBALS['amfphp']['disableTrace'] = $value;\n\t}",
"public function activateTrace()\n\t{\n\t\t$this->database->activateTrace();\n\t}",
"public function enableDebug() {}",
"public function debug();",
"public function debug();",
"protected function writeDebug($data)\n {\n if ($this->config->getDebug()) {\n file_put_contents($this->config->getDebugFile(), '[' . date('Y-m-d H:i:s') . ']: ' . print_r($data, true) . \"\\n\", FILE_APPEND);\n }\n }",
"public static function traza() {\n global $config;\n \n if ( ! isset($config['debug_file'])) return;\n\t $texto = date(\"Ymd-H:i:s \") . $_SERVER['REMOTE_ADDR'];\n\t foreach (func_get_args() as $arg) {\n\t\t $texto .= ' - ' . var_export($arg, true);\n\t }\n\t file_put_contents($config['debug_file'], $texto . \"\\n\", FILE_APPEND);\n }",
"public function recordDump($dump)\n {\n Telescope::recordDump(\n IncomingDumpEntry::make(['dump' => $dump])\n );\n }",
"public function putLog(string $packet, string $url): void\n {\n $fp = fopen($_SERVER['DOCUMENT_ROOT'].'/log/packets_1.x.dump', 'a+');\n fwrite($fp, $url.\"?p=\".$packet.\"\\n\");\n fclose($fp);\n }",
"function add_debug ($text, $br=true) {\n // STS v4.1: Add debug text to the STS debug variable. If $br=false, then no line break added\n $this->template['debug'].= $text . ($br ? \"\\n\" : '');\n }",
"public function GetTrace () \r\n\t{\r\n\t\treturn (self::$trace);\r\n\t}",
"public function GetTrace () \r\n\t{\r\n\t\treturn (self::$trace);\r\n\t}",
"public function debug($line)\n {\n }",
"public function log() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n Yii::info(VarDumper::dump($this));\n $this->debugInternal($variables, $trace);\n }",
"function apc_cache_debug ($msg, $important=false) {\n\tif ($important || (defined('APC_CACHE_DEBUG') && APC_CACHE_DEBUG)) { \n\t\terror_log(\"yourls_apc_cache: \" . $msg);\n\t}\n}",
"protected function edebug($str)\n {\n }",
"public function trace($message)\n {\n }",
"public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }",
"function StackTrace($template_safe=true)\n {\n if( !CCDebug::IsEnabled() )\n return;\n\n if (function_exists(\"debug_backtrace\")) \n {\n $st = debug_backtrace();\n }\n else\n {\n $st = \"No stack trace in this vesion of php\";\n }\n\n CCDebug::PrintVar($st,$template_safe);\n }",
"public static function save_debug_info($y_area, $y_debug_token, $is_main) {\n\n\t//-- {{{SYNC-DEBUG-DATA}}}\n\tif(!SmartFrameworkRuntime::ifDebug()) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(((string)$y_area != 'idx') AND ((string)$y_area != 'adm')) {\n\t\treturn false;\n\t} //end if\n\t//--\n\t$y_debug_token = trim((string)$y_debug_token);\n\tif((string)$y_debug_token == '') {\n\t\treturn false;\n\t} //end if\n\t//-- the use of safe_filename() here is safe because the params are validated above\n\t$the_dir = 'tmp/logs/'.Smart::safe_filename($y_area).'/'.date('Y-m-d@H').'-debug-data/'.Smart::safe_filename($y_debug_token).'/';\n\t//-- #END# SYNC\n\n\t//--\n\tif($is_main) {\n\t\t$the_file = $the_dir.'debug-main.log';\n\t} else {\n\t\t$the_file = $the_dir.'debug-sub-req-'.time().'-'.SmartHashCrypto::sha1($_SERVER['REQUEST_URI']).'.log';\n\t} //end if else\n\t//--\n\n\t//--\n\tif(!SmartFileSystem::is_type_dir($the_dir)) {\n\t\tSmartFileSystem::dir_create($the_dir, true); // recursive\n\t} //end if\n\t//--\n\tif(SmartFileSystem::is_type_dir($the_dir)) {\n\t\tif(SmartFileSystem::have_access_write($the_dir)) {\n\t\t\t//--\n\t\t\t$arr = array();\n\t\t\t//-- generate debug info if set to show optimizations\n\t\t\tSmartMarkersTemplating::registerOptimizationHintsToDebugLog();\n\t\t\t//-- generate debug info if set to show internals\n\t\t\tif(SmartFrameworkRuntime::ifInternalDebug()) {\n\t\t\t\tSmart::registerInternalCacheToDebugLog();\n\t\t\t\tSmartFrameworkRegistry::registerInternalCacheToDebugLog();\n\t\t\t\tSmartAuth::registerInternalCacheToDebugLog();\n\t\t\t\tSmartHashCrypto::registerInternalCacheToDebugLog();\n\t\t\t\tSmartUtils::registerInternalCacheToDebugLog();\n\t\t\t\tSmartMarkersTemplating::registerInternalCacheToDebugLog();\n\t\t\t} //end if\n\t\t\t//--\n\t\t\t$dbg_stats = (array) SmartFrameworkRegistry::getDebugMsgs('stats');\n\t\t\t//--\n\t\t\t$arr['date-time'] = date('Y-m-d H:i:s O');\n\t\t\t$arr['debug-token'] = (string) $y_debug_token;\n\t\t\t$arr['is-request-main'] = $is_main;\n\t\t\t$arr['request-hash'] = SmartHashCrypto::sha1($_SERVER['REQUEST_URI']);\n\t\t\t$arr['request-uri'] = (string) $_SERVER['REQUEST_URI'];\n\t\t\t$arr['resources-time'] = $dbg_stats['time'];\n\t\t\t$arr['resources-memory'] = $dbg_stats['memory'];\n\t\t\t$arr['response-code'] = (int) http_response_code();\n\t\t\t$arr['response-headers'] = base64_encode(Smart::seryalize((array)headers_list()));\n\t\t\tif(function_exists('getallheaders')) {\n\t\t\t\t$arr['request-headers'] = base64_encode(Smart::seryalize((array)getallheaders()));\n\t\t\t} else {\n\t\t\t\t$arr['request-headers'] = base64_encode(Smart::seryalize(''));\n\t\t\t} //end if else\n\t\t\t$arr['env-req-filtered'] = base64_encode(Smart::seryalize((array)SmartFrameworkRegistry::getRequestVars()));\n\t\t\t$arr['env-get'] = base64_encode(Smart::seryalize((array)$_GET));\n\t\t\t$arr['env-post'] = base64_encode(Smart::seryalize((array)$_POST));\n\t\t\t$arr['env-cookies'] = base64_encode(Smart::seryalize((array)$_COOKIE));\n\t\t\t$arr['env-server'] = base64_encode(Smart::seryalize((array)$_SERVER));\n\t\t\tif(@session_status() === PHP_SESSION_ACTIVE) {\n\t\t\t\t$arr['php-session'] = base64_encode(Smart::seryalize((array)$_SESSION));\n\t\t\t} else {\n\t\t\t\t$arr['php-session'] = base64_encode(Smart::seryalize(''));\n\t\t\t} //end if else\n\t\t\tif(SmartAuth::check_login() === true) {\n\t\t\t\t$arr['auth-data'] = array('is_auth' => true, 'login_data' => (array)SmartAuth::get_login_data(), '#login-pass#', SmartAuth::get_login_password());\n\t\t\t} else {\n\t\t\t\t$arr['auth-data'] = array('is_auth' => false, 'login_data' => []);\n\t\t\t} //end if else\n\t\t\tforeach((array)SmartFrameworkRegistry::getDebugMsgs('optimizations') as $key => $val) {\n\t\t\t\t$arr['log-optimizations'][(string)$key] = base64_encode(Smart::seryalize((array)$val));\n\t\t\t} //end foreach\n\t\t\tforeach((array)SmartFrameworkRegistry::getDebugMsgs('extra') as $key => $val) {\n\t\t\t\t$arr['log-extra'][(string)$key] = base64_encode(Smart::seryalize((array)$val));\n\t\t\t} //end foreach\n\t\t\tforeach((array)SmartFrameworkRegistry::getDebugMsgs('db') as $key => $val) {\n\t\t\t\t$arr['log-db'][(string)$key] = base64_encode(Smart::seryalize((array)$val));\n\t\t\t} //end foreach\n\t\t\tif(Smart::array_size((array)SmartFrameworkRegistry::getDebugMsgs('mail')) > 0) {\n\t\t\t\t$arr['log-mail'] = base64_encode(Smart::seryalize((array)SmartFrameworkRegistry::getDebugMsgs('mail')));\n\t\t\t} else {\n\t\t\t\t$arr['log-mail'] = '';\n\t\t\t} //end if else\n\t\t\tforeach((array)SmartFrameworkRegistry::getDebugMsgs('modules') as $key => $val) {\n\t\t\t\t$arr['log-modules'][(string)$key] = base64_encode(Smart::seryalize((array)$val));\n\t\t\t} //end foreach\n\t\t\t//--\n\t\t\tSmartFileSystem::write($the_file, Smart::seryalize($arr));\n\t\t\t//--\n\t\t} //end if\n\t} //end if\n\t//--\n\n\t//--\n\treturn true;\n\t//--\n\n}",
"function setDebug( $level )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"setDebug( $level )\\n\";\r\n\t\t$this->debug = $level;\r\n\t}",
"function debuggingLog($header=\"Logged Data\",$variable){\n $isDebuggerActive= true;\n if(!$isDebuggerActive)\n return;\n $op = \"<br>\";\n $op .= $header;\n echo $op . \"<hr>\" . \"<pre>\";\n var_dump($variable);\n echo \"</pre>\" . \"<hr>\";\n}",
"function vd() {\n $config = \\Tk\\Config::getInstance();\n $line = current(debug_backtrace());\n\n $vd = \\Tk\\Debug\\VarDump::getInstance($config->getSitePath());\n $path = str_replace($config->getSitePath(), '', $line['file']);\n $str = '';\n $str .= \"\\n\";\n //$str = sprintf('vd(%s [%s])', $path, $line['line']) . \"\\n\";\n $str .= $vd->makeDump(func_get_args());\n $str .= sprintf('vd(%s) %s [%s];', implode(', ', $vd->getTypeArray(func_get_args())), $path, $line['line']) . \"\\n\";\n\n /* @var \\Psr\\Log\\LoggerInterface $log */\n $log = $config->getLog();\n if ($log) {\n $log->info($str);\n }\n return $str;\n}",
"function trace($txt, $isArray=false){\n\t// this is helpful on a remote server if you don't\n\t//have access to the log files\n\t//\n\t$log = new cLOG(\"../tests/upload.txt\", false);\n\t//$log->clear();\n\tif($isArray){\n\t\t$log->printr($txt);\n\t}else{\n\t\t$log->write($txt);\n\t}\n\n\t//echo \"$txt<br>\";\n}",
"function logit($func, $arr=array()) \n\t{\n\t\tif(!isset($this->pth)||empty($this->pth)){\n\t\t\t$cfg = Mage::getConfig();\n\t\t\t$this->pth = $cfg->getBaseDir();\n\t\t}\n\t\t$f = $this->pth . '/magento_log.txt';\n\t\t\n\t\t// If, debug mode is off or module is live then, truncate & delete the file\n\t\tif (!$this->getConfigData('debug') || !$this->getConfigData('test')) {\n\t\t\tif (file_exists($f)) {\n\t\t\t\t$FH = @fopen($f, \"w\");\n\t\t\t\tfclose($FH);\n\t\t\t\t@unlink($f);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\n\t\t// do not log in live mode\n\t\tif (!$this->getConfigData('test')) return;\n\t\t\n\t\tif (!is_writable($f)) return;\n\t\t\n\t\t$a = '';\n\t\tif(count($arr)>0) $a = var_export($arr,true);\n\t\t\n\t\t// card details should never be stored anywhere not even in the logs\n\t\t$cleanCard = \"<creditcard>\n\t\t\t\t\t\t<cardnumber>xxxxxxxxxxxxxxxx</cardnumber>\n\t\t\t\t\t\t<cardexpmonth>xx</cardexpmonth>\n\t\t\t\t\t\t<cardexpyear>xx</cardexpyear>\n\t\t\t\t\t\t<cvmvalue>xxx</cvmvalue>\n\t\t\t\t\t\t<cvmindicator>provided</cvmindicator>\n\t\t\t\t\t</creditcard>\";\n\t\t$a = preg_replace('/<creditcard>(.*)<\\/creditcard>/smUi', $cleanCard, $a);\n\t\t@file_put_contents($f , '----- Inside ' . $func . ' =1= ' . date('d/M/Y H:i:s') . ' -----' . \"\\n\" . $a, FILE_APPEND);\n\t}",
"public function logData() {\n\t\t/* Implement in subclasses */\n\t}",
"protected function getDebugKey()\n {\n return 'fitch.manager.report';\n }",
"final public function getTraceAsString()\n {\n return 'trace';\n }",
"function debug($data) {\n global $debug_switch;\n global $output;\n \n if (!$debug_switch)\n return;\n \n if (is_array($data) || is_object($data)) {\n $output[\"debug\"][] = $data;\n } else {\n $output[\"debug\"][] = htmlspecialchars($data);\n }\n }",
"function filedebug($string,$filename=\"debug\"){\n\t\t$fp = fopen($_SERVER['DOCUMENT_ROOT'].\"/tmp/$filename\", 'w');\n\t\tfwrite($fp, $string.\"\\n\");\n\t}",
"function write_debug () {\n /*\necho $this->log_debug;\n\n $fp = fopen (\"backup/debug/battle\".$this->user['battle'].\".txt\",\"a\"); //открытие\n flock ($fp,LOCK_EX); //БЛОКИРОВКА ФАЙЛА\n fputs($fp , $this->log_debug) ; //работа с файлом\n fflush ($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ\n flock ($fp,LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ\n fclose ($fp); //закрытие\n $this->log_debug = '';\n */\n\n//die();\n }",
"protected function _debug($debugData)\n {\n $this->_logger->debug(var_export($debugData, true));\n }",
"public function isDebug();",
"public function isDebug();",
"public function manual_log($message, $type = null, $file = null, $line = null, $code = null, $trace = null)\n {\n $log = [\n 'message' => trim($message),\n 'code' => trim($code),\n 'file' => trim($file),\n 'line' => trim($line),\n 'trace' => trim($trace),\n 'type' => trim($type)\n ];\n\n $this->_saveFile($log);\n }",
"public function saveLog() {\n\n\t\t# Get log file path\n\t\tif(isset(Sky::$config) && isset(Sky::$config[\"locations\"][\"logs\"]))\n\t\t\t$filePath = Sky::$config[\"locations\"][\"logs\"] . \"errorLog_\" . @date(\"d.m\") . \".txt\";\n\n\t\t# If we need to show\n\t\tif(!empty(Sky::$config['development']['traceExceptions']) && Sky::$config['development']['traceExceptions'] == \"screen\")\n\t\t\techo Sky::getType() == Sky::INIT_TYPE_CONSOLE ? \"$this\\n\" : \"<pre>$this</pre>\";\n\n\t\t# Check key\n\t\tif(!empty(Sky::$config['development']['noLog']))\n\t\t\treturn;\n\n\t\t# Try to create file if not exists\n\t\tif(!isset($filePath) || (!file_exists($filePath) && !touch($filePath)) || !is_writable($filePath))\n\t\t\treturn;\n\n\t\t# Log\n\t\terror_log($this->__toString(), 3, $filePath);\n\n\t}",
"function debug($var): void\n {\n call_user_func('dump', $var);\n }",
"function print_persistent_capture()\n\t{\n\t\t/*if ( !is_user_logged_in() || !current_user_can('administrator') )\n\t\t\treturn;*/\n\n\t\t$set = self::is_debug_set();\n\t\t$sep = '<span class=\"sep\">|</span>';\n\n\t\t?>\n\t\t<div id=\"dev_debug_persistent\" class=\"dev_debug <?php echo $set ? 'set' : ''; ?>\">\n\t\t\t<?php\n\n\t\t\techo '<span class=\"title\">DEBUG</span> ';\n\n\t\t\tif ( $set )\n\t\t\t{\n\t\t\t\textract( get_transient('dev_debug') );\n\n\t\t\t\t$output = $this->analyze( $data, array( 'echo' => 0, 'backtrace' => $backtrace ) ); // return\n\n\t\t\t\t$meta = date( '@ g:i:s a', $time );\n\n\t\t\t\t$title = $title ? \"$meta $sep $title\" : $meta;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$title = sprintf('<em class=\"disabled\"> %s </em>',\n\t\t\t\t\t!empty( $_GET['cdt'] ) ? 'cleared' : 'not set'\n\t\t\t\t);\n\t\t\t\t$output = '';\n\t\t\t}\n\n\t\t\techo \"<span class='meta'>$title</span> <span class='output'>$output</span>\";\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}",
"public static function traceForce()\n {\n return self::debugger(func_get_args(), 2, array(\"force\" => true));\n }",
"function trace ($string, $out='@system.log')\r\n{\r\n\tstatic $paths = null;\r\n\r\n\tif ($out[0] == '@') {\r\n\t\t$out = Main::$CWD . '/' . (Main::$CORE_DIR != './' ? Path::append(Main::$CORE_DIR, '../logs/'.Text::substring($out, 1)) : ('./' . Text::substring($out, 1)));\r\n\t}\r\n\r\n\tif (!$paths)\r\n\t\t$paths = new Map();\r\n\r\n\t$path = Path::dirname($out);\r\n\tif (!$paths->has($path))\r\n\t{\r\n\t\tif (!Path::exists($path))\r\n\t\t\tDirectory::create($path, true);\r\n\r\n\t\t$paths->set($path, true);\r\n\t}\r\n\r\n\ttry {\r\n\t\t$fp = @fopen ($out, 'a+t');\r\n\t\tif (!$fp) return;\r\n\r\n\t\tfwrite ($fp, $string);\r\n\t\tfwrite ($fp, \"\\n\");\r\n\r\n\t\tfclose ($fp);\r\n\t}\r\n\tcatch (\\Exception $e)\r\n\t{\r\n\t\tif (!Text::endsWith($out, 'errors.log'))\r\n\t\t\t\\Rose\\trace($e->getMessage(), '@errors.log');\r\n\t}\r\n}",
"private function setDebugger()\n {\n $this->client\n ->getEmitter()\n ->attach(new LogSubscriber($this->debugLogger, Formatter::DEBUG));\n }",
"function pkg_debug($msg) {\n\t\tglobal $g, $debug, $fd_log;\n\n\t\tif (!$debug) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$fd_log) {\n\t\t\t$fd_log = fopen(\"{$g['tmp_path']}/pkg_mgr_debug.log\",\n\t\t\t \"w\");\n\t\t}\n\n\t\tif (!$fd_log) {\n\t\t\tupdate_status(gettext(\"Warning, could not open log \" .\n\t\t\t \"for writing.\") . \"\\n\");\n\t\t\treturn;\n\t\t}\n\t\t@fwrite($fd_log, $msg);\n\t}",
"public static function setDebug($debug) {\n\n\t\t// Need to recreate the instace.\n\t\tstatic::$instance = null;\n\t\tstatic::$debug = $debug;\n\t}",
"public function addLog($data);",
"public function stacktrace() {\n\n if ( true === WP_DEBUG ) {\n\n $e = new \\Exception;\n $this->log( $e->getTraceAsString() );\n }\n }",
"function traceMe()\n{\n // So basic\n $stdoutHandler = new StreamHandler('php://stdout');\n $errorFileHandler = new StreamHandler(__DIR__ . '/multiple.streams.log', Logger::WARNING);\n $errorFileHandler->pushProcessor(new MemoryUsageProcessor());\n\n $logger = new Logger('phpdx-experiments-multiple.streams');\n $logger->pushHandler($stdoutHandler);\n $logger->pushHandler($errorFileHandler);\n $logger->pushProcessor(new IntrospectionProcessor());\n\n $logger->debug('look context data', ['foo' => 'bar']);\n $logger->info('you will see this in stdout, but not the file');\n $logger->warning('warning goes to stdout and the file');\n $logger->error('error is handled by both handlers as well', ['serious' => 'error']);\n}",
"public static function log()\n {\n self::$arrBacktrace = array_shift(debug_backtrace());\n $strMessage = self::$arrBacktrace['file'] . ' on line ' . self::$arrBacktrace['line'];\n $arrLogDisplay = self::$arrBacktrace;\n $arrLogDisplay['debug'] = [];\n\n if (is_array($arrLogDisplay['args']) && !empty($arrLogDisplay['args'])) {\n foreach ($arrLogDisplay['args'] as $intKey => $mixValue) {\n array_push(\n $arrLogDisplay['debug'],\n array(\n \"Argument \" . ($intKey + 1) => $mixValue\n )\n );\n }\n }\n\n $log = new Logger(self::$strLogName);\n $log->pushProcessor(new MemoryPeakUsageProcessor());\n $log->pushProcessor(new WebProcessor());\n $streamHandler = new StreamHandler(self::$strLogPath, Logger::DEBUG);\n $log->pushHandler($streamHandler);\n\n unset(\n $arrLogDisplay['args'],\n $arrLogDisplay['class'],\n $arrLogDisplay['type'],\n $arrLogDisplay['file'],\n $arrLogDisplay['line']\n );\n\n return $log->debug($strMessage, $arrLogDisplay);\n }",
"public function debug($line)\n {\n rcube::write_log('enigma', 'GPG: ' . $line);\n }",
"public function debug($string, $mixed = null)\n {\n // Construct the debug-string\n if($mixed) {\n $string .= ': '.var_export($mixed, true);\n }\n\n $logfile = self::getDebugLog();\n if(@is_writable($logfile)) {\n @file_put_contents($logfile, $string.\"\\n\", FILE_APPEND);\n }\n }"
] | [
"0.64978683",
"0.61810005",
"0.60624856",
"0.6041433",
"0.60140157",
"0.59576386",
"0.5903964",
"0.5874636",
"0.58283806",
"0.58254945",
"0.5791397",
"0.57736063",
"0.5769508",
"0.57453126",
"0.57261926",
"0.57039815",
"0.56733984",
"0.5665265",
"0.5655424",
"0.5644402",
"0.5627705",
"0.5620453",
"0.5618233",
"0.56059897",
"0.56012315",
"0.5592878",
"0.5588965",
"0.5577285",
"0.5567711",
"0.55626464",
"0.55028313",
"0.5499575",
"0.5493287",
"0.5489341",
"0.5472044",
"0.5472044",
"0.5440968",
"0.5432554",
"0.54195315",
"0.54143894",
"0.5395526",
"0.5395009",
"0.53887665",
"0.5381257",
"0.5370126",
"0.5365122",
"0.53506047",
"0.5349613",
"0.5345883",
"0.5345775",
"0.5341454",
"0.5339783",
"0.5327967",
"0.53151935",
"0.531516",
"0.53134006",
"0.53134006",
"0.52964514",
"0.52902114",
"0.5286984",
"0.52758664",
"0.5242788",
"0.5238228",
"0.5238228",
"0.5230845",
"0.5229444",
"0.52224284",
"0.5217055",
"0.5213664",
"0.5213431",
"0.5195584",
"0.5192909",
"0.51925254",
"0.5186429",
"0.51831055",
"0.5166831",
"0.5164272",
"0.51567376",
"0.5153431",
"0.51504236",
"0.5150072",
"0.5146614",
"0.51375747",
"0.5126065",
"0.51171213",
"0.51171213",
"0.5115835",
"0.5108448",
"0.5106875",
"0.51037794",
"0.50964797",
"0.50812393",
"0.5070798",
"0.50608885",
"0.50579417",
"0.50457597",
"0.5036938",
"0.50357014",
"0.50308377",
"0.50299627",
"0.5025466"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$table = roles::all();
return view('roles.index', ["table" => $table ]);
} | {
"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()
{
return view('roles.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\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)
{
$validatedData = $request->validate([
'nombre' => 'required|min:5|max:100',
]);
$mRoles = new roles($request->all());
$mRoles->save();
// Regresa a lista de productos
Session::flash('message', 'Rol creado!');
return Redirect::to('roles');
} | {
"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)
{
$modelo = roles::find($id);
return view('roles.show', ["modelo" => $modelo]);
} | {
"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)
{
$modelo = roles::find($id);
return view('roles.edit', ["modelo" => $modelo]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
] | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.68336326",
"0.6811471",
"0.68060875",
"0.68047357",
"0.68018645",
"0.6795623",
"0.6791791",
"0.6791791",
"0.6787701",
"0.67837197",
"0.67791027",
"0.677645",
"0.6768301",
"0.6760122",
"0.67458534",
"0.67458534",
"0.67443407",
"0.67425704",
"0.6739898",
"0.6735328",
"0.6725465",
"0.6712817",
"0.6693891",
"0.6692419",
"0.6688581",
"0.66879624",
"0.6687282",
"0.6684741",
"0.6682786",
"0.6668777",
"0.6668427",
"0.6665287",
"0.6665287",
"0.66610634",
"0.6660843",
"0.66589665",
"0.66567147",
"0.66545695",
"0.66527975",
"0.6642529",
"0.6633056",
"0.6630304",
"0.6627662",
"0.6627662",
"0.66192114",
"0.6619003",
"0.66153085",
"0.6614968",
"0.6609744",
"0.66086483",
"0.66060555",
"0.6596137",
"0.65950733",
"0.6594648",
"0.65902114",
"0.6589043",
"0.6587102",
"0.65799844",
"0.65799403",
"0.65799177",
"0.657708",
"0.65760696",
"0.65739626",
"0.656931",
"0.6567826",
"0.65663105",
"0.65660435",
"0.65615267",
"0.6561447",
"0.6561447",
"0.65576506",
"0.655686",
"0.6556527",
"0.6555543",
"0.6555445",
"0.65552044",
"0.65543956",
"0.65543705",
"0.6548264",
"0.65475875",
"0.65447706"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$validatedData = $request->validate([
'nombre' => 'required|min:5|max:100',
]);
$mRoles = roles::find($id);
$mRoles->fill($request->all());
$mRoles->save();
Session::flash('message', 'Rol actualizado!');
return Redirect::to('roles');
} | {
"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)
{
$mRoles = roles::find($id);
$mRoles->delete();
Session::flash('message', 'Rol eliminado!');
return Redirect::to('roles');
} | {
"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 |
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants! | public static function model($className=__CLASS__)
{
return parent::model($className);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function model() {\n return parent::model(get_called_class());\n }",
"public function model()\r\n {\r\n return static::class;\r\n }",
"public static function model($className=__CLASS__) { return parent::model($className); }",
"public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }",
"static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }",
"public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}",
"public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }",
"public static function model($className=__CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }",
"public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }",
"public static function model($className = __CLASS__) {\n return parent::model($className);\n }"
] | [
"0.75747544",
"0.7529913",
"0.72720546",
"0.72709596",
"0.72625434",
"0.72126627",
"0.7212249",
"0.7132376",
"0.7129236",
"0.7129236",
"0.71031755",
"0.71031755",
"0.71029925",
"0.7075185",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606",
"0.7064606"
] | 0.0 | -1 |
Create a new command instance. | public function __construct()
{
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }",
"public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}",
"public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}",
"protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }",
"static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }",
"public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;",
"public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }",
"public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }",
"public function command(Command $command);",
"public function __construct($command)\n {\n $this->command = $command;\n }",
"public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }",
"protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }",
"public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }",
"public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }",
"public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }",
"public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;",
"private function _getCommandByClassName($className)\n {\n return new $className;\n }",
"public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }",
"public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }",
"private function __construct($command = null)\n {\n $this->command = $command;\n }",
"public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }",
"public function getCommand() {}",
"protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }",
"public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }",
"public function getCommand();",
"protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }",
"public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }",
"public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }",
"public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }",
"public function getCommand()\n {\n }",
"public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }",
"protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }",
"public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}",
"public function addCommand($command);",
"public function add(Command $command);",
"abstract protected function getCommand();",
"public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}",
"protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }",
"public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }",
"protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}",
"public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }",
"private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }",
"public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }",
"public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }",
"public function create() {}",
"protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }",
"public function create(){}",
"protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }",
"public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }",
"protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}",
"public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }",
"public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }",
"public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }",
"public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }",
"public function createCommand(?string $sql = null, array $params = []): Command;",
"public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }",
"public function generateCommands();",
"protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }",
"protected function buildCommand()\n {\n return $this->command;\n }",
"public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }",
"public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }",
"public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }",
"protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }",
"protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }",
"public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }",
"protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}",
"public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }",
"public function buildCommand()\n {\n return parent::buildCommand();\n }",
"private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }",
"public function getCommand(string $command);",
"protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}",
"public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }",
"public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }",
"protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }",
"public function generateCommand($singleCommandDefinition);",
"public function create() {\n }",
"public function create() {\n }",
"public function create() {\r\n }",
"public function create() {\n\n\t}",
"private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }",
"public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }",
"public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }",
"public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }",
"public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\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();"
] | [
"0.8010746",
"0.7333379",
"0.72606754",
"0.7164165",
"0.716004",
"0.7137585",
"0.6748632",
"0.67234164",
"0.67178184",
"0.6697025",
"0.6677973",
"0.66454077",
"0.65622073",
"0.65437883",
"0.64838654",
"0.64696646",
"0.64292693",
"0.6382209",
"0.6378306",
"0.63773245",
"0.6315901",
"0.6248427",
"0.6241929",
"0.6194334",
"0.6081284",
"0.6075819",
"0.6069913",
"0.60685146",
"0.6055616",
"0.6027874",
"0.60132784",
"0.60118896",
"0.6011778",
"0.5969603",
"0.59618074",
"0.5954538",
"0.59404427",
"0.59388787",
"0.5929363",
"0.5910562",
"0.590651",
"0.589658",
"0.589658",
"0.589658",
"0.58692765",
"0.58665586",
"0.5866528",
"0.58663124",
"0.5852474",
"0.5852405",
"0.58442044",
"0.58391577",
"0.58154446",
"0.58055794",
"0.5795853",
"0.5780188",
"0.57653266",
"0.57640004",
"0.57584697",
"0.575748",
"0.5742612",
"0.5739361",
"0.5732979",
"0.572247",
"0.5701043",
"0.5686879",
"0.5685233",
"0.56819254",
"0.5675983",
"0.56670785",
"0.56606543",
"0.5659307",
"0.56567776",
"0.56534046",
"0.56343585",
"0.56290466",
"0.5626615",
"0.56255764",
"0.5608852",
"0.5608026",
"0.56063116",
"0.56026554",
"0.5599553",
"0.5599351",
"0.55640906",
"0.55640906",
"0.5561977",
"0.5559745",
"0.5555084",
"0.5551485",
"0.5544597",
"0.55397296",
"0.5529626",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908",
"0.552908"
] | 0.0 | -1 |
Execute the console command. | public function handle() {
$name = $this->argument('name');
Lock::log($this, 'Attempting to free lock ' . $name);
try {
Lock::free($this->argument('name'));
// only log a note since this is an expected event (but it is still an error as far as freeing the lock)
} catch (\Illuminate\Database\QueryException $e) {
Log::debug('Lock free already in progress...');
// Log::debug($e);
return(Lock::ERROR);
} catch (\Exception $e) {
Log::error($e->getMessage() . " exception freeing lock ${name}: " . $e->getTraceAsString());
return(Lock::ERROR);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }",
"public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }",
"public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }",
"public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }",
"public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }",
"public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }",
"public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }",
"public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }",
"public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }",
"public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }",
"public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }",
"public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }",
"public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }",
"public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}",
"public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}",
"public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }",
"public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }",
"public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }",
"public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }",
"public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }",
"public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }",
"public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}",
"public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }",
"public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }",
"public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }",
"public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }",
"public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }",
"public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }",
"public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }",
"public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }",
"public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }",
"public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }",
"public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }",
"public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }",
"public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }",
"public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }",
"public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }",
"public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }",
"public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }",
"public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }",
"public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }",
"public function handle()\n {\n $this->revisions->updateListFiles();\n }",
"public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }",
"public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }",
"public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }",
"public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }",
"public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }",
"public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }",
"public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }",
"public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }",
"public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }",
"public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }",
"public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }",
"public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }",
"public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }",
"public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }",
"public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }",
"public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }",
"public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }",
"public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }",
"public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }",
"public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }",
"public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }",
"public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }",
"public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }",
"public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }",
"public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }",
"public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }",
"public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }",
"public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }",
"public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }",
"public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }",
"public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }",
"public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }",
"public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }",
"public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}",
"public function handle(Command $command);",
"public function handle(Command $command);",
"public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }",
"public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }",
"public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }",
"public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }",
"public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }",
"public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }",
"public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }",
"public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }",
"public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }",
"public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }",
"public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }",
"public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }",
"public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }",
"public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }",
"public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }",
"public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }",
"public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }",
"public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }",
"public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }",
"public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }",
"public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }",
"public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }",
"public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }"
] | [
"0.6469962",
"0.6463639",
"0.64271367",
"0.635053",
"0.63190264",
"0.62747604",
"0.6261977",
"0.6261908",
"0.6235821",
"0.62248456",
"0.62217945",
"0.6214421",
"0.6193356",
"0.61916095",
"0.6183878",
"0.6177804",
"0.61763877",
"0.6172579",
"0.61497146",
"0.6148907",
"0.61484164",
"0.6146793",
"0.6139144",
"0.61347336",
"0.6131662",
"0.61164206",
"0.61144686",
"0.61109483",
"0.61082935",
"0.6105106",
"0.6103338",
"0.6102162",
"0.61020017",
"0.60962653",
"0.6095482",
"0.6091584",
"0.60885274",
"0.6083864",
"0.6082142",
"0.6077832",
"0.60766655",
"0.607472",
"0.60739267",
"0.607275",
"0.60699606",
"0.6069931",
"0.6068753",
"0.6067665",
"0.6061175",
"0.60599935",
"0.6059836",
"0.605693",
"0.60499364",
"0.60418284",
"0.6039709",
"0.6031963",
"0.6031549",
"0.6027515",
"0.60255647",
"0.60208166",
"0.6018581",
"0.60179937",
"0.6014668",
"0.60145515",
"0.60141796",
"0.6011772",
"0.6008498",
"0.6007883",
"0.60072047",
"0.6006732",
"0.60039204",
"0.6001778",
"0.6000803",
"0.59996396",
"0.5999325",
"0.5992452",
"0.5987503",
"0.5987503",
"0.5987477",
"0.5986996",
"0.59853584",
"0.5983282",
"0.59804505",
"0.5976757",
"0.5976542",
"0.5973796",
"0.5969228",
"0.5968169",
"0.59655035",
"0.59642595",
"0.59635514",
"0.59619296",
"0.5960217",
"0.5955025",
"0.5954439",
"0.59528315",
"0.59513766",
"0.5947869",
"0.59456027",
"0.5945575",
"0.5945031"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$coffee_picks = DB::table('coffee_picks')
->select('members.name AS member')
->addSelect(DB::raw('COUNT(1) AS total'))
->addSelect('teams.name AS team')
->join('members', 'members.id', 'coffee_picks.member_id')
->join('teams', 'teams.id', 'members.team_id')
->groupBy('members.id')
->get();
return view('pages.dashboard', compact('coffee_picks'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.6830523",
"0.6802689",
"0.6797",
"0.67957735",
"0.67871135",
"0.6760129",
"0.67427456",
"0.6730486",
"0.67272323",
"0.67255723",
"0.67255723",
"0.67255723",
"0.67177945",
"0.6707866",
"0.6706713",
"0.6704375",
"0.6664782",
"0.6662871",
"0.6660302",
"0.6659404",
"0.6656656",
"0.6653517",
"0.6647965",
"0.6620322",
"0.66185474",
"0.6618499",
"0.6606105",
"0.6600617",
"0.65996987",
"0.6594775",
"0.6587389",
"0.6585109",
"0.6581641",
"0.6581017",
"0.6577157",
"0.65747666",
"0.6572513",
"0.65721947",
"0.6570553",
"0.65646994",
"0.6563556",
"0.6554194",
"0.65529937",
"0.65460825",
"0.65368485",
"0.653429",
"0.65328294",
"0.6526759",
"0.6526695",
"0.6526284",
"0.65191334",
"0.65183175",
"0.65174305",
"0.651703",
"0.65141153",
"0.6507088",
"0.65061647",
"0.6504046",
"0.64942145",
"0.6491893",
"0.64883405",
"0.6486392",
"0.6485077",
"0.64846045",
"0.6478858",
"0.64756656",
"0.64726377",
"0.6471126",
"0.64701074",
"0.6467418",
"0.6462195",
"0.64618355",
"0.6459199",
"0.6457831",
"0.6454631",
"0.64533997",
"0.6451915",
"0.6450861",
"0.6449301",
"0.64492667",
"0.64469045"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$brands = Brand::all();
return view('backend.brands.index', compact('brands'));
} | {
"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()
{
return view('backend.brands.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\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)
{
$name = $request->get('name');
$slug = \Illuminate\Support\Str::slug($request->get('name')).'-'.rand(1000, 9999);
$query = Brand::insert(['name' => $name, 'slug' => $slug]);
if ($query) {
return redirect()->route('backend.brands.index')->with('success','Thêm thương hiệu thành công');
}else {
return redirect()->route('backend.brands.index')->with('error','Thêm thương hiệu thất bại');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
] | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
] | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($slug)
{
$brand = Brand::where('slug', $slug)->first();
return view('backend.brands.update', compact('brand'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
] | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.68336326",
"0.6811471",
"0.68060875",
"0.68047357",
"0.68018645",
"0.6795623",
"0.6791791",
"0.6791791",
"0.6787701",
"0.67837197",
"0.67791027",
"0.677645",
"0.6768301",
"0.6760122",
"0.67458534",
"0.67458534",
"0.67443407",
"0.67425704",
"0.6739898",
"0.6735328",
"0.6725465",
"0.6712817",
"0.6693891",
"0.6692419",
"0.6688581",
"0.66879624",
"0.6687282",
"0.6684741",
"0.6682786",
"0.6668777",
"0.6668427",
"0.6665287",
"0.6665287",
"0.66610634",
"0.6660843",
"0.66589665",
"0.66567147",
"0.66545695",
"0.66527975",
"0.6642529",
"0.6633056",
"0.6630304",
"0.6627662",
"0.6627662",
"0.66192114",
"0.6619003",
"0.66153085",
"0.6614968",
"0.6609744",
"0.66086483",
"0.66060555",
"0.6596137",
"0.65950733",
"0.6594648",
"0.65902114",
"0.6589043",
"0.6587102",
"0.65799844",
"0.65799403",
"0.65799177",
"0.657708",
"0.65760696",
"0.65739626",
"0.656931",
"0.6567826",
"0.65663105",
"0.65660435",
"0.65615267",
"0.6561447",
"0.6561447",
"0.65576506",
"0.655686",
"0.6556527",
"0.6555543",
"0.6555445",
"0.65552044",
"0.65543956",
"0.65543705",
"0.6548264",
"0.65475875",
"0.65447706"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $slug)
{
$name = $request->get('name');
$query = Brand::where('slug', $slug)->update(['name' => $name]);
if ($query) {
return redirect()->route('backend.brands.index')->with('success','Cập nhật thương hiệu thành công');
}else {
return redirect()->route('backend.brands.index')->with('error','Cập nhập thương hiệu thất bại');
}
} | {
"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)
{
$query = Brand::where('id', $id)->delete();
Product::where('brand_id', $id)->update(['brand_id' => 0]);
if ($query) {
return redirect()->route('backend.brands.index')->with('success','Xóa thành công');
}
return redirect()->route('backend.brands.index')->with('error','Xóa thất bại');
} | {
"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 |
Specifies the access control rules. This method is used by the 'accessControl' filter. | public function accessRules()
{
return array(
array('allow',
'actions'=>array('admin','view'),
'roles'=>array('reader', 'writer')
),
array('allow',
'actions'=>array('create', 'update', 'delete'),
'roles'=>array('writer')
),
array('deny', // deny all users
'users'=>array('*'),
),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admins only\n\t\t\t\t'users'=>Yii::app()->getModule('user')->getAdmins(),\n\t\t\t),\n\t\t\tarray('allow',\n\t\t\t\t\t\t/*'users' => array(\"?\"),*/\n 'expression' => array($this,'isLogedInOrHasKey'),\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('login','error','logout'),\n 'users'=>array('*'),\n ),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('index','delivery','settings'),\n\t\t\t\t'users'=>array('@'),\n 'expression'=>'AdmAccess::model()->accessAdmin()'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n\t\t\t\t'actions'=>array('create','update','index','delete', 'setIsShow', 'setIsAvailable', 'setIsNew'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('allotMore','allotOne'),\n\t\t\t\t'expression'=>array('PlaneAllotController','allowReadWrite'),\n\t\t\t),\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('index'),\n\t\t\t\t'expression'=>array('PlaneAllotController','allowReadOnly'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('index','delete','create', 'update','view'),\n 'expression'=>'($user->rule===\"admin\")'\n ),\n\t\t\tarray('deny',\n 'users'=>array('*'),\n ),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('index','delete','create', 'update','view'),\n 'expression'=>'($user->rule===\"admin\")'\n ),\n\t\t\tarray('deny',\n 'users'=>array('*'),\n ),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('list','show','captcha','PostedInMonth','PostedOnDate', 'search'),\n 'users'=>array('*'),\n ),\n array('allow',\n 'actions'=>array('ajaxBookmark','create'),\n 'users'=>array('@'),\n ),\n array('allow',\n 'expression'=>'Yii::app()->user->status=='.User::STATUS_ADMIN.\n '||Yii::app()->user->status=='.User::STATUS_WRITER,\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array(\n 'allow',\n 'actions' => array('index', 'archive', 'view', 'read', 'userListResults'),\n 'users' => array('@')\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('create','admin', 'update'),\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array(\n 'deny', // deny all users\n 'users' => array('*')\n )\n );\n }",
"public function accessRules() {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'update' and 'dynamicUpdate' actions\n\t\t\t\t'actions'=>array('update', 'dynamicUpdate'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'delete' actions\n\t\t\t\t'actions'=>array('create','delete'),\n\t\t\t\t'expression'=>'Yii::app()->user->isManager()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n Yii::app()->user->loginUrl = array(\"/cruge/ui/login\");\n\t\treturn array(\n\t\t\t\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('ajaxCopia','editaTemp','index','view','admin','revisaPendientes', 'create','update','admin','motMuestraPlan','checkPlanMot'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\t\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('deny', // deny not login users\n\t\t\t\t'users'=>array('?'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin \n\t\t\t\t'actions' => array('customize'),\n\t\t\t\t'users' => array('@'),\n\t\t\t\t'expression' => '$user->isAdmin',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users' => array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n return array(\n array(\n 'deny',\n 'actions' => array('oauthadmin'),\n ),\n );\n }",
"public function accessRules() {\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t\t'actions'=>array('admin','update','create'), //adapted from code.google.com/p/yii-user/wiki/API\n\t\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow', \n 'actions'=>array('del','parse','authorize','operate'),\n 'users'=>array('@'),\n ),\n array('deny', \n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user\n\t\t\t\t'roles'=>array('arckanto-admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\t return array(\n array('allow',\n 'actions'=>array(),\n 'roles'=>array('admin'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow authenticated users to access all actions\n 'users' => array(Yii::app()->user->name),\n ),\n array('deny'),\n );\n }",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', \r\n\t\t\t\t'actions'=>array(\r\n 'admin',\r\n\r\n //Users\r\n\r\n 'users',\r\n 'checkstatus',\r\n 'activate',\r\n\r\n //Drivers\r\n 'drivers',\r\n 'loaddriverform',\r\n 'validatedriver',\r\n 'driverstatus',\r\n 'savedriverstatus',\r\n\r\n //Cars\r\n 'cars',\r\n 'loadcarform',\r\n 'validatecar',\r\n 'carstatus',\r\n 'savecarstatus',\r\n 'repairlogform',\r\n 'saverepairlog',\r\n ),\r\n\t\t\t\t'roles'=>array('rxAdmin'),\r\n\t\t\t),\r\n\r\n\t\t\tarray('deny', \r\n\t\t\t\t'actions'=>array(\r\n 'admin',\r\n 'users',\r\n 'checkstatus',\r\n 'activate',\r\n 'drivers',\r\n 'loaddriverform',\r\n 'validatedriver',\r\n 'driverstatus',\r\n 'savedriverstatus',\r\n 'cars',\r\n 'loadcarform',\r\n 'validatecar',\r\n 'carstatus',\r\n 'savecarstatus',\r\n 'repairlogform',\r\n 'saverepairlog',\r\n ),\r\n\t\t\t\t'roles'=>array('rxClient'),\r\n\t\t\t),\r\n \r\n array('allow', \r\n\t\t\t\t'actions'=>array(\r\n ),\r\n\t\t\t\t'roles'=>array('rxClient'),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t\tarray('deny', // deny all other users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t);\r\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t 'actions'=>array('global', 'backup'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t\t'expression'=>'Yii::app()->user->isAdmin'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('index', 'selanno'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('admin'),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','changeToStudent','update','create'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t\t'expression' => 'Yii::app()->user->isAdmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n return array(\n array('allow',\n 'actions' => array(\n 'popup',\n 'gridView',\n 'excel',\n ),\n 'roles' => array('admin', 'super_admin', 'operations_admin', 'limited_admin')\n ),\n array('allow',\n 'actions' => array(\n 'updateStatus',\n 'list',\n 'update',\n 'delete',\n 'count',\n 'excelSummary',\n ),\n 'users' => array('@')\n ),\n array('deny',\n 'users' => array('*')\n )\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'expression'=>'helpers::isadmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','admin'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update'),\n//\t\t\t\t'users'=>array('@'),\n 'expression'=>'yii::app()->admin->isWAdmin()'\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('delete'),\n//\t\t\t\t'users'=>array('admin'),\n 'expression'=>'yii::app()->admin->isWDAdmin()'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('view', 'updateAttribute', 'createContact', 'deleteContact'),\n 'users' => array('@'),\n ),\n/* array('allow',\n 'actions' => array('create', 'update', 'index', 'admin', 'delete'),\n 'roles' => array('ApplicationAdministrator'),\n ),*/\n array('deny',\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array( \n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n );\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('form','save'),\n 'expression'=>array('OrderAccController','allowReadOnly'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n//\t\t\tarray('allow', allow admin user to perform 'admin' and 'delete' actions\n//\t\t\t\t'actions'=>array('admin','delete','upload'),\n//\t\t\t\t'users'=>array('admin'),\n//\t\t\t),\n// array('allow',\n// 'actions'=>array('download'),\n// 'users'=>'@',\n// ),\n//\t\t\tarray('deny', deny all users\n//\t\t\t\t'users'=>array('*'),\n//\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'create'\n 'actions' => array('create'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('update', 'view', 'index'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete', 'createtechnician'),\n 'expression' => 'Yii::app()->user->checkAccess(\\'manager\\')'\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('admin', 'view', 'update','response','exportPdf','viewPdf','uploadPdf','agreementPdf','viewAgreement','generalDataEntry','financeDataEntry','externalForm','prospect','create','delete'),\n\t\t\t\t'roles'=>array('admin', 'commercial', 'commercial_manager', 'media_manager','finance','affiliates_manager', 'media_buyer_admin','account_manager_admin','operation_manager'),\n\t\t\t),\n\t\t\tarray('allow',\n\t\t\t\t'actions'=>array('financeDataEntry','generalDataEntry'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\t// array('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t// \t'actions'=>array('create','update'),\n\t\t\t// \t'users'=>array('@'),\n\t\t\t// ),\n\t\t\t// array('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t// \t'actions'=>array('admin','delete'),\n\t\t\t// \t'users'=>array('admin'),\n\t\t\t// ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array(\n \t'login', 'registration', 'captcha', \n \t'verify', 'forget'\n ),\n 'users' => array('*'),// для всех\n ),\n array('allow',\n 'actions' => array(\n \t'index', 'range', 'logout', \n \t'file', 'commercial', 'data', \n \t'view', 'payRequest', 'offers',\n 'onOffer', 'offOffer', 'changeOffer', 'change',\n ),\n 'roles' => array('user'),// для авторизованных\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array('allow',\n 'actions' => array('bind', 'merge', 'index'),\n 'users' => array('@'),\n ),\n array('allow',\n 'actions' => array('list'),\n 'expression' => array(__CLASS__, 'allowListOwnAccessRule'),\n 'users' => array('@'),\n ),\n array('allow',\n 'actions' => array('delete', 'edit'),\n 'expression' => array(__CLASS__, 'allowModifyOwnAccessRule'),\n ),\n array('allow',\n 'actions' => array('list', 'delete', 'index', 'edit'),\n 'roles' => array('admin'),\n 'users' => array('@'),\n ),\n array('deny',\n 'actions' => array('bind', 'delete', 'index', 'list', 'merge'),\n ),\n );\n }",
"public function accessRules() {\n\t\treturn array();\n\t}",
"public function accessRules()\n {\n return array(\n array('allow', // @代表有角色的\n 'actions'=>array('view','change','see'),\n 'users'=>array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions'=>array('create','see','update','delete'),\n 'expression'=>'$user->getState(\"info\")->authority >= 1',//,array($this,\"isSuperUser\"),\n ),\n array('deny', // *代表所有的用户\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'create', 'update', 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>Yii::app()->user->getAdmins(),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n \treturn array (\n \t\t\tarray (\n \t\t\t\t\t'allow',\n \t\t\t\t\t//'actions' => array ('*'),\n \t\t\t\t\t'roles' => array ('admin')\n \t\t\t),\n \t\t\tarray (\n \t\t\t\t\t'deny', // deny all users\n \t\t\t\t\t'users' => array ('*')\n \t\t\t)\n \t);\n }",
"public function accessRules()\n {\n return array(\n array('deny',\n 'actions'=>array('login', 'register'),\n 'users'=>array('@'),\n ),\n array('deny',\n 'actions'=>array('customer', 'history', 'historyItem'),\n 'users'=>array('?'),\n ),\n array('allow',\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\n $admins = CatNivelAcceso::getAdmins();\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('view','create','update','delete','getDetalle','exportToPdf','exportarExcel',\n 'index','autocompleteCatPuesto'),\n\t\t\t\t'users'=>array('@')\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*')\n\t\t\t)\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array( 'allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array( 'index', 'view' ),\n 'users' => array( '*' ),\n ),\n array( 'allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array( 'create', 'update', \n Helper::CONST_updateaccountsurcharge,\n Helper::CONST_updateaccountordersamount,\n Helper::CONST_invoicepdf,\n Helper::CONST_ae_loadPartyOrdersOrTasks,\n Helper::CONST_ae_loadParties,\n ),\n 'users' => array( '@' ),\n ),\n array( 'allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array( 'admin', 'delete' ),\n 'users' => array( 'admin' ),\n ),\n array( 'deny', // deny all users\n 'users' => array( '*' ),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // admins only\n 'actions' => array('index', 'job', 'client', 'details', 'view'),\n 'users' => array('admin')\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'manageMissionsCarers', 'delete', 'updateStatuses', 'carerMissionsAll', 'setCarerSelected',\n 'missionCarersApplied', 'missionsNoCarerApplied', 'missionsNoCarerSelected', 'viewMission', 'missionsCarerNotConfirmed', 'missionsCarerAssigned',\n 'changeCarerSelected', 'updateMissionStatuses', 'updateDiscarded', 'deleteSelected', 'updateMissionStatuses2', 'missionsCarerAssignedNotStarted',\n 'createApplyRelation', 'cancelByAdmin', 'setCarerAssigned'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('audit','edit','delete','save','finish','orderGoodsDelete','validateAjax'),\n 'expression'=>array('OrderController','allowReadWrite'),\n ),\n array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('OrderController','allowReadOnly'),\n ),\n array('allow',\n 'actions'=>array('activity','new','save','audit','delete','orderGoodsDelete','validateAjax'),\n 'expression'=>array('OrderController','addReadWrite'),\n ),\n/* array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('OrderController','addReadOnly'),\n ),*/\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user\n\t\t\t\t'actions'=>array('preview', 'view', 'update', 'delete', 'upload', 'download', 'rate', 'report', 'review', 'updateCourses'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('banbandynamic', 'banbanactivity','banbannews','dynamicdetail'),\n 'users' => array('*'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array(),\n 'users' => array('@'),\n //'expression'=>array($this,'loginAndNotDeleted'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('new','edit','delete','save','submit','request','cancel','fileupload','fileremove'),\n\t\t\t\t'expression'=>array('PayreqController','allowReadWrite'),\n\t\t\t),\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('index','view','check','filedownload','void','listtax','Listfile'),\n\t\t\t\t'expression'=>array('PayreqController','allowReadOnly'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('new','edit','save','test'),\n 'expression'=>array('EmployeeController','allowReadWrite'),\n ),\n array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('EmployeeController','allowReadOnly'),\n ),\n array('allow',\n 'actions'=>array('FileDownload','DownAgreement','DownOnlyContract','Downfile','Generate'),\n 'expression'=>array('EmployeeController','allowWrite'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'searchList', 'Approvalstatus', 'Allprojects', 'fetchSubProjectIdAndHours', 'checkHoursAndBudget'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'fetchSubProjectIdAndHours', 'checkHoursAndBudget'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n//\t\t\t\t'users'=>array('admin'),\n 'users' => array('@'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','test','view','renderButtons','update'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('getBatch','create','StudentAdministration','getAdmission'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete',),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\t return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'expression' => '!Yii::app()->user->isAdmin()',\n ),\n );\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'users' => array('@'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'details', 'IL', 'lookup'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete', 'noProspect', 'noProspectHistory'),\n 'users' => array('@'),\n ),\n array('deny', // deny all users\n 'users' => array('@'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array('allow',\n 'actions' => array('morecomments', 'approve', 'dashboard', 'create', 'list', 'update', 'delete', 'deleteall', 'index', 'view', 'replay', 'message.msg'),\n 'expression' => '$user->isAdministrator()',\n ),\n array('deny',\n 'users' => array('*'),\n )\n// array('allow', // allow all users to perform 'index' and 'view' actions\n// 'actions' => array('index', 'view'),\n// 'users' => array('*'),\n// ),\n// array('allow', // allow authenticated user to perform 'create' and 'update' actions\n// 'actions' => array('create', 'update'),\n// 'users' => array('@'),\n// ),\n// array('allow', // allow dashboard user to perform 'dashboard' and 'delete' actions\n// 'actions' => array('dashboard', 'delete'),\n// 'users' => array('dashboard'),\n// ),\n// array('deny', // deny all users\n// 'users' => array('*'),\n// ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','lista_materia','lista_actas_materia','reporte_acta','historico','listarhistoricomatria','generarpensum'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','lista_materia','lista_actas_materia', 'reporte_acta', 'hisotrico','listarhistoricomatria', 'generarpensum'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('index', 'getcompanyinfo', 'getfiltereduserstoapprovelist', 'approveusers',\n 'getfilteredclientslist', 'getclientuserslist', 'changeclientadmins', 'getfiltereduserslist',\n 'assignusertoclient', 'getclientuserslistapprvalue', 'updateusersapprovalvalues', 'getfiltereduserstoactivelist',\n 'setactiveusers', 'finduserbylogin', 'getfiltereddocumentslist', 'reassigndocumentsclients', 'getdocumentfile',\n 'getuserfile', 'getfiltereduserstotypelist', 'settypeusers', 'getclientsprojectslist', 'getuserclientprojects',\n 'getfilteredemptycompanieslist', 'getemptycompanyinfo', 'generateletter', 'checkuserapprovalvalue',\n 'getimageviewblock', 'getusertypeinfo', 'getclientactiveinfo', 'getfilteredclientstoactivelist', 'setactiveclients',\n 'updateservicelevelsettings', 'getcompanyservicelevelsettings', 'getservicelevelsettings', 'updatecompanyservicelevel',\n 'addcompanypayment','ManageExistingUsersList'\n ),\n 'users'=>array('admin', 'db_admin'),\n ),\n array('deny',\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\n\t\treturn array(\n\t\t\tarray('allow', /// allow authenticated user to perform this: index,update,create,delete,errer,content\n\t\t\t\t'actions'=>array('index','update','create','delete','error','content'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', /// allow authenticated user to perform this: ua + allupdate\n\t\t\t\t'actions'=>array('index','update','allupdate','create','delete','error','content'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', /// deny all not login users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('manage','delete','view','status','gallery'),\n\t\t\t\t'expression'=>'helpers::isadmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array('index','view'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('create','update','createAddDomain','createDeleteDomain','updateDeleteDomain','updateAddDomain','createByDomain','CreateDomain'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('admin','delete'),\r\n\t\t\t\t// 'users'=>array('admin'),\n\t\t\t\t'roles'=>array('administrator', 'koordynator'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','index','update','createLc'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'category'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'rate', 'print','activate'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array(Yii::app()->controller->action->id),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow view user to perform 'view' and 'delete' actions\n 'users' => User::getAdmins(),\n ),\n array('deny', // deny all users\n 'users' => array(\"*\"),\n ),\n );\n }",
"public function accessRules() {\n return array(\n /* array('allow', \n 'actions'=>array('*'),\n 'roles'=>array('events'),\n ), */\n array('deny', // deny all users\n 'actions'=>array( 'negotiatingAdd'),\n 'users'=>array('?'),\n ),\n \n array('allow', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\t\t\t\t\n\t\t\t\tarray('allow', // allow authenticated users to access all actions\n\t\t\t\t\t\t'users'=>array('@'),\n\t\t\t\t),\n\t\t\t\tarray('deny', // deny all users\n\t\t\t\t\t\t'users'=>array('*'),\n\t\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow authenticated admins to perform any action\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t\t'expression'=>'Yii::app()->user->role>=5'\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t\t'deniedCallback' => array($this, 'actionError')\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('view', 'create', 'update', 'delete', 'index', 'logout','admin', 'upload', 'ajaxUpload', 'editProfile', 'editPassword', 'crop'),\n 'roles' => array('bloger', 'admin'),// для авторизованных\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'roles' => array('admin'),\n ),\n array('deny',\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('Ind1','Ind2','ind3','ind4','ind5','ind6','ind7','ind8','ind9','ind10','ind11','ind12','ind'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions'=>array(''),\n 'users'=>array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions'=>array('create','delete','update','lock','index','view','map','locked','index'),\n 'users'=>array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions'=>array('admin','editableSaver','setup'),\n 'users'=>array('admin'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update','EnviaEmail','Rank'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete', 'deletar'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','admin'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('relaciona','recibevalor','create','update'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\r\n {\r\n return array(\r\n array(\r\n 'allow', // allow authenticated user to perform 'create' and 'update' actions\r\n 'actions' => array(\r\n 'DailyScan',\r\n 'DailyScanByItemNo',\r\n 'DetailScan',\r\n ),\r\n 'users' => array('@'),\r\n ),\r\n array(\r\n 'deny', // deny all users\r\n 'users' => array('*'),\r\n ),\r\n );\r\n }",
"public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'roles'=>Yii::app()->getModule('d_export')->accessPermissionRoles,\n ),\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'users'=>Yii::app()->getModule('d_export')->accessPermissionUsers,\n ),\n\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array(\n 'allow',\n 'actions' => array('scientificName'),\n 'users' => array('*'),\n ),\n array('allow',\n 'actions' => array('location', 'person', 'acquisitionSource'),\n 'users' => array('@'),\n ),\n array('deny', // deny all users by default\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view',),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'recherche', 'profile', 'base', 'list', 'test','toggle'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'adjunto', 'admin'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n\t\t\t\t'actions' => array('index', 'worldMap', 'ownIslands', 'research', 'highscore', 'enterWorld', 'playWorld'),\n\t\t\t\t'users' => array('@'),\n\t\t\t),\n\t\t\tarray('deny',\n\t\t\t\t'users' => array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','setHitterBase','setBatterBase','stats','getBasesEvent'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','scorecard','submitBall'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'roles'=>array('admins'),\n\t\t\t),\n\t\t\t/*array('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),*/\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('create','view','autocomplete'),\n\t\t\t\t'roles'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // Allow superusers to access Rights\n\t\t\t\t'actions'=>array(\n\t\t\t\t\t'permissions',\n\t\t\t\t\t'operations',\n\t\t\t\t\t'tasks',\n\t\t\t\t\t'roles',\n\t\t\t\t\t'generate',\n\t\t\t\t\t'create',\n\t\t\t\t\t'update',\n\t\t\t\t\t'delete',\n\t\t\t\t\t'removeChild',\n\t\t\t\t\t'assign',\n\t\t\t\t\t'revoke',\n\t\t\t\t\t'sortable',\n\t\t\t\t),\n\t\t\t\t'users'=>$this->_authorizer->getSuperusers(),\n\t\t\t),\n\t\t\tarray('deny', // Deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index', 'error', 'login', 'logout'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update', 'resultsload', 'instrumentsresultsload', 'overviewload', 'details', 'admin', 'repview', 'filteredrepview', 'pdf' ),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t//'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('index','view','getWorkflow','getStageDetails','updateStageDetails','startStage','completeStage','revertStage','getStageMembers','getStages'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','create','update','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'roles' => array(\n\t\t\t\t\tUser::ROLE_ADMIN,\n\t\t\t\t\tUser::ROLE_POWERADMIN,\n\t\t\t\t\tUser::ROLE_SEO,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'getinvoicedata', 'paynow', 'print'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','votar'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\t/*array('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','admin','delete'),\n\t\t\t\t'users'=>array(Yii::app()->getModule('user')->user()->username),\n\t\t\t),*/\n\t\t\t/*array('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array(),\n\t\t\t\t'users'=>array(Yii::app()->getModule('user')->user()->username),\n\t\t\t),*/\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t return array(\n\t\t array('allow', // allow all users to perform 'index' and 'view' actions\n\t\t 'actions'=>array('Update_hecho','index','procesa_renap','explota_renap','Save_denunciante','Save_Ubicacion','ProcesaHechos','Save_hechos','Mostrar_hechos','Eliminar_hecho','Save_Relato','Show_Resumen'),\n\t\t 'users'=>array('oficinista','root','developer','supervisor_comisaria'),\n\t\t ),\n\t\t array('allow', // allow all users to perform 'index' and 'view' actions\n\t\t 'actions'=>array('pruebas','resumen','relato','hechos','mapa','persona'),\n\t\t 'users'=>array('developer'),\n\t\t ),\n\t\t array('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t 'actions'=>array('selector'),\n\t\t 'users'=>array('@'),\n\t\t ),\n\t\t\n\t\t array('deny', // deny all users\n\t\t 'users'=>array('*'),\n\t\t ),\n\t );\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('index','view','create','update','admin','delete','adminAssignment','reset'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t\t'roles'=>array('admin'),\n\t\t\t),\n array('allow',\n 'actions'=>array('password','profile'),\n 'users'=>array('@')\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array(/* 'index','view', 'report'*/'index'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array(/* 'create','update' */),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array(/* 'admin','delete' */),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','principal','administrador','colaborador','consultor','visitante','verChat'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>Yii::app()->getModule('user')->getAdministradores(),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','changeStatus','report'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','changeStatus','report'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete','changeStatus'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','imprime','reporte1','reporte2','reporte3','admin','delete'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('autocomplete'),\r\n\t\t\t\t'users'=>array(\"*\"),\r\n\t\t\t),\r\n\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'error' and 'contact' actions\n 'actions'=>array('error'),\n 'users'=>array('*'),\n ),\n array('allow', // allow only authenticated users to perform 'index' actions\n 'actions'=>array('index', 'areaTree', 'areaTreeData', 'getAttributes', 'getForm', 'update', 'import'),\n 'expression'=>'!Yii::app()->user->isGuest && (Yii::app()->user->isAdmin() || Yii::app()->user->isSuperUser())',\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('index', 'myEvents', 'detail', 'subscribe', 'unsubscribe', 'subscribers', 'invites', 'add', 'edit', 'saveImage', 'delete', 'calendar', 'map', 'comments', 'addComment', 'gallery', 'getAlbum', 'addAlbum', 'renameAlbum', 'deleteAlbum', 'addImage', 'deleteImage', 'downloadImage', 'addImageToAlbum', 'removeImageFromAlbum', 'comingEvents', 'pastEvents'),\n 'roles' => array('user'),\n ),\n array('allow',\n 'actions' => array('share'),\n 'users' => array('*'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','pronostico','actRecargas'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'category'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('new', 'update'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array(''),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function accessRules() \r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array('index'),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('suggest'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t\t'expression'=>'isset(Yii::app()->user->level)',\r\n\t\t\t\t//'expression'=>'isset(Yii::app()->user->level) && (Yii::app()->user->level != 1)',\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('manage','add','delete','status'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t\t'expression'=>'isset(Yii::app()->user->level) && in_array(Yii::app()->user->level, array(1,2))',\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array(),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}"
] | [
"0.7229873",
"0.72012293",
"0.70917755",
"0.70844513",
"0.708018",
"0.708018",
"0.70799863",
"0.7072431",
"0.7072431",
"0.70660526",
"0.7064439",
"0.700873",
"0.700494",
"0.70015746",
"0.69898736",
"0.69839835",
"0.6977239",
"0.69746107",
"0.6972772",
"0.69703716",
"0.69695455",
"0.6966667",
"0.6959773",
"0.6956604",
"0.6955104",
"0.6949643",
"0.69431823",
"0.69371873",
"0.69343966",
"0.6932137",
"0.69320303",
"0.6930067",
"0.69295216",
"0.692494",
"0.69246763",
"0.6924622",
"0.69232786",
"0.69222337",
"0.6917967",
"0.691064",
"0.69074327",
"0.69057",
"0.69042856",
"0.6900149",
"0.6893778",
"0.6892782",
"0.6891147",
"0.6887545",
"0.68868345",
"0.688239",
"0.6882229",
"0.68806696",
"0.6880583",
"0.6876424",
"0.68699807",
"0.6866366",
"0.6860592",
"0.68601173",
"0.6858248",
"0.68579227",
"0.6854373",
"0.685073",
"0.6848974",
"0.6846176",
"0.68456316",
"0.68455005",
"0.68437564",
"0.6837181",
"0.6836586",
"0.68358904",
"0.683505",
"0.6833606",
"0.68256164",
"0.6823347",
"0.68196326",
"0.6819599",
"0.68193954",
"0.68188256",
"0.6816514",
"0.6814964",
"0.6811807",
"0.68108267",
"0.6809761",
"0.68045896",
"0.68038595",
"0.6800515",
"0.6799485",
"0.67960197",
"0.67911613",
"0.67899615",
"0.6789926",
"0.67883563",
"0.6788353",
"0.6785952",
"0.67859",
"0.6785493",
"0.6785287",
"0.678436",
"0.6783886",
"0.67802835"
] | 0.69986796 | 14 |
Displays a particular model. | public function actionView($id)
{
$model=Persona::model()->with(array('situacionEconomica', 'condicionesEspeciales', 'domicilio', 'solicitud'))->findByPk($id);
if($model===null)
throw new CHttpException(404,'La persona no se encuentra en el sistema.');
$this->render('view',array('model'=>$model));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }",
"public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }",
"public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionView()\n\t{\n\t\tif (!($model = $this->loadModel()))\n\t\t\treturn;\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}",
"public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}",
"public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}",
"public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}",
"public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}",
"public function actionView()\n {\n $id=(int)Yii::$app->request->get('id');\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }",
"public function actionView($id) {\n\t\t$model = $this->loadModel($id);\n\t\t\n\t\t$this->render('view', array(\n\t\t\t'model'\t\t\t\t\t\t\t\t\t\t\t\t\t\t=> $model,\n\t\t));\n\t}",
"public function actionView()\n {\n $id = Yii::$app->user->id;\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }",
"public function actionView($id)\n{\n$this->render('view',array(\n'model'=>$this->loadModel($id),\n));\n}",
"public function actionShow()\r\n\t{\r\n\t\t$this->render('show',array('model'=>$this->loadcontent()));\r\n\t}",
"public function show()\n {\n return $this->model;\n }",
"public function actionView($id) {\n\t\t$this->render('view', array(\n\t\t\t'model' => $this->loadModel($id),\n\t\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 actionView($id) {\n\t\t$model = $this->loadModel($id);\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionView($id) {\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }",
"public function actionView($id)\n\t{\n\t\t$this->render ( 'view', array (\n\t\t\t\t'model' => $this->loadModel ( $id )\n\t\t) );\n\t}",
"public function actionView()\r\n {\r\n $this->_userAutehntication();\r\n /*\r\n * Check if id was submitted via GET method \r\n */\r\n if(!isset($_GET['id']))\r\n $this->_sendResponse(500, 'Error: Parameter <b>id</b> is missing' );\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']);\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>view</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model)) {\r\n $this->_sendResponse(404, 'No Post found with id '.$_GET['id']);\r\n } else {\r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes));\r\n }\r\n }",
"public function actionView($id)\r\n {\r\n $this->render('view', array(\r\n 'model' => $this->loadModel($id),\r\n ));\r\n }",
"public function actionView($id)\n\t{ \n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t}",
"public function actionView($id)\n {\n return $this->render('view', [\n 'model' => $this->findModel($id),\n //'model' => $this->findModel(Yii::$app->user->id),\n ]);\n }",
"public function actionView($id)\n\t{\n\n\t $this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n {\n $this->render('view', [\n 'model' => $this->loadModel($id),\n ]);\n }",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}"
] | [
"0.75535107",
"0.7553186",
"0.7542682",
"0.7540008",
"0.74330246",
"0.74330246",
"0.74330246",
"0.74330246",
"0.74330246",
"0.73394006",
"0.7160726",
"0.71322334",
"0.712746",
"0.70615447",
"0.7022298",
"0.6983485",
"0.69753826",
"0.6958109",
"0.6945592",
"0.69437367",
"0.69437367",
"0.69437367",
"0.69437367",
"0.69437367",
"0.69437367",
"0.69437367",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6918672",
"0.6916909",
"0.6910746",
"0.69090086",
"0.69004697",
"0.688112",
"0.688112",
"0.688112",
"0.6875093",
"0.68739605",
"0.6873016",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299",
"0.6868299"
] | 0.0 | -1 |
Creates a new model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate() {
$request = Yii::app()->request;
$form = new PersonaForm("new");
if($request->isPostRequest) {
$form->attributes = $request->getPost('PersonaForm');
if($form->validate()) {
PersonaManager::savePersona($form);
Yii::app()->user->setFlash('general-success', "$form->nombre $form->apellido ha sido creado.");
$this->redirect('admin');
}
}
$this->render('create', array('model'=>$form));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}",
"public function actionCreate()\n\t{\n\t\t$model = $this->loadModel();\n\n\t\tif(isset($_POST[get_class($model)]))\n\t\t{\n $model = $this->_prepareModel($model);\n if (Yii::app()->getRequest()->isAjaxRequest) {\n if($model->save())\n echo json_encode($model);\n else\n echo json_encode(array('modelName' => get_class($model),'errors' => $model->getErrors()));\n\n Yii::app()->end();\n }\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }",
"public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new RefJkel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Test();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}",
"public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Crm();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $this->setModelByConditions();\n\n if (Yii::$app->request->isPost &&\n $this->model->load(Yii::$app->request->post()) &&\n $this->setAdditionAttributes() &&\n $this->model->save()) {\n\n if ($this->viewCreated) {\n $redirectParams = [\n $this->urlPrefix.'view',\n 'id' => $this->model->getId(),\n ];\n } else {\n $redirectParams = [\n $this->urlPrefix.'index',\n ];\n }\n\n return $this->redirect($redirectParams);\n }\n\n return $this->render('create',\n ArrayHelper::merge(\n [\n 'model' => $this->model,\n ],\n $this->getAdditionFields()\n )\n );\n }",
"public function actionCreate() {\n $model = new $this->defaultModel;\n\n $isPjax = Yii::$app->request->isPjax;\n if (!$isPjax) {\n $this->performAjaxValidation($model);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($isPjax) {\n return $this->actionAjaxModalNameList(['selected_id' => $model->id]);\n } else {\n return $this->redirect('index');\n } \n } else {\n if (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model,\n 'isModal' => true,\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'isModal' => false,\n ]);\n }\n }\n }",
"public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model = new Post;\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save())\n\t\t{\n\t\t\treturn $this->redirect(['site/index']);\n\t\t}\n\t\t\n\t\techo $this->render('create', array(\n\t\t\t'model' => $model\n\t\t));\n\t}",
"public function actionCreate()\n {\n $models = $this->loadModelsByPid();\n\n $this->performAjaxValidationTabular($models);\n\n $success = $this->doAction($models);\n $newPid = current($models)->pid;\n\n if($success)\n {\n if(isset($_POST['apply']))\n {\n $this->redirectAction($newPid);\n }\n $this->redirectAction();\n }\n\n if($success !== null && $newPid)\n {\n $this->redirectAction($newPid);\n }\n\n $this->render($this->view['create'], array(\n 'models' => $models,\n 'model' => reset($models),\n 'languages' => Language::getList(),\n ));\n }",
"public function actionCreate()\n\n {\n\n $model = new Orders();\n\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n\t\t\t\n\n\t\t\tYii::$app->session->setFlash('orders', 'Orders has been added successfully');\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n\n }\n\n }",
"public function actionCreate()\n {\n $model = new Keep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Photo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public\n function actionCreate()\n {\n $model = new Phforum();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $this->isCreateView = true;\n $modelClass = $this->_getModelClass();\n $model = new $modelClass;\n return $this->_renderView($model);\n }",
"public function actionCreate()\n {\n $model = new JetShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Orders();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->redirect([\"site/register\"]);\n /*$this->render('/site/register', [\n 'model' => $model,\n ]);*/\n }\n }",
"public function actionCreate()\n {\n $model = new Major();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n $this->success(Yii::t('flash', 'major.save_success'));\n } else {\n $this->error(Yii::t('flash', 'major.save_error'));\n }\n return $this->redirect(['index']);\n } \n return $this->render('create', [\n 'model' => $model,\n ]);\n \n }",
"public function actionCreate()\n {\n $model = new Mylive();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->live_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Rents();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $this->layout = 'headbar';\n $model = new ContactOne();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $dataProvider = new ActiveDataProvider([\n 'query' => ContactOne::find(),\n 'pagination' => [\n 'pageSize' => 20,\n ],\n ]);\n //return $this->redirect(['view', 'id' => $model->id]);\n\n return $this->render('view',[\n 'dataProvider' => $dataProvider,\n ]);\n\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $user = User::findOne(['username' => $model->username ]) ;\n return $this->redirect(['site/view','id' => $user->id]);\n } else {\n return $this->render('knpr/create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Admin();\n\n /*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n \n if (Yii::$app->request->post() && $model->validate()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }",
"public function actionCreate()\n {\n $model = new Book();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \tif (Yii::$app->request->getIsAjax()) {\n \t\treturn $this->renderPartial('create', [\n \t\t\t'model' => $model,\n \t\t]);\n \t}\n \telse {\n\t return $this->render('create', [\n\t 'model' => $model,\n\t ]);\n \t}\n }\n }",
"public function actionCreate()\n {\n $model = new Article();\n if(!empty($_GET['kind'])) $model->kind=$_GET['kind'];\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Actividad();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate(){\n $model = new Category();\n// d($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->category_id]);\n } else {\n// d($_POST);\n return $this->render('create', ['model' => $model,]);\n }\n }",
"public function actionCreate()\n {\n $model = new ActivityDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new VehicleApply();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new TabelleRelease();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n\n return $this->redirect(['update', 'id' => $model->id, 'mySuccess' => 2]);\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Student();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model=new User;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n\t{\n\t\t$model=new User;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Status();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Customers();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Products();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Template();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new UserFeeMaster();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n //$this->paymentUMoney($model);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'userid' => Yii::$app->user->id,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Takwim();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Comment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new News();\n $author = Yii::$app->user->identity->username;\n\n if ($model->load(Yii::$app->request->post())){\n $model->setAuthor($author);\n if($model->save()){\n return $this->redirect('index');\n }\n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\tif (isset(Yii::app()->user->isAdmin) && Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\t\n\t\t$model=new Articles;\n\t\tif(isset($_POST['Articles']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\tif (isset(Yii::app()->user->isAdmin) && Yii::app()->user->isAdmin){\n\t\t\t\t$model->status = 0;\n\t\t\t}\n\t\t\t$model->user_id = Yii::app()->user->id;\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\tif (Yii::app()->user->isAdmin){\n\t\t\t\t\t$this->redirect(array('admin')); //,'id'=>$model->id));\n\t\t\t\t}else{\n\t\t\t\t\t$this->redirect(array('list')); //,'id'=>$model->id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array('model'=>$model));\n\t}",
"public function actionCreate()\n {\n $model=new User('admin');\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->save())\n $this->redirect(array('index'));\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }",
"public function actionCreate()\n {\n $model = new Uprawnienia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'konto_id' => $model->konto_id, 'podkategoria_id' => $model->podkategoria_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Contact();\n $model->user_id = $this->user->id;\n $model->scenario = 'form';\n\n if (Yii::$app->request->isPost && ($postData = Yii::$app->request->post()) && $model->load($postData)) {\n if ($model->save()) {\n return $this->redirect([\n 'view',\n 'id' => $model->id,\n ]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n Login::UserAuth('Customers', 'Create');\n $model = new Customers;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Customers'])) {\n $_POST['Customers'] = CI_Security::ChkPost($_POST['Customers']);\n $model->attributes = $_POST['Customers'];\n $model->password = md5($model->password);\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->cid));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate()\n {\n $model = new Kareer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Debtor();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n //$locationModel = Location::find()->where(['location_id' => $model->location->id])->one();\n $locationModel = new Location();\n $locationModel->load(Yii::$app->request->post());\n $locationModel->save();\n $model->link('location', $locationModel);\n\n //$nameModel = Name::find()->where(['name_id' => $this->name->id])->one();\n $nameModel = new Name();\n $nameModel->load(Yii::$app->request->post());\n $nameModel->save();\n $model->link('name', $nameModel);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n if (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n }",
"public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n $this->layout='admin';\n \n\t\t$model=new Bet;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Bet']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Bet'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n\t{\n\t\t$model = new Route();\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->save();\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function actionCreate() {\n\t\t$model = new Building();\n\n\t\tif ( $model->load( Yii::$app->request->post() ) && $model->save() ) {\n\t\t\treturn $this->redirect( [ 'index', 'id' => $model->id ] );\n\t\t} else {\n\t\t\treturn $this->render( 'create', [\n\t\t\t\t'model' => $model,\n\t\t\t] );\n\t\t}\n\t}",
"public function actionCreate()\n {\n $model = new Service();\n if($model->load(Yii::$app->request->post()) ){\n $model->created_by=Yii::$app->user->id;\n $model->created_at=time();\n if ( $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n\t\t$model = new Proyecto;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this -> performAjaxValidation($model);\n\n\t\tif (isset($_POST['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\t$model -> Usuario_id = Yii::app() -> user -> id;\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('create', array('model' => $model, ));\n\t}",
"public function actionCreate()\n {\n $model = new Programador();\n //Yii::$app->request->post() wrapper de Yii para obtener datos seguros enviados por POST\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new File();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Contact;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Contact'])) {\n $model->attributes = $_POST['Contact'];\n if ($model->save()) {\n $this->redirect(array('view','id' => $model->id));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate() {\n $model = new TimeBooks();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /*\r\n * Get an instance of the respective model\r\n */\r\n case 'posts': \r\n $model = new Post; \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>create</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /*\r\n * Assign POST values to attributes \r\n */ \r\n foreach($_POST as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n * save the model\r\n */ \r\n if($model->save()) { \r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes) );\r\n } else {\r\n /*\r\n * Errors occurred\r\n */\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't create model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n\r\n var_dump($_REQUEST);\r\n }",
"public function actionCreate()\n {\n $model = new Trees();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new EnglishNanorep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model=new UserAddForm();\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['UserAddForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['UserAddForm'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->data->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Slaves();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Cuenta();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new MissionCarers;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['MissionCarers'])) {\n $model->attributes = $_POST['MissionCarers'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate()\n {\n $model = new StandartOne();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}",
"public function actionCreate()\n\t{\n\t\t$model=new Barangmasuk;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new TbDadosmes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Ddiet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Category();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function creating($model)\n\t{\n\t}",
"public function actionCreate()\n {\n $model = new CourseSite();\n\n if ($model->load(Yii::$app->request->post())){\n if($model->createCourseSite($model->course)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model=new User('create');\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->save())\n $this->redirect(array('/site/index'));\n }\n\n //Yii::app()->user->setFlash('success', Yii::t('user', '<strong>Congratulations!</strong> You have been successfully registered on our website! <a href=\"/\">Go to main page.</a>'));\n $this->render('create', compact('model'));\n }",
"public function actionCreate() {\r\n\t\t$model = new Follow ();\r\n\t\t\r\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\r\n\t\t\treturn $this->redirect ( [ \r\n\t\t\t\t\t'view',\r\n\t\t\t\t\t'id' => $model->followID \r\n\t\t\t] );\r\n\t\t} else {\r\n\t\t\treturn $this->render ( 'create', [ \r\n\t\t\t\t\t'model' => $model \r\n\t\t\t] );\r\n\t\t}\r\n\t}",
"public function actionCreate()\n {\n $model = new Content();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Peticiones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Menu();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n $model->save(false);\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new ApplicationPhoto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Tax;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'added' => 'yes']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }"
] | [
"0.79603285",
"0.7899161",
"0.7867811",
"0.75927806",
"0.75313586",
"0.7484811",
"0.7460639",
"0.7460639",
"0.7460639",
"0.7460639",
"0.7448453",
"0.74405783",
"0.74379086",
"0.74300754",
"0.74082154",
"0.7407433",
"0.7383522",
"0.7376161",
"0.7331919",
"0.7331402",
"0.7304172",
"0.7265338",
"0.72551215",
"0.7246207",
"0.72381186",
"0.7218869",
"0.7209191",
"0.72062534",
"0.7201642",
"0.71980333",
"0.71883386",
"0.7179205",
"0.7177549",
"0.7176835",
"0.71709096",
"0.71696675",
"0.7166974",
"0.7164755",
"0.71586317",
"0.71487236",
"0.7141893",
"0.71360224",
"0.70916754",
"0.70835376",
"0.7077768",
"0.70756775",
"0.7067238",
"0.7067238",
"0.7066845",
"0.7064091",
"0.70621467",
"0.7061582",
"0.7059685",
"0.7058834",
"0.70584774",
"0.7058145",
"0.7050076",
"0.70371234",
"0.70224667",
"0.7015732",
"0.7012614",
"0.7011999",
"0.70114076",
"0.7009796",
"0.7009461",
"0.70071685",
"0.6996576",
"0.6990944",
"0.69908595",
"0.69865847",
"0.6984029",
"0.69838494",
"0.6966998",
"0.69632185",
"0.6946474",
"0.6939406",
"0.69389963",
"0.69389486",
"0.6937064",
"0.69368523",
"0.6936188",
"0.6934177",
"0.6931992",
"0.69317883",
"0.69298327",
"0.6925767",
"0.692114",
"0.6918992",
"0.6918753",
"0.6918417",
"0.691613",
"0.69100094",
"0.68989515",
"0.68868375",
"0.68819416",
"0.6875323",
"0.6871289",
"0.68657225",
"0.68601424",
"0.6852403",
"0.6851449"
] | 0.0 | -1 |
Updates a particular model. If update is successful, the browser will be redirected to the 'admin' page. | public function actionUpdate($id) {
$model=Persona::model()->with(
array('condicionesEspeciales', 'situacionEconomica', 'situacionEconomica.situacionLaboral'))->findByPk($id);
if($model===null)
throw new CHttpException(404,'Esta intentando actualizar una Persona inexistente en el sistema');
$request = Yii::app()->request;
if($request->isPostRequest) {
$form = $model->dni != $request->getPost('PersonaForm')['dni'] ? new PersonaForm('dniUpdate') : new PersonaForm;
$form->attributes = $request->getPost('PersonaForm');
$form->persona_id = $model->id;
$form->id = $model->id;
if($form->validate()) {
PersonaManager::savePersona($form);
Yii::app()->user->setFlash('general-success', "$form->nombre $form->apellido ha sido actualizado.");
$this->redirect(Yii::app()->createUrl("persona/view") . '/' . $id);
}
} else {
$form = new PersonaForm;
$form->attributes = $model->attributes;
$form->attributes = $model->situacionEconomica->attributes;
$form->attributes = $model->situacionEconomica->situacionLaboral->attributes;
$form->condicionesEspeciales = array_map(function($e){return $e->id;}, $model->condicionesEspeciales);
}
$this->render('update', array('model'=>$form));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }",
"public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n\t{\n\n\t\t//print_r (Yii::app()->user);\n\t\tif (Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\n\t\t$model=$this->loadarticles();\n\t\t$params=array('Articles'=>$model);\n//\t\tif(Yii::app()->user->checkAccess('updateOwnArticle',$params))\n//\t\t{\n//\t\t\t\n\t\t\tif(isset($_POST['Articles']))\n\t\t\t{\n\t\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\t\tif($model->save()){\n\t\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t\t\t}\n\t\t\t}\n//\t\t}else{\n//\t\t\techo \"no permissions\";\n//\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->creator_id==Yii::$app->user->identity->id){\n \n if ($model->load(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', ['model' => $model,]);\n }\n\n else{\n return $this->redirect(['index']); \n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->creator_id==Yii::$app->user->identity->id){\n \n if ($model->load(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', ['model' => $model,]);\n }\n\n else{\n return $this->redirect(['index']); \n }\n }",
"public function actionUpdate($id)\n {\n $model=$this->loadModel($id);\n $model->scenario = 'admin';\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->save())\n $this->redirect(array('index'));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n// return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect('/content-menu');\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}",
"public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\n {\n \n $model = new Main();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n\n }\n \n \n\n }",
"public function updating($model)\n\t{\n\t}",
"public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n if($this->isAuthenticate())\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) \n {\n return $this->redirect(['index','type' => $model->IdEntityType]);\n } else \n {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }",
"public function actionUpdate($id)\n { \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n $this->layout='admin';\n \n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Bet']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Bet'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->parent_id=0;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->id]);\n } else {\n \t$locals=[];\n \t$locals['model']=$model;\n return $this->render('update', $locals);\n }\n }",
"public function actionUpdate($id)\n {\n if(Yii::$app->user->can('site-clerk'))\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }else \n {\n $this->redirect(\\Yii::$app->urlManager->createURL(\"site/login\"));\n }\n }",
"public function actionUpdate($id)\n {\n if (empty(Yii::$app -> user -> identity)) {\n return $this -> redirect(['site/login']);\n }\n\t if (!Yii::$app -> user -> can('adminEditor')) {\n throw new ForbiddenHttpException('您没有该项操作的权限!');\n }\n\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model -> save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n \n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n $this->layout=\"main\";\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->U_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id) {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index' ,'id' => $model->inmueble_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->No_]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n if(isset(Yii::$app->user->identity->id)){\n if(SiteController::findCom(17)){\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ADepId]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n else {\n $this->redirect(['site/error']);\n }\n }else {\n $this->redirect(['site/login']);\n }\n}",
"public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }",
"public function actionUpdate($id) {\n if (!Yii::$app->user->can('admin')) {\n throw new HttpException(403, 'You are not authorized to perform this action.');\n }\n $model = $this->findModel($id);\n \n if ($model->load(Yii::$app->request->post())) {\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $model->status = $model->status == 10 ? 1 : 0;\n return $this->render('update', [\n 'model' => $model,\n \n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function update($model)\n {\n\n Request::ajax() and exit($this->repository->update(Input::all()));\n\n if ($this->form->update(Input::all())) {\n return Input::get('exit') ?\n Redirect::route('admin.categories.index') :\n Redirect::route('admin.categories.edit', $model->id) ;\n }\n\n return Redirect::route('admin.categories.edit', $model->id)\n ->withInput()\n ->withErrors($this->form->errors());\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->user_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()))\n {\n if($model->save())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n var_dump($model->errors); die;\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n\n {\n\n $model = $this->findModel($id);\n\n\t\t\t\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n\t\t\t\n\n\t\t\tYii::$app->session->setFlash('orders', 'Orders has been updated successfully');\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n\n }\n\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->getRequest()->post(),'') && $model->save()) {\n return $this->redirect(['view', 'id' => $model->name]);\n }\n\n return $this->render('update', ['model' => $model]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->name]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->kamar_id]);\n // }\n if ($model->load(Yii::$app->request->post())) {\n // Yii::$app->creator->update($model);\n $model->updated_by = Yii::$app->user->identity->username;\n \t $model->updated_date = date(\"Y-m-d\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->kamar_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = Member::SCENARIO_ADMIN;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $this->layout = 'headbar';\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function update($model) :bool;",
"public\n function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ( $model->load(Yii::$app->request->post()) && $model->save() ) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id){\n //$id=getOrganisationID();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Saved successfully.');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $this->layout =\"main-admin\";\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_factura_gastos]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(Url::toRoute('index'));\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }"
] | [
"0.7983803",
"0.7602332",
"0.7572668",
"0.7508671",
"0.7430232",
"0.73916894",
"0.73629904",
"0.73629904",
"0.73537153",
"0.7338653",
"0.7336464",
"0.73334026",
"0.73258513",
"0.7273282",
"0.7263827",
"0.72186595",
"0.7211433",
"0.7210159",
"0.72007036",
"0.7195912",
"0.7189998",
"0.7168787",
"0.7167306",
"0.7162889",
"0.71568406",
"0.7154722",
"0.7145012",
"0.71388555",
"0.71296257",
"0.7124487",
"0.71244067",
"0.71243995",
"0.71208036",
"0.7112109",
"0.7108106",
"0.71052957",
"0.7097276",
"0.7097096",
"0.7093336",
"0.7083809",
"0.7076503",
"0.7073107",
"0.7069642",
"0.7069642",
"0.7069642",
"0.7069642",
"0.7069642",
"0.7069642",
"0.7069642",
"0.7065126",
"0.7065126",
"0.7065126",
"0.7065126",
"0.7065126",
"0.7065126",
"0.7065126",
"0.7058195",
"0.70558715",
"0.7052746",
"0.7052746",
"0.705117",
"0.70480365",
"0.7047097",
"0.70446134",
"0.70389855",
"0.703643",
"0.7035839",
"0.7035293",
"0.7032788",
"0.7028992",
"0.7028992",
"0.70270914",
"0.70236367",
"0.7020652",
"0.7019507",
"0.7017592",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155",
"0.70124155"
] | 0.0 | -1 |
Deletes a particular model. If deletion is successful, the browser will be redirected to the 'admin' page. | public function actionDelete($id) {
$persona = Persona::model()->with(array('titularidad', 'cotitularidad'))->findByPk($id);
if (is_null($persona->titularidad) && is_null($persona->cotitularidad)) {
$persona->delete();
} else {
http_response_code(400);
header('Content-type: application/json');
echo CJSON::encode(array('error'=>"No se puede eliminar la persona $persona->nombre $persona->apellido por estar vinculada a solicitudes."));
Yii::app()->end();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }",
"public function 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 actionDelete() {\n $model = new \\UsersModel();\n $login = $this->getParam('login');\n\n if ( $model->delete($login) ) {\n $this->flashMessage('Odstraněno', self::FLASH_GREEN);\n } else {\n $this->flashMessage('Záznam nelze odstranit', self::FLASH_RED);\n }\n\n $this->redirect('default');\n }",
"public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }",
"public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}",
"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 actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }",
"public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$model=$this->loadModel($_POST['id']);\n\t\t $model->delete();\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\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 actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->is_delete = 1;\n\n if($model->save())\n {\n return $this->redirect(['admin']);\n }\n }",
"public function delete($model);",
"public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }",
"public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }",
"public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }",
"public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }",
"public function actionDelete($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t\n\t\tif ($model) {\n\t\t\t$model->delete();\n\t\t}\n\n // if AJAX request (triggered by deletion via list grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\tif($model->deleted){\n\t\t\t$model->delete();\n\t\t}else{\n\t\t\t$model->scenario = 'delete';\n\t\t\t$model->deleted = 1;\n\t\t\t$model->update();\n\t\t}\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function deleting($model)\n\t{\n\t}",
"public function actionDelete() {\n\t\tif (isset($_POST) && $_POST['isAjaxRequest'] == 1) {\n\t\t\t$response = array('status' => '1');\n\t\t\t$model = $this->loadModel($_POST['id']);\n\t\t\t$model->is_deleted = 1;\n\t\t\tif ($model->save()) {\n\t\t\t\techo CJSON::encode($response);\n\t\t\t} else {\n\t\t\t\t$response = array('status' => '0', 'error' => $model->getErrors());\n\t\t\t\techo CJSON::encode($response);\n\t\t\t}\n\t\t}\n\t}",
"public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!Helper::get('ajax')) {\n $this->redirect(Helper::post('returnUrl') ? Helper::post('returnUrl') : array('admin'));\n }\n }",
"function delete()\n\t{\n\t\t$model = $this->getModel();\n\t\t$viewType\t= JFactory::getDocument()->getType();\n\t\t$view = $this->getView($this->view_item, $viewType);\n\t\t$view->setLayout('confirmdelete');\n\t\tif (!JError::isError($model)) {\n\t\t\t$view->setModel($model, true);\n\t\t}\n\t\t//used to load in the confirm form fields\n\t\t$view->setModel($this->getModel('list'));\n\t\t$view->display();\n\t}",
"public function actionDelete($id)\n\t{\n\t\t//$this->loadModel($id)->delete();\n $model=$this->loadModel($id);\n $model->IdEstadoSolicitudCita = 3;\n $model->save();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id) {\r\n $this->loadModel($id)->delete();\r\n\r\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n if (!isset($_GET['ajax']))\r\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n }",
"public function actionDelete($id) {\r\n $this->loadModel($id)->delete();\r\n\r\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n if (!isset($_GET['ajax']))\r\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n }",
"public function actionDelete($id)\n {\n\t$model = static::findModel($id);\n\n\t$this->processData($model, 'delete');\n\n\t$model->delete();\n\n \treturn $this->redirect(['index']);\n }",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }",
"public function actionDelete($id) {\n\t\t$this -> loadModel($id) -> delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif (!isset($_GET['ajax']))\n\t\t\t$this -> redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n {\n $model=$this->findModel ( $id );\n\t\t$model->is_delete=1;\n\t\t$model->save ();\n\n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n\t{\n if(file_exists(dirname(Fircms::$basePath).DIRECTORY_SEPARATOR.$this->loadModel($id)->path))\n unlink(dirname(Fircms::$basePath).DIRECTORY_SEPARATOR.$this->loadModel($id)->path);\n \n $this->loadModel($id)->delete();\n \n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}",
"public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}",
"public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}",
"public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}",
"public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $model->IsDelete=1;\n $model->save();\n Yii::$app->session->setFlash('success', \"Your message to display.\");\n return $this->redirect(['index']);\n }",
"public function delete(Model $model);",
"public function delete(Model $model);",
"public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }",
"public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }",
"public function actionDelete($id) {\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif (!isset($_GET['ajax'])) {\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}\n\n\t}",
"public function actionDelete($id)\r\n {\r\n $this->loadModel($id)->delete();\r\n\r\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n if (!isset($_GET['ajax']))\r\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n }",
"public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\tif (!($model = $this->loadModel()))\n\t\t\t\treturn;\n\t\t\t$model->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}",
"public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\t\t\\Yii::$app->session->setFlash('updated',\\Yii::t('admin', 'Данные успешно удалены'));\r\n return $this->redirect(['index']);\r\n }",
"public function actionDelete($id) {\n\t\t$model = $this->loadModel($id);\n\t\t$model->is_deleted = 1;\n\t\t$model->save();\n\t\t\n\t\t$this->redirect(array(\"/\".$model->type));\n\t}",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }",
"public function actionDelete()\n\t{\n\t\t$id = intval( Yii::app()->getRequest()->getParam('id') );\n\n\t\tif (!Yii::app()->getRequest()->getIsAjaxRequest() || empty($id))\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model = MainRoom::model()->findByPk($id);\n\t\tif (is_null($model))\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model->status = MainRoom::STATUS_DELETED;\n\t\t$model->save(false);\n\t\tdie ( CJSON::encode( array('success'=>true) ) );\n\n\t}",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $this->checkPermissionByModelsUserId($model->user_id);\n $model->delete();\n\n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n\t{\n\t\tif(Yii::app()->user->user_type==4){\n\t\t\t$this->layout='teacher';\n\t\t}\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t\t\n\t}",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id)\n {\n $this->loadModel($id)->delete();\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_REQUEST['returnUrl']) ? $_REQUEST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}",
"public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}"
] | [
"0.7514145",
"0.7507674",
"0.7422083",
"0.7376141",
"0.7370852",
"0.7282443",
"0.7233768",
"0.72136563",
"0.718974",
"0.7185",
"0.7168924",
"0.7166725",
"0.7163782",
"0.71252465",
"0.70983034",
"0.7008284",
"0.70082265",
"0.70079374",
"0.6986316",
"0.69688636",
"0.6951888",
"0.69480556",
"0.69421643",
"0.69335365",
"0.693301",
"0.693301",
"0.69244635",
"0.69088936",
"0.6902376",
"0.69016653",
"0.6888219",
"0.6881708",
"0.6881708",
"0.6881708",
"0.6881708",
"0.68749917",
"0.68657583",
"0.68657583",
"0.68634236",
"0.68634236",
"0.6863277",
"0.68604904",
"0.68548673",
"0.6849892",
"0.6846907",
"0.683667",
"0.683667",
"0.6836244",
"0.68315053",
"0.682451",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.6820336",
"0.68193376",
"0.6817099",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519",
"0.681519"
] | 0.0 | -1 |
Returns the data model based on the primary key given in the GET variable. If the data model is not found, an HTTP exception will be raised. | public function loadModel($id)
{
$model=Persona::model()->findByPk($id);
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');
return $model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Residencebaseinfo::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=LicenceApplication::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=emprestimo::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Dataset::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public static function Get($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (!is_array($key)) {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$key = array(\r\n\t\t\t\t$primary['fields'][0] => $key\r\n\t\t\t);\r\n\t\t}\r\n\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key for \" . get_called_class());\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$field} = ?\", $key[$field]);\r\n\t\t}\r\n\t\t//$src = Dbi_Source::GetModelSource($model);\r\n\t\t$result = $model->select();\r\n\t\tif ($result->count()) {\r\n\t\t\tif ($result->count() > 1) {\r\n\t\t\t\tthrow new Exception(\"{$cls} returned multiple records for primary key {$id}\");\r\n\t\t\t}\r\n\t\t\t$record = $result[0];\r\n\t\t} else {\r\n\t\t\t$record = new Dbi_Record($model, null);\r\n\t\t\t$record->setArray($key, false);\r\n\t\t}\r\n\t\treturn $record;\r\n\t}",
"public function loadModel() {\n if ($this->_model === null) {\n if (isset($_GET['id']))\n $this->_model = Project::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=DiasLetivos::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Report::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Invoice::model()->findByPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel() {\n if ($this->_model === null) {\n if (isset($_GET['id']))\n $this->_model = Alocacao::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Information::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t{\n\t\t\t\t$condition='';\n\t\t\t\t$this->_model=Chat::model()->findByPk($_GET['id'], $condition);\n\t\t\t}\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\n {\n if ($this->_model === null) {\n if (isset($_GET['id'])) {\n if (Yii::app()->user->isGuest)\n //$condition='status='.Post::STATUS_PUBLISHED.' OR status='.Post::STATUS_ARCHIVED;\n $condition = '';\n else\n $condition = '';\n $this->_model = Object::model()->with(array('author','files'))->findByPk($_GET['id']);\n }\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }",
"public function __get($key)\n\t{\n\t\t// See if we are requesting a foreign key\n\t\tif (isset($this->_data[$key.'_id']))\n\t\t{\n\t\t\tif (isset($this->_lazy[$key])) // See if we've lazy loaded it\n\t\t\t{\n\t\t\t\t$model = AutoModeler::factory($key);\n\t\t\t\t$model->process_load($this->_lazy[$key]);\n\t\t\t\t$model->process_load_state();\n\t\t\t\treturn $model;\n\t\t\t}\n\n\t\t\t// Get the row from the foreign table\n\t\t\treturn AutoModeler::factory($key, $this->_data[$key.'_id']);\n\t\t}\n\t\telse if (isset($this->_data[$key]))\n\t\t\treturn $this->_data[$key];\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=RR_TipoHorario::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=TBantuanData::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = Consultor::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Programa::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Respuestas::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Clap::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Recargas::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Tshirt::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id){\n\t\t$model=Contact::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=KqxsBac::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Column::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Patient::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id){\n\t\t\n\t\t$model=XhTitle::model()->findByPk($id);\n\t\t\n\t\tif($model===null)\n\t\t\t\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\n\t\treturn $model;\n\t\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Results::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=PPJadwaldokterM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Materia::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Coordocs::model()->findByPk($id+0);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Employe::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Alumno::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Quote3::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = TblServer::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id) {\n $model = TblServer::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=DeedMaster::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Ios::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Study::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Kzone::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Pooja::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}",
"public function getModelByPrimaryKey($action = null, $keyValue = null)\n {\n $keyName = $this->model->getKeyName();\n\n if ($keyValue == '_') {\n if ($this->request()->has(\"data.primaryKey.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.primaryKey.{$keyName}\");\n } elseif ($this->request()->has(\"data.old.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.old.{$keyName}\");\n } elseif ($this->request()->has('data.items')) {\n $items = $this->request()->input('data.items');\n if (Arr::has($items, $keyName)) {\n $keyValue = Arr::get($items, $keyName);\n } else {\n $first = Arr::first($items);\n if (Arr::has($first, $keyName)) {\n $keyValue = Arr::get($first, $keyName);\n }\n }\n }\n }\n\n $data = [$keyName => $keyValue];\n\n $r = $this->validateData($data, null, 'primaryKey', $action, [$keyName => ['includeUniqueRules' => false]]);\n if ($r !== true) {\n return $r;\n }\n\n $modelClass = get_class($this->model);\n if ($model = $modelClass::find($data[$keyName])) {\n return $model;\n }\n\n return CrudJsonResponse::error(CrudHttpErrors::TARGET_DATA_MODEL_NOT_FOUND, null, [\n 'action' => 'primaryKey',\n 'parent_action' => $action,\n 'target' => $data,\n ]);\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Entry::model()->with('entryAnswers')->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel()\n {\n if ($this->_model === null)\n {\n if (isset($_GET['id']))\n $this->_model = User::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=ARTICULOS::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Knowledgecatalogue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = Package::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=User::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id)\n {\n $model=Domain::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=ElBezQuests::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Basic_definition::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=PPDokrekammedisM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Repository::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=RKPengirimanrmT::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Sale::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Korzet::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'A keresett tartalom nem található.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=DProcessoDisciplinar::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = Fddemandreceipt::model()->findByPk((int) $id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Stone::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Store::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=PegawaiM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Solicitudes::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Quotes::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The Requested Page Does Not Exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Docingresados::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Pagosconceptos::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public abstract function find($primary_key, $model);",
"public function loadModel($id)\n\t{\n\t\t$model=CerDoc::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=JobSummary::model()->findByPk($id);\n \n \n \n \n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model = InfoSpares::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public function loadModel($id)\n {\n $model=Seat::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id){\r\r\n\r\r\n\t $model=OrdenConsumo::model()->findByPk($id);\r\r\n\r\r\n\t if($model===null)\r\r\n\t throw new CHttpException(404,'The requested page does not exist.');\r\r\n\t return $model;\r\r\n\r\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Pegawai::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Image::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Image::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Customer::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Cooperativepartner::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model=Services::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Gejala::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel()\n\t{\n\t\tif( $this->_model===null )\n\t\t{\n\t\t\t$itemName = $this->getItemName();\n\t\t\t\n\t\t\tif( $itemName!==null )\n\t\t\t{\n\t\t\t\t$this->_model = $this->_authorizer->authManager->getAuthItem($itemName);\n\t\t\t\t$this->_model = $this->_authorizer->attachAuthItemBehavior($this->_model);\n\t\t\t}\n\n\t\t\tif( $this->_model===null )\n\t\t\t\tthrow new CHttpException(404, Rights::t('core', 'The requested page does not exist.'));\n\t\t}\n\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Topik::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Roomclosure::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=CollectionShop::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model=Product::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=CitasReservada::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Ncr::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('common','The requested page does not exist.'));\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model = Exam::model()->findByPk($id);\n\t\tif ($model === null)\n\t\t\tthrow new CHttpException(404, 'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = Carrer::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function getModel($key)\n {\n\n if (isset($this->models[$key]))\n return $this->models[$key];\n else\n return null;\n\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Talonario::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Pedido::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Pedido::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Task::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = Item::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Question::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}"
] | [
"0.6996049",
"0.69626486",
"0.6855551",
"0.6704187",
"0.66484696",
"0.66410875",
"0.6635331",
"0.66255236",
"0.66221076",
"0.66171694",
"0.66130376",
"0.661131",
"0.65576166",
"0.6556155",
"0.654081",
"0.6540365",
"0.653337",
"0.65329456",
"0.6527233",
"0.65264654",
"0.6522224",
"0.6487434",
"0.6484452",
"0.6478553",
"0.6476627",
"0.64480096",
"0.64409447",
"0.64366394",
"0.6431319",
"0.6430966",
"0.6428472",
"0.6428439",
"0.6426591",
"0.64264977",
"0.64121455",
"0.6411584",
"0.6406946",
"0.6394325",
"0.6394325",
"0.6391932",
"0.6391442",
"0.6391007",
"0.6386198",
"0.6378761",
"0.6377792",
"0.63752854",
"0.637466",
"0.63714945",
"0.6370748",
"0.6370269",
"0.63700086",
"0.63699234",
"0.63645136",
"0.63630366",
"0.6361564",
"0.6360302",
"0.6360019",
"0.6358747",
"0.6356635",
"0.63539475",
"0.63434565",
"0.6335518",
"0.6335137",
"0.6332289",
"0.6330198",
"0.6329132",
"0.6328002",
"0.6327709",
"0.63266474",
"0.63226867",
"0.6319972",
"0.6318853",
"0.63171977",
"0.63150513",
"0.6309088",
"0.63083434",
"0.63075465",
"0.6307089",
"0.6307089",
"0.63063115",
"0.63041323",
"0.63004535",
"0.6300126",
"0.6299731",
"0.6296159",
"0.6295507",
"0.62940073",
"0.6293543",
"0.6291408",
"0.6290733",
"0.62893707",
"0.6288375",
"0.62874186",
"0.62868917",
"0.6281378",
"0.62808233",
"0.62808233",
"0.62793416",
"0.62783265",
"0.6275349"
] | 0.63764805 | 45 |
Mark this leaf as completed for a user. | public function markCompletedFor($a_user_id) {
global $ilAppEventHandler;
$ilAppEventHandler->raise("Services/Tracking", "updateStatus", array(
"obj_id" => $this->getId(),
"usr_id" => $a_user_id,
"status" => ilLPStatus::LP_STATUS_COMPLETED_NUM,
"percentage" => 100
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mark_complete() {\n // Create record\n $this->timecompleted = time();\n\n // Save record\n if ($this->id) {\n $this->update();\n } else {\n $this->insert();\n }\n\n // Mark course completion record as started (if not already)\n $cc = array(\n 'course' => $this->course,\n 'userid' => $this->userid\n );\n $ccompletion = new completion_completion($cc);\n $ccompletion->mark_inprogress($this->timecompleted);\n }",
"public function setActiveAttemptCompleted(LearningPath $learningPath, TreeNode $treeNode, User $user)\n {\n $activeAttempt = $this->attemptService->getOrCreateActiveTreeNodeAttempt($learningPath, $treeNode, $user);\n\n $activeAttempt->setCompleted(true);\n $this->trackingRepository->update($activeAttempt);\n }",
"public function complete($completed = true)\n {\n $this->update(compact('completed'));\n }",
"public function setCompletedBy(?WorkbookEmailIdentity $value): void {\n $this->getBackingStore()->set('completedBy', $value);\n }",
"public function markAsCompleted()\n {\n $this->forceFill(['completed_at' => now()])->save();\n\n return $this;\n }",
"public function markWorkoutAsComplete(){\n $this->autoRender = false;\n \n $success = true;\n $message = 'Workout has been marked as complete.';\n \n //get user id and check authentication\n $userId = $this->Session->check('User.id')?$this->Session->read('User.id'):'';\n if(empty($userId)){\n $success = false;\n $message = 'Authentication Failed';\n }\n \n if(!$this->request->is('put')){\n $success = false;\n $message = 'Invalid request method';\n }\n \n $data = $this->request->input('json_decode', true); \n if(empty($data)){\n return;\n }\n $programWorkoutId = $data['programWorkoutId'];\n $completed = isset($data['completed'])?$data['completed']:1;\n \n $respData = [];\n $this->loadModel('UserWorkout');\n try{\n \n $userProgramWorkoutId = $this->chkUserPogramWorkout($userId, $programWorkoutId);\n \n $userWrokoutdata = [];\n $userWrokoutdata['UserWorkout']['user_id'] = $userId;\n $userWrokoutdata['UserWorkout']['program_workout_id'] = $programWorkoutId;\n $userWrokoutdata['UserWorkout']['completed_status'] = $completed;\n if(!empty($userProgramWorkoutId)){\n //update the data for given id\n $userWrokoutdata['UserWorkout']['id'] = $userProgramWorkoutId; \n }\n $this->UserWorkout->save($userWrokoutdata);\n } catch (Exception $ex) {\n $message = $ex->getMessage();\n $success = false;\n }\n \n //prepare response \n $resp = $this->UserWorkout->prepareResponse($success, $message, $respData); \n return $resp;\n }",
"function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}",
"public function setFinished(User $user, Order $order)\n {\n if ($user->isChef()) {\n return false;\n }\n\n return ($user->id == $order->waiter_id) && ($order->order_status_id == 5);\n }",
"public function markAsDone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 1\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}",
"public function setIsCompleted($value)\n {\n $this->setItemValue('is_completed', (bool)$value);\n }",
"public static function maybe_mark_complete() {\n\t\t// The install notice still exists so don't complete the profiler.\n\t\tif ( ! class_exists( 'WC_Admin_Notices' ) || \\WC_Admin_Notices::has_notice( 'install' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );\n\t\t// Don't make updates if the profiler is completed, but task list is potentially incomplete.\n\t\tif ( isset( $onboarding_data['completed'] ) && $onboarding_data['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data['completed'] = true;\n\t\tupdate_option( self::PROFILE_DATA_OPTION, $onboarding_data );\n\t\tupdate_option( 'woocommerce_task_list_hidden', 'yes' );\n\t}",
"public static function _hasUserCompleted($a_obj_id, $a_user_id)\n\t{\n\t\treturn (self::_lookupStatus($a_obj_id, $a_user_id) == self::LP_STATUS_COMPLETED_NUM);\n\t}",
"public function questComplete($questid, $userid)\n {\n $query = $this->dbh->prepare('UPDATE `playerquests` SET `completed` = 1\n WHERE `questid` = ?\n AND `userid` = ?');\n $query->execute(array($questid, $userid));\n }",
"public function setIsComplete(?bool $value): void {\n $this->getBackingStore()->set('isComplete', $value);\n }",
"public function isCompletedByCurrentUser()\n {\n return SwagUser::getCurrent()->isSwagpathCompleted($this);\n }",
"public function setComplete($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->complete !== $v) {\n $this->complete = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_COMPLETE] = true;\n }\n\n return $this;\n }",
"public function setUploadCompleted(bool $completed = true): void\n {\n $this->uploadCompletedAt = $completed ? new DateTime() : null;\n }",
"public function completeTour()\n {\n $userOnBoarding = auth()->user()->userOnBoarding;\n $userOnBoarding->completed_tour = true;\n $userOnBoarding->save();\n Session::forget('first_login');\n }",
"public function markComplete($id) {\n\n // Recover the task.\n $task = Task::find($id);\n\n // Verify it's actually recovered\n if(is_null($task)) {\n Session::flash('flash_message', 'Unable to locate task');\n return redirect('/tasks');\n }\n\n // Mark complete\n $task->complete = 1;\n\n // save\n $task->save();\n\n // Let the user know, get on with it.\n Session::flash('flash_message', 'Completed: '.$task->description);\n return redirect('/tasks');\n }",
"public function markVerifiedForUser(User $user): void\n {\n session()->put($this->getMfaVerifiedSessionKey($user), 'true');\n }",
"function annotation_user_complete($course, $user, $mod, $annotation) {\n}",
"public function completing($task)\n {\n $task->update(['complete' => true]);\n\n $this->createActive('create_with_complete_task', 'App\\Models\\Task', $this->id);\n }",
"function setCompleted() {\n global $connection, $user;\n\n $this->movePosition(1);\n\n $sql = 'update TR_BATCH set completed_date = now() where tr_batch_id = ?';\n if ($statement = $connection->prepare($sql)) {\n $statement->bind_param(\"i\", $this->batch_id);\n $statement->execute();\n } else {\n throw new Exception(\"Database connection failed\");\n }\n }",
"function completeLessonbyUser($userEmail, $lessonId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"UPDATE UserLesson SET lessonCompleted='1' WHERE emailUser='\" . $userEmail . \"' AND idLesson='\" . $lessonId . \"' \";\n\n\t\t$result = $conn->query($query);\n\n\t}",
"protected function resolveStatusAndSetCompletedFields()\n {\n if ($this->status != Task::STATUS_COMPLETED)\n {\n $this->completed = false;\n }\n else\n {\n $this->completed = true;\n }\n\n if ($this->completed == true)\n {\n if ($this->completedDateTime == null)\n {\n $this->completedDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time());\n }\n $this->unrestrictedSet('latestDateTime', $this->completedDateTime);\n }\n }",
"public function transactionDone(User $user)\n {\n //Empty The Field.\n }",
"public static function MarkOrderProcessAsCompleted()\n {\n $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS] = true;\n }",
"public function mark_completed($todo=null)\n {\n \n try {\n // if the returned instance wasn't found\n if(\\is_null($todo)) {\n return $this->resourceNotFound();\n }\n\n // mark the Todo as completed\n $todo->update(['completed' => 1] );\n \n return $this->sendResponse(new TodoResource($todo), 'Successfully marked as completed');\n \n } catch (\\Throwable $th) {\n \\Log::error($th);\n return $this->sendServerError('Unable to mark Todo as completed');\n }\n }",
"private function complete_login(Users $user)\n {\n // Update the number of logins\n $user->logins = $user->logins + 1;\n\n // Set the last login date\n $user->last_login = time();\n\n // Save the user\n $user->update();\n }",
"public function giveBadgeIfProfileCompleted(User $user)\n {\n return $this->getProfileCompletedBadge($user);\n }",
"public function completed() {\n\t}",
"public function finish(\\DateTimeInterface $fd = null, User $user)\n {\n if ($fd === null) {\n $fd = new \\DateTime(\"now\");\n }\n $this->finisheddate = $fd;\n $this->datemailsent = $fd;\n $this->dranUser = $user;\n $this->finished = true;\n }",
"function etherpadlite_user_complete($course, $user, $mod, $etherpadlite) {\n return true;\n}",
"public function complete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_IN_PROGRESS) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }",
"protected function complete()\n {\n parent::complete();\n }",
"public function setCompleted($completed) {\n\t\t// if passed in completed is not Y or N\n\t\tif(strtoupper($completed) !== 'Y' && strtoupper($completed) !== 'N') {\n\t\t\tthrow new TaskException(\"Task completed is not Y or N\");\n\t\t}\n\t\t$this->_completed = strtoupper($completed);\n\t}",
"public function markAsCompleted(Monsieur_Task_Priority $priority) {\n $priority->setIsCompleted(true);\n return $this->update($priority);\n }",
"function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {\n return true;\n}",
"function setComplete()\n {\n $this->complete = true;\n return $this;\n }",
"public function taskComplete(){\n $taskId = $_POST[\"taskId\"];\n\n $this->individualGroupModel->changeTaskCompletion($taskId, true);\n\n //redirect\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }",
"public function markAsUndone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 0\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}",
"function roshine_user_complete($course, $user, $mod, $roshine) {\n}",
"public function done()\n {\n $this->setStatus(self::STATUS_DONE);\n }",
"public function completed()\n {\n return $this->state(function (array $attributes) {\n return [\n 'completed' => 1,\n 'time_completed' => Carbon::now(),\n ];\n });\n }",
"public function emailApprovalByUser($user) {\n\t\t$user->getPrimaryElectronicAddress()->setApproved(TRUE);\n\t\t$this->personRepository->update($user);\n\t\t$this->persistenceManager->persistAll();\n\t}",
"protected function finish()\n {\n if (LilyModule::instance()->enableLogging)\n LilyModule::instance()->user->inited = true;\n LilyModule::instance()->user->save();\n if (is_string($this->finishRedirectUrl))\n $redirectUrl = Yii::app()->createUrl($this->finishRedirectUrl);\n else\n $redirectUrl = Yii::app()->createUrl($this->finishRedirectUrl[0], array_slice($this->finishRedirectUrl, 1));\n Yii::log(\"userIniter finished\", CLogger::LEVEL_INFO, 'lily');\n Yii::app()->request->redirect($redirectUrl);\n }",
"public function setTaskDone()\n {\n // Simply unlink our task file.\n unlink($this->taskFilePath);\n }",
"public function isCompleted(): bool\n {\n return $this->status == 'completed';\n }",
"public function complete($user_id)\n\t{\n\t\tif(isset($user_id)) {\n\t\t\t$user = User::find($user_id);\n\t\t}else{\n\t\t\t$user = new User;\n\t\t}\n\t\treturn view('pages/tools.referee.complete', compact('user'));\n\t}",
"function ProjectTasksForUser(&$user) {\n\t\t$this->User =& $user;\n\t\treturn true;\n\t}",
"public function setActiveAttemptTotalTime(\n LearningPath $learningPath, TreeNode $treeNode, User $user\n )\n {\n $activeAttempt = $this->attemptService->getOrCreateActiveTreeNodeAttempt($learningPath, $treeNode, $user);\n\n $activeAttempt->calculateAndSetTotalTime();\n $this->trackingRepository->update($activeAttempt);\n }",
"public function setCompletedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('completedDateTime', $value);\n }",
"function findCompletedOrdersByUser(User $user);",
"function i4_is_unit_complete($course_id, $user_id, $unit_id) {\n global $wpcwdb, $wpdb;\n $wpdb->show_errors();\n\n $completed_status = \"complete\";\n\n //Here we grab the unit info for units that are completed for the users course.\n $SQL = $wpdb->prepare(\"SELECT * FROM $wpcwdb->units_meta LEFT JOIN $wpcwdb->user_progress\n ON $wpcwdb->units_meta.unit_id=$wpcwdb->user_progress.unit_id\n WHERE parent_course_id = %d AND unit_completed_status = %s AND user_id = %d\", $course_id, $completed_status, $user_id);\n\n //Store the Completed units Array\n $completed_units = $wpdb->get_results($SQL);\n\n $completed_unit_ids = array();\n\n //set the counter\n $i = 0;\n\n //Store the Unit ID's into the completed unit id's array\n foreach ($completed_units as $completed_unit) {\n $completed_unit_ids[$i] = $completed_unit->unit_id;\n $i++;\n }\n //If the unit is in the completed units array, display the completed checkmark.\n if (in_array($unit_id, $completed_unit_ids)) {\n return true;\n }\n else {\n return false;\n }\n }",
"function updateUser() {\n\t\t$rating = $this -> getTaskRating();\n\t\t$sql = \"Update Users set finishedBasic=1, userRating=userRating+\" . $rating . \" where UID= (Select t.UID from Task t WHERE t.TaskId=\" . $this -> data[0]['TaskId'] . \")\";\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this -> checkforLast();\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to update user with TaskId=' . $this -> data[0]['TaskId'], $this -> id);\n\t\t}\n\t}",
"public function markCompleted()\n {\n $this->instance->markCompleted();\n\n return $this;\n }",
"public function setCompleteUsersCount(?int $value): void {\n $this->getBackingStore()->set('completeUsersCount', $value);\n }",
"function tquiz_user_complete($course, $user, $mod, $tquiz) {\n}",
"public function markAsUncompleted()\n {\n $this->forceFill(['completed_at' => null])->save();\n\n return $this;\n }",
"protected function completeJob() {\n\t\t$this->isComplete = 1;\n\t\t$nextgeneration = new CheckExternalLinksJob();\n\t\tsingleton('QueuedJobService')->queueJob($nextgeneration,\n\t\t\tdate('Y-m-d H:i:s', time() + self::$regenerate_time));\n\t}",
"public function inCompleting($task)\n {\n $task->update(['complete' => false]);\n\n $this->createActive('create_with_incomplete_task', 'App\\Models\\Task', $this->id);\n }",
"public function isCompletedByUser($swagUser)\n {\n return $swagUser->isSwagpathCompleted($this);\n }",
"function saveCompletionStatus() \n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$complete = 0;\n\t\tif ($this->isComplete()) \n\t\t{\n\t\t\t$complete = 1;\n\t\t}\n if ($this->getSurveyId() > 0) \n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"UPDATE svy_svy SET complete = %s, tstamp = %s WHERE survey_id = %s\",\n\t\t\t\tarray('text','integer','integer'),\n\t\t\t\tarray($this->isComplete(), time(), $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t}",
"public function markCompeted() {\n $this->status = self::COMPLETED;\n }",
"public function onQuestionnaireUserDoneEvent(QuestionnaireUserEvent $event)\n {\n if (($questionnaireUser = $event->getEntity())) {\n if (($user = $questionnaireUser->getUser())) {\n if (($focus = $user->getFocus())) {\n if (($userAnswers = $questionnaireUser->getAnswers())) {\n\n $categoryPriority = array();\n foreach ($userAnswers as $userAnswer) {\n if (($question = $userAnswer->getQuestion())) {\n if (($categories = $question->getCategories())) {\n foreach ($categories as $category) {\n\n if (!isset($categoryPriority[$category->getId()])) {\n $categoryPriority[$category->getId()] = array();\n }\n\n array_push($categoryPriority[$category->getId()], $userAnswer);\n }\n }\n }\n }\n\n foreach ($categoryPriority as $id => $row) {\n $categoryPriority[$id] = $this->doCalculateCategoryPosition($row);\n }\n\n if (arsort($categoryPriority)) {\n if (($order = array_keys($categoryPriority))) {\n if (($focusCategories = $focus->getCategories())) {\n $entityManager = $this->container->get('entity_manager');\n\n $priorityRest = (count($order) - 1);\n foreach ($focusCategories as $focusCategory) {\n if (($category = $focusCategory->getCategory())) {\n\n if (($priority = array_search($category->getId(), $order)) !== false) {\n $focusCategory->setPriority((int)$priority);\n } else {\n $focusCategory->setPriority((int)++$priorityRest);\n }\n\n $entityManager->persist($focusCategory);\n $entityManager->flush($focusCategory);\n }\n }\n\n $entityManager->refresh($focus);\n }\n }\n }\n }\n }\n }\n }\n }",
"function grade($user) {\n $nid = (int) $this->getInstanceId();\n\n $result = reset(quiz_get_score_data(array($nid), $user->uid));\n if ($result && ($result->percent_score >= $result->percent_pass)) {\n $this->getFulfillment()->setGrade($result->percent_score)->setComplete()->save();\n }\n else {\n $this->getFulfillment()->setGrade($result->percent_score)->save();\n }\n }",
"public function complete_login()\n\t{\n\t\tif ($this->loaded())\n\t\t{\n\t\t\t// Update the number of logins\n\t\t\t$this->logins = $this->logins + 1;\n\n\t\t\t// Set the last login date\n\t\t\t$this->last_login = time();\n\n\t\t\t// Save the user\n\t\t\t$this->save();\n\t\t}\n\t}",
"public function setStatus(string $status, User $user = null): self\n {\n if ($status === $this->status) {\n return $this;\n }\n\n if ($status === self::STATUS_PENDING) {\n $this->completionDate = null;\n } else {\n $this->completionDate = new \\DateTime();\n }\n\n if ($user !== null) {\n $this->history[] = sprintf(\n 'Status changed to \"%s\" by %s, %s',\n self::ALL_STATUS_LABELS[$status],\n $user->getDisplayName(),\n (new \\DateTime())->format('d/m/Y H:i a')\n );\n }\n\n $this->status = $status;\n\n return $this;\n }",
"public function test_ouwiki_core_calendar_provide_event_action_already_completed_for_user() {\n global $CFG;\n\n $CFG->enablecompletion = 1;\n\n // Create the activity.\n $course = $this->getDataGenerator()->create_course(['enablecompletion' => 1]);\n $ouwiki = $this->getDataGenerator()->create_module('ouwiki', ['course' => $course->id],\n ['completion' => 2, 'completionview' => 1, 'completionexpected' => time() + DAYSECS]);\n\n // Enrol a student in the course.\n $student = $this->getDataGenerator()->create_and_enrol($course, 'student');\n\n // Get some additional data.\n $cm = get_coursemodule_from_instance('ouwiki', $ouwiki->id);\n\n // Create a calendar event.\n $event = $this->create_action_event($course->id, $ouwiki->id,\n \\core_completion\\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED);\n\n // Mark the activity as completed for the student.\n $completion = new \\completion_info($course);\n $completion->set_module_viewed($cm, $student->id);\n\n // Create an action factory.\n $factory = new \\core_calendar\\action_factory();\n\n // Decorate action event for the student.\n $actionevent = mod_ouwiki_core_calendar_provide_event_action($event, $factory, $student->id);\n\n // Ensure result was null.\n $this->assertNull($actionevent);\n }",
"function setComplete($complete = 1) {\n $this->fulfillment['complete'] = $complete;\n return $this;\n }",
"public function complete();",
"public function complete();",
"public function setWorkCompleted($var)\n {\n GPBUtil::checkInt64($var);\n $this->work_completed = $var;\n\n return $this;\n }",
"function completeOrder($order)\n{\n\t//$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);\n\n\tif ($order->getState() != Mage_Sales_Model_Order::STATE_COMPLETE)\n\t{\n\t\tif(abs($order->getGrandTotal() - $order->getBaseTotalPaid()) < 0.00001) {\n\t\t\t$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);\n\t\t\t$order->setStatus(\"complete\");\n\n\t\t\t$order->addStatusHistoryComment('Pedido finalizado pela distribuidora.');\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$order->save();\n\t\t\t\tdebug('Pedido '.$order->getId().' finalizado.');\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tdebug('Pedido não finalizado: ' . $e->getMessage());\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo 'O pedido já foi finalizado'.\"\\n\";\n\t}\n}",
"public function trigger_profile_completed_action( $old_value, $value ) {\n\t\tif ( isset( $old_value['completed'] ) && $old_value['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $value['completed'] ) || ! $value['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Action hook fired when the onboarding profile (or onboarding wizard,\n\t\t * or profiler) is completed.\n\t\t *\n\t\t * @since 1.5.0\n\t\t */\n\t\tdo_action( 'woocommerce_onboarding_profile_completed' );\n\t}",
"public function milestoneComplete($type)\n {\n $freeCoins = Config::get('values')['freeCoins'];\n if (isset($freeCoins[$type])) {\n\n MilestoneRewards::add($type, $freeCoins[$type], $this->user);\n\n }\n }",
"public function setCompletedAt(\\DateTime $completedAt);",
"public function setComplete()\n\t{\n\t\tif (isset(Model::$raw['translations'])) {\n\t\t\t$this->setTranslations(Model::$raw['translations']);\n\t\t}\n\t}",
"public function acknowledgeMembership(KittyInterface $kitty, UserInterface $user);",
"public function isCompleted()\n {\n return $this->completed;\n }",
"public function complete($node, stdClass $row) {\n // If this is a top-level book, don't set a parent.\n $book_id = $row->nid == $row->book_id ? $node->nid : $this->lookupMigratedBook($row->book_id);\n // Book id - effectively, parent nid.\n $node->book['bid'] = $book_id;\n $node->book['nid'] = $node->nid;\n $node->book['weight'] = $row->book_weight;\n _book_update_outline($node);\n node_save($node);\n }",
"public function test_course_progress_not_tracked_user() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Now, mark the course as completed.\n $ccompletion = new completion_completion(array('course' => $course->id, 'userid' => $user->id));\n $ccompletion->mark_complete();\n\n // The course completion should return 100.\n $this->assertEquals('100', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n\n // Now make the user's role to be not tracked for completion.\n unassign_capability('moodle/course:isincompletionreports', $studentrole->id);\n\n // Check that the result is null now.\n $this->assertNull(\\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }",
"static function setInProgressIfNotAttempted($a_obj_id, $a_user_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// #11513\n\n\t\t$needs_update = false;\n\n\t\t$set = $ilDB->query(\"SELECT usr_id, status FROM ut_lp_marks WHERE \".\n\t\t\t\" obj_id = \".$ilDB->quote($a_obj_id, \"integer\").\" AND \".\n\t\t\t\" usr_id = \".$ilDB->quote($a_user_id, \"integer\")\n\t\t\t);\t\t\t\n\t\tif ($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\t// current status is not attempted, so we need to update\n\t\t\tif($rec[\"status\"] == self::LP_STATUS_NOT_ATTEMPTED_NUM)\n\t\t\t{\n\t\t\t\t$needs_update = true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no ut_lp_marks yet, we should update\n\t\t\t$needs_update = true;\n\t\t}\n\t\t\t\n\t\tif($needs_update)\n\t\t{\n\t\t\trequire_once \"Services/Tracking/classes/class.ilLPStatusWrapper.php\";\n\t\t\tilLPStatusWrapper::_updateStatus($a_obj_id, $a_user_id);\n\t\t}\n\t}",
"public function setUserDataTraded($userDataTraded) {\n\t\t$this->userDataTraded = (bool) $userDataTraded;\n\t}",
"public function setFinished($value)\t\r\n\t{\r\n\t\tif ( is_bool($value) )\r\n\t\t{\r\n\t\t\t$this->finished = $value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new \\InvalidArgumentException(\"param 1 must be of type bool\");\r\n\t\t}\r\n\t}",
"public function setSubmittedbyuser($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->submittedbyuser !== $v) {\n\t\t\t$this->submittedbyuser = $v;\n\t\t\t$this->modifiedColumns[] = VenuePeer::SUBMITTEDBYUSER;\n\t\t}\n\n\t\tif ($this->aUser !== null && $this->aUser->getUserid() !== $v) {\n\t\t\t$this->aUser = null;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function vitero_user_complete($course, $user, $mod, $vitero) {\n\n}",
"public function isComplete() {\n if ( !empty($this->aliasId) && !empty($this->email) && !empty($this->username)) {\n return true;\n } else {\n return false;\n }\n }",
"public function appRegCompleted($username) {\n\n $selectUser = \"select unique_key from users where username='$username'\";\n $resUserDetail = $this->getDBRecords($selectUser);\n $username = $resUserDetail[0]['unique_key'];\n\n $arrComp = array();\n $arrComp['appCompleted'] = 'Y';\n $condition = \" username='$username'\";\n $this->Update(\"user_registration\", $arrComp, $condition);\n }",
"public function hasCompleted() : bool\n {\n return $this->completed_at !== null;\n }",
"public function finished() {\n $this->setFinishedAt(new MongoDate());\n $this->save();\n }",
"function setDateCompleted($dateCompleted) {\n\t\t$this->setData('dateCompleted', $dateCompleted);\n\t}",
"function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}",
"public function finish(User $user, Request $request)\n {\n return $user->isAdmin();\n }",
"protected function completeRunningJob()\n {\n $runningJob = $this->objFromFixture(QueuedJobDescriptor::class, 'runningjob');\n $runningJob->JobStatus = 'Complete';\n $runningJob->write();\n\n $runningJob = $this->objFromFixture(QueuedJobDescriptor::class, 'immediatependingjob');\n $runningJob->JobStatus = 'Complete';\n $runningJob->write();\n }",
"public function setHeadAttribute(User $user)\n {\n foreach ($this->heads as $head) {\n $this->heads()->updateExistingPivot($head->id, ['main' => false]);\n }\n if ( ! $this->heads->contains($user) ) {\n $this->heads()->save($user, ['main' => true]);\n } else {\n $this->heads()->updateExistingPivot($user->id, ['main' => true]);\n }\n }",
"public function setStatus(User $user, $status){\n $user->setStatus($status);\n $user->save();\n\n return $this->respond($user);\n }",
"public function markRead($user)\n {\n $this->getNotification($user)->markAsRead();\n }",
"public function check_order_complete()\n\t{\n\t\tforeach ( $this->completed_statuses as $completed ) {\n\t\t\tadd_action( 'woocommerce_order_status_' . $completed, array( 'TGS_Commission', 'log_commission_due' ) );\n\t\t}\n\t}",
"public function complete( $order ){\n\t\t$order->complete();\n\t}"
] | [
"0.68063885",
"0.6559841",
"0.63267815",
"0.62253404",
"0.59917057",
"0.58770436",
"0.58551323",
"0.57687795",
"0.5694659",
"0.56599915",
"0.56224483",
"0.5597721",
"0.5558037",
"0.5512748",
"0.54968286",
"0.54931045",
"0.54824984",
"0.54628104",
"0.5461529",
"0.5454887",
"0.5429896",
"0.5366617",
"0.5341182",
"0.53337693",
"0.52789474",
"0.52712065",
"0.52594465",
"0.52536654",
"0.52471846",
"0.52341586",
"0.522785",
"0.5214134",
"0.5179451",
"0.5170315",
"0.5152254",
"0.51087916",
"0.506816",
"0.5058745",
"0.50343627",
"0.50236964",
"0.5003341",
"0.5002822",
"0.49976733",
"0.49828216",
"0.49791527",
"0.49613622",
"0.49532616",
"0.49495432",
"0.4947797",
"0.49468344",
"0.49287236",
"0.49198407",
"0.49198133",
"0.4914462",
"0.4906082",
"0.49058253",
"0.4905146",
"0.49022457",
"0.48999545",
"0.48955107",
"0.4891492",
"0.4873587",
"0.48644814",
"0.4856715",
"0.4852263",
"0.48485318",
"0.48478028",
"0.4844226",
"0.48310137",
"0.4821157",
"0.4814284",
"0.4814284",
"0.48140937",
"0.48014382",
"0.48012665",
"0.47978804",
"0.47923636",
"0.47892958",
"0.4772115",
"0.47644705",
"0.47593364",
"0.47525477",
"0.47509623",
"0.47332132",
"0.47317576",
"0.4730113",
"0.47269568",
"0.47203937",
"0.471271",
"0.47007307",
"0.46948114",
"0.46891177",
"0.46851793",
"0.46828592",
"0.4682607",
"0.46818268",
"0.4678796",
"0.46758515",
"0.4675186",
"0.4671054"
] | 0.7415121 | 0 |
Returns the test database connection. | protected function getConnection()
{
if ($this->_connectionMock == null) {
$this->_connectionMock = $this->getMock(
'Zend_Test_PHPUnit_Db_Connection',
[],
[new Zend_Test_DbAdapter(), "schema"]
);
}
return $this->_connectionMock;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection(TEST_DB_PDO(), TEST_GET_DB_INFO()->ldb_name);\n\t}",
"protected function getConnection()\n {\n require_once dirname(__FILE__) . '/bootstrap_pdo.php';\n return getConnectionToTestDB();\n }",
"protected function getConnection()\n {\n require_once __DIR__ . '/../../../doctrine/bootstrap_pdo.php';\n return getConnectionToTestDB();\n }",
"public final function getConnection() {\n\t\t// if the connection hasn't been established, create it\n\t\tif($this->connection === null) {\n\t\t\t// connect to mySQL and provide the interface to PHPUnit\n\n\n\t\t\t$secrets = new \\Secrets(\"/etc/apache2/capstone-mysql/busters.ini\");\n\t\t\t$pdo = $secrets->getPdoObject();\n\t\t\t$this->connection = $this->createDefaultDBConnection($pdo, $secrets->getDatabase());\n\t\t}\n\t\treturn($this->connection);\n\t}",
"public function getDbConnection() {\n\t\tif ($this->_db === null) {\n\t\t\t$dsn = 'sqlite2:'.__DIR__.'/test.db';\n\t\t\t$this->_db = new CDbConnection($dsn);\n\t\t}\n\t\treturn $this->_db;\n\t}",
"public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }",
"protected function getDatabaseConnection() {\n\t\treturn $GLOBALS['TYPO3_DB'];\n\t}",
"protected function getDatabaseConnection() {\n\t\treturn $GLOBALS['TYPO3_DB'];\n\t}",
"public function getConnection(): \\codename\\core\\database\r\n {\r\n return $this->db;\r\n }",
"public final function getConnection() {\n\t\t//If the connection has not been established yet, create it\n\t\tif($this->connection === null) {\n\t\t\t//connect to mySQL and provide the interface to PHPUnit\n\n\t\t\t$config = readConfig(\"/etc/apache2/capstone-mysql/jpegery.ini\");\n\t\t\t$pdo = connectToEncryptedMySQL(\"/etc/apache2/capstone-mysql/jpegery.ini\");\n\t\t\t$this->connection = $this->createDefaultDBConnection($pdo, $config[\"database\"]);\n\t\t}\n\t\treturn($this->connection);\n\t}",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_DB'];\n }",
"public function getConnection() {\n return Database::instance();\n }",
"public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }",
"public function getConnection()\n\t{\n\t\treturn empty($this->db_conn) ? Db::getConnection($this->getConnectionName()) : $this->db_conn;\n\t}",
"public function getConnection()\n {\n return $this->db;\n }",
"public static function getConnection() {\n if (!self::$db) {\n //new connection object\n new dbConn();\n }\n //return connection\n return self::$db;\n }",
"protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_CONF_VARS']['DB'];\n }",
"public static function getDbConnection(){\n\t\tif(!isset(self::$db)){\n\t\t\tself::setDbConnection();\n\t\t}\n\t\treturn self::$db;\n\t}",
"public static function getConnection(){\n return static::$db;\n }",
"public static function conn()\n {\n return (static::inst())::$_db;\n }",
"public static function get_connection() {\n if (static::$instance === null) {\n static::$instance = new Database;\n }\n return static::$instance->db_handle;\n\t}",
"protected function db()\n\t\t{\n\t\t\tif( !$this->_db ) {\n\t\t\t\t$this->_db = \\Kalibri::db()->getConnection( $this->connectName );\n\t\t\t}\n\n\t\t\treturn $this->_db;\n\t\t}",
"public function db()\n {\n return $this->getConnection();\n }",
"public function getConnection(){\n \n $this->conn = null;\n \n if (is_dir($this->db_url)) {\n $this->conn=$this->db_url;\n }\n \n return $this->conn;\n }",
"public static function getDBConnection() {\n if (DB::$db==null) {\n DB::$db = new self();\n }\n return DB::$db->dbh;\n }",
"public static function getConnection() {\r\n //Guarantees single instance, if no connection object exists then create one.\r\n if (!self::$db) {\r\n //new connection object.\r\n new dbConn();\r\n }\r\n //return connection.\r\n return self::$db;\r\n }",
"protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }",
"function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"protected static function getDatabaseConnection() {}",
"protected static function getDatabaseConnection() {}",
"protected static function getDatabaseConnection() {}",
"protected function getDatabaseTester()\n {\n if ($this->databaseTester === null) {\n $this->databaseTester = $this->newDatabaseTester();\n }\n\n return $this->databaseTester;\n }",
"public function connection()\n {\n return static::$DB;\n }",
"public function getConnection() {\r\n return $this->_connection;\r\n //return new mysqli( 'localhost', 'root', '', 'sandbox' );\r\n }",
"public function getConnection()\n {\n return Database::getConnection($this->connection);\n }",
"private function getDbConnection()\n {\n $config = $this->config;\n $connectionParams = array(\n 'path' => $this->appRoot . '/vpu.db',\n 'driver' => $config['config']['database']['driver']\n );\n return DriverManager::getConnection($connectionParams, new Configuration());\n }",
"public static function getDbConnection()\n {\n $db = mysqli_connect('localhost', 'root', '', 'shop');\n return $db;\n }",
"protected function getConnection()\n {\n $pdo = new PDO($GLOBALS['DB_DSN'],\n $GLOBALS['DB_USER'],\n $GLOBALS['DB_PASSWORD']);\n return $this->createDefaultDBConnection($pdo, $GLOBALS['DB_NAME']);\n }",
"public function getConnection()\n {\n if (isset($GLOBALS['db_type'], $GLOBALS['db_username'], $GLOBALS['db_password'],\n $GLOBALS['db_host'], $GLOBALS['db_name'], $GLOBALS['db_port'],\n $GLOBALS['tmpdb_type'], $GLOBALS['tmpdb_username'], $GLOBALS['tmpdb_password'],\n $GLOBALS['tmpdb_host'], $GLOBALS['tmpdb_name'], $GLOBALS['tmpdb_port'])) {\n $realDbParams = [\n 'driver' => $GLOBALS['db_type'],\n 'user' => $GLOBALS['db_username'],\n 'password' => $GLOBALS['db_password'],\n 'host' => $GLOBALS['db_host'],\n 'dbname' => $GLOBALS['db_name'],\n 'port' => $GLOBALS['db_port']\n ];\n $tmpDbParams = [\n 'driver' => $GLOBALS['tmpdb_type'],\n 'user' => $GLOBALS['tmpdb_username'],\n 'password' => $GLOBALS['tmpdb_password'],\n 'host' => $GLOBALS['tmpdb_host'],\n 'dbname' => $GLOBALS['tmpdb_name'],\n 'port' => $GLOBALS['tmpdb_port']\n ];\n\n $realConn = \\Doctrine\\DBAL\\DriverManager::getConnection($realDbParams);\n\n $platform = $realConn->getDatabasePlatform();\n\n if ($platform->supportsCreateDropDatabase()) {\n\n $dbname = $realConn->getDatabase();\n // Connect to tmpdb in order to drop and create the real test db.\n $tmpConn = \\Doctrine\\DBAL\\DriverManager::getConnection($tmpDbParams);\n $realConn->close();\n\n $tmpConn->getSchemaManager()->dropDatabase($dbname);\n $tmpConn->getSchemaManager()->createDatabase($dbname);\n\n $tmpConn->close();\n } else {\n\n $sm = $realConn->getSchemaManager();\n\n /* @var $schema Schema */\n $schema = $sm->createSchema();\n $stmts = $schema->toDropSql($realConn->getDatabasePlatform());\n\n foreach ($stmts AS $stmt) {\n try {\n $realConn->exec($stmt);\n } catch (\\Exception $e) {\n // TODO: Now is this a real good idea?\n }\n }\n }\n\n $conn = \\Doctrine\\DBAL\\DriverManager::getConnection(array_merge(['wrapperClass' => 'Pagekit\\Database\\Connection'], $realDbParams), null, null);\n } else {\n $params = [\n 'driver' => 'pdo_sqlite',\n 'memory' => true\n ];\n if (isset($GLOBALS['db_path'])) {\n $params['path'] = $GLOBALS['db_path'];\n unlink($GLOBALS['db_path']);\n }\n $conn = \\Doctrine\\DBAL\\DriverManager::getConnection(array_merge(['wrapperClass' => 'Pagekit\\Database\\Connection'], $params));\n }\n\n return $conn;\n }",
"public function getConnection()\n {\n return $this->createDefaultDBConnection($this->_pdo, Zend_Registry::get('config')->database->dbname);\n }",
"public function getConnection()\n {\n return $this->createDefaultDBConnection($this->_pdo, Zend_Registry::get('config')->database->dbname);\n }",
"static function getDbConnection() {\n\n if (empty(static::$db)) {\n $pdo = Service::get('pdo');\n static::$db = new \\PDO($pdo['dns'], $pdo['user'], $pdo['password']);\n }\n return static::$db;\n }",
"public static function getConnection()\n {\n if (static::$connection == null) {\n static::$connection = new mysqli(static::DB_HOST, static::DB_USER, static::DB_PASS, static::DB_NAME);\n\n if (static::$connection == null) die(\"Couldn't connect to the database\");\n }\n\n return static::$connection;\n }",
"function getDatabaseConnection() {\n\t\tif (!$dbHost = $_SERVER[\"DB_SERVER_PGSQL\"]) {\n\t\t\t$dbHost = \"localhost\";\n\t\t}\n\t\t// Database Connection\n\t\tif (!$dbConnection = pg_connect(\"host={$dbHost} port=5432 dbname=SmsGateway user=WebUser password=test\")) {\n\t\t\ttrigger_error(\"Database Error\", E_USER_ERROR);\n\t\t\texit;\n\t\t}\n\t\treturn $dbConnection;\n\t}",
"public static function getConnection() {\n\t\tif (self::$db === null) {\n\t\t\t$conf = ConfManager::getConf();\n\t\t\t$mysqli = new \\mysqli(\n\t\t\t\t$conf['DB_HOST'],\n\t\t\t\t$conf['DB_USER'],\n\t\t\t\t$conf['DB_PASS'],\n\t\t\t\t$conf['DB_NAME']\n\t\t\t);\n\n\t\t\tif ($mysqli->connect_error) {\n\t\t\t\tdie('Connection failed: ' . $mysqli->connect_error);\n\t\t\t}\n\n\t\t\t$mysqli->set_charset('utf-8');\n\n\t\t\tself::$db = $mysqli;\n\t\t}\n\n\t\treturn self::$db;\n\t}",
"public static function getConnection(){\n if (self::$_instance === null){\n self::$_instance = new DB();\n }\n return self::$_instance;\n }",
"function getDatabaseConnection() {\n return new \\mysqli(Config::DB_HOST, Config::DB_USERNAME, Config::DB_PASSWORD, Config::DB_DATABASE, Config::DB_PORT);\n }",
"public function GetConn() {\n\n return $this->\n config['dbconn'];\n }",
"public static function connect() {\n\t\tif(!self::$conn) {\n\t\t\tnew Database();\n\t\t}\n\t\treturn self::$conn;\n\t}",
"public static function getConnection() {\n return self::$defaultConnection;\n }",
"public function getDatabaseConnection(){\n return $this->dbConnection;\n }",
"protected function getDatabase()\n {\n if(!self::$_database)\n {\n self::connect();\n }\n return self::$_database;\n }",
"protected function getDatabaseConnection()\n\t{\n\t\t$connection = $this->royalcms['config']['cache.connection'];\n\n\t\treturn $this->royalcms['db']->connection($connection);\n\t}",
"public function get_connection()\n {\n return $this->connection();\n }",
"public function getDatabase()\n {\n\n $this->checkConnection();\n return $this->database;\n }",
"public function getConnection()\n {\n $connection = DB::connection($this->poolName);\n\n if (isset($this->database)) {\n $connectionDatabase = $connection->getSelectDb() ?: $connection->getDb();\n if ($this->database !== $connectionDatabase) {\n $connection->db($this->database);\n }\n }\n\n return $connection;\n }",
"private function connection()\n {\n return Database::connection($this->connectionName);\n }",
"private function connectToDatabase()\n {\n return DbConnection::connectToDatabase($this->link);\n }",
"protected function getConnection()\n {\n $host = DB_HOST;\n $dbName = DB_NAME;\n $dbUser = DB_USER;\n $dbPass = DB_PASS;\n // mysql\n $dsn = 'mysql:host=' . $host . ';dbName=' . $dbName;\n $db = new \\PDO($dsn, $dbUser, $dbPass);\n $connection = $this->createDefaultDBConnection($db, $dbName);\n return $connection;\n }",
"function dbConnection()\n {\n $theEnv = getTheEnvironment();\n\n $user = $theEnv->database->dbuser;\n $password = $theEnv->database->dbpass;\n $dbname = $theEnv->database->dbname;\n $dbdomain = $theEnv->database->domain;\n $mysqli = new mysqli($dbdomain, $user, $password, $dbname);\n\n return $mysqli;\n }",
"public function getConnection()\n\t{\n\t\tif($this->connection === null) {\n\t\t\t$this->connect();\n\t\t}\n\n\t\treturn $this->connection;\n\t}",
"public function get_database_resource()\n\t{\n\t\t$this->_connection or $this->connect();\n\n\t\treturn $this->_connection;\n\t}",
"private function getConnection(): Connection\n {\n return $this->databaseConnection;\n }",
"public function getConnection()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\treturn $this->conn;\n\t\t\t}\n\t\t}",
"protected function getConnection(): PDO\n {\n $dbConfig = $this->config->getSettings(Config::_DB);\n $adapterParams = $dbConfig[self::DB_SLOT_TEST][self::DB_NAME_TEST];\n $adapter = new \\App\\Component\\Db\\Adapter\\PdoMysql(\n self::DB_NAME_TEST,\n $adapterParams\n );\n return $adapter->connect()->getConnection();\n }",
"protected function _getConnection()\n {\n if (!self::$_dbConnection) {\n $config = app::getConfig('db');\n $mysqli = new mysqli($config['host'], $config['user'], $config['pass'], $config['db']);\n if ($mysqli->connect_errno) {\n self::$_dbConnection = FALSE;\n app::log($mysqli->errno . ' - ' . $mysqli->error, app::LOG_LEVEL_ERROR);\n } else {\n self::$_dbConnection = $mysqli;\n }\n }\n return self::$_dbConnection;\n }",
"public function getConnection() {\n return $this->objDBConnection;\n }",
"public function getConnection() {\n return $this->objDBConnection;\n }",
"public function getDbConnection()\n {\n $this->conn = Registry::get('db');\n }",
"public function getConnection(){\n return $this->dbConnection;\n }",
"public function getDbConnection()\n\t{\n\t\treturn parent::getDbConnection();\n\t}",
"protected function getConnection()\n {\n $pdo = new PDO(DB_DSN, DB_USER, DB_PASS);\n return new DefaultConnection($pdo, DB_NAME);\n }",
"public static function getDatabaseConnection() {\n\t\treturn self::$con;\n\t}",
"protected static function getDatabaseConnection() : Database\n {\n static $db = null;\n \n if ($db === null)\n {\n $db = new Database(Config::DB_HOST, Config::DB_USER, Config::DB_PASSWORD, Config::DB_NAME, Config::DB_CHARSET);\n }\n\n return $db;\n }",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}",
"protected function getDatabaseConnection() {}"
] | [
"0.8405055",
"0.818261",
"0.8097701",
"0.7885442",
"0.78112644",
"0.7587071",
"0.75766855",
"0.75766855",
"0.75739884",
"0.75572073",
"0.7518859",
"0.7518859",
"0.7518859",
"0.7518859",
"0.7518859",
"0.7518859",
"0.7518859",
"0.7518859",
"0.7518859",
"0.75096536",
"0.7502171",
"0.7444916",
"0.74371046",
"0.7396752",
"0.73927456",
"0.736087",
"0.7343933",
"0.7342235",
"0.73354197",
"0.7319735",
"0.72676456",
"0.7248585",
"0.7235103",
"0.72296673",
"0.7196919",
"0.7189309",
"0.716766",
"0.7166201",
"0.7166201",
"0.7151963",
"0.7149871",
"0.71455413",
"0.7144523",
"0.7122516",
"0.71177286",
"0.7089812",
"0.70791334",
"0.70775115",
"0.70775115",
"0.70761573",
"0.7073166",
"0.70681554",
"0.7065179",
"0.70618343",
"0.70574343",
"0.7055641",
"0.7055598",
"0.705487",
"0.7053594",
"0.7053378",
"0.70445067",
"0.7037051",
"0.7029096",
"0.7018488",
"0.70081717",
"0.6996589",
"0.69952095",
"0.6986589",
"0.6970495",
"0.69507575",
"0.6948352",
"0.6947625",
"0.69430685",
"0.69385743",
"0.6931573",
"0.6931573",
"0.69297874",
"0.69292396",
"0.69281757",
"0.6924249",
"0.6924085",
"0.69178396",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126",
"0.6911126"
] | 0.74655384 | 21 |
Returns the test dataset. | protected function getDataSet()
{
return new CompositeDataSet([]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getDataSet()\n {\n return $this->createMySQLXMLDataSet(__DIR__ . '/../paczkolab_test.xml');\n }",
"protected function getDataSet()\n {\n //Dataset TokenTest.xml has the minimal data we need to perform our tests\n $classFile = str_replace('.php', '.xml', __FILE__);\n return $this->createFlatXMLDataSet($classFile);\n }",
"protected function getDataSet(){\n return $this->createXMLDataSet(\n dirname(__FILE__) . '/../_dataSet/commonTest.xml'\n );\n }",
"protected function getDataSet(){\n return $this->createXMLDataSet(\n dirname(__FILE__) . '/../_dataSet/commonTest.xml'\n );\n }",
"protected function getDataSet()\n {\n return new \\PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/DataSet/base.yml');\n }",
"protected function getDataSet()\n\t{\n\t\treturn $this->createXMLDataSet(dirname(__FILE__).'/_fixtures/DirectDeposit.fixture.xml');\n\t}",
"protected function getDataSet()\n {\n $testcase = $this->getName(false);\n // Just basename fails on linux systems\n $className = str_replace('.php', '', __FILE__);\n $classFile = $className . '.xml';\n $testFile = $className . '_' . $testcase . '.xml';\n if (file_exists($testFile)) {\n return new \\PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($testFile);\n }\n if (file_exists($classFile)) {\n return new \\PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($classFile);\n }\n\n return null;\n }",
"public function readTestData()\n {\n return $this->testData->get();\n }",
"function getDataSet() {\n\t\treturn $this->addDataSets(array(\"init.yml\"));\n\t}",
"function getDataSet() {\n\t\treturn $this->addDataSets(array(\"init.yml\"));\n\t}",
"public static function get_dataset()\r\n {\r\n $ds = new Datasets();\r\n return $ds->get_by_type(self::DATASET_TYPE);\r\n }",
"protected function getDataSet() {\n\t\treturn $this->createXMLDataSet ( dirname ( __FILE__ ) . '\\..\\..\\data\\cron\\empty_dstable_1_article_2_attach_test_data.xml' );\n\t}",
"protected function getDataSet()\n {\n return $this->createFlatXMLDataSet(dirname(__FILE__) . '/truncateDataTables.xml');\n // Use below to return an empty data set if we don't want to truncate and seed\n //return new PHPUnit_Extensions_Database_DataSet_DefaultDataSet();\n }",
"protected function getDataSet()\n {\n return $this->createXMLDataSet(FIXTURE . '/Xml/bookAndAuthor.xml');\n }",
"protected function getDataSet()\n {\n $seedFilePath = __DIR__ . '/databaseXml/seed.xml';\n return $this->createXMLDataSet($seedFilePath);\n }",
"protected function getDataSet() {\n\t\treturn $this->createXMLDataSet ( dirname ( __FILE__ ) . '\\..\\..\\data\\cron\\1_DS_1_article_test_1_dupl_attach_1_unpub_attach_1_new_valid_DS_data.xml' );\n\t}",
"public function getDataSet()\n\t{\n\t\treturn new PHPUnit_Extensions_Database_DataSet_XmlDataSet(dirname(__FILE__) . '/../data/Users.xml');\n\t}",
"public function getDataSet()\n {\n return $this->getConnection()->createDataSet();\n }",
"protected function getDataSet()\n {\n $dataset = $this->createFlatXMLDataSet(__DIR__ . '/../../../doctrine/truncateDataTables.xml');\n return $dataset;\n // Use below to return an empty data set if we don't want to truncate and seed\n //return new PHPUnit_Extensions_Database_DataSet_DefaultDataSet();\n }",
"public function dataset()\n {\n return $this->data;\n }",
"abstract public function getTestData(): array;",
"protected function getDataSet()\n\t{\n\t\t$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', \"'\", '\\\\');\n\n\t\t$dataSet->addTable('jos_languages', JPATH_TEST_DATABASE . '/jos_languages.csv');\n\n\t\treturn $dataSet;\n\t}",
"abstract protected function getDataSet();",
"protected function getDataSet()\n\t{\n\t\t$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', \"'\", '\\\\');\n\n\t\t$dataSet->addTable('jos_extensions', JPATH_TEST_DATABASE . '/jos_extensions.csv');\n\n\t\treturn $dataSet;\n\t}",
"public function getDataSet()\n {\n $originalXml = dirname(__FILE__).'/Flats/all-original-data.xml';\n return $this->createFlatXMLDataSet($originalXml);\n }",
"public function getDataSet()\n {\n $originalXml = dirname(__FILE__).'/Flats/all-original-data.xml';\n return $this->createFlatXMLDataSet($originalXml);\n }",
"abstract protected function getTestData() : array;",
"public static function getDataset()\n {\n $dataset = new Beans\\Dataset();\n \n $dataset->setStatus(0);\n $dataset->setCreatedOn(date(Application::TIMESTAMP));\n $dataset->setDistinctMolecules(0);\n $dataset->setInitialMolecules(0);\n $dataset->setIsCleaned(0);\n $dataset->setTs(date(Application::TIMESTAMP));\n \n return $dataset;\n }",
"function getDataSets()\n {\n if ($this->getResource('wdrs:describedby')){\n $dataset = $this->getResource('wdrs:describedby')->all('void:inDataset');\n }else {\n $schemaUrls = $this->allResources('schema:url');\n $describedBy = array_filter($schemaUrls, function($schemaUrl)\n {\n return(strpos($schemaUrl->getURI(), 'worldcat.org/title'));\n });\n $describedBy = array_shift($describedBy);\n $dataset = $describedBy->all('void:inDataset');\n }\n \n return $dataset;\n }",
"protected function getDataSet()\n {\n return $this->createFlatXMLDataSet(dirname(__FILE__).'/_files/category.xml');\n }",
"public function testDatasetReturnsData()\n {\n $size = 100;\n\n $response = $this->get('/api/dataset?size={$size}');\n\n $response->assertStatus(200);\n $response->assertJsonCount($size, \"\");\n }",
"public function getTestData()\n {\n return [\n 'user_id' => 1,\n 'status' => 1,\n 'created_at' => '2016-01-21 15:00:00',\n 'updated_at' => '2016-01-21 18:00:00'\n ];\n }",
"public function provideTestData()\n {\n return [\n ['9141405', true],\n ['1709107983', true],\n ['0122116979', true],\n ['0121114867', true],\n ['9030101192', true],\n ['9245500460', true],\n\n ['9141406', false],\n ['1709107984', false],\n ['0122116970', false],\n ['0121114868', false],\n ['9030101193', false],\n ['9245500461', false],\n ];\n }",
"protected function getTestData(){\n\t\treturn \"application/testdata/Pagers.php\" ;\n\t}",
"protected function getDataSet()\n {\n return new ArrayDataSet($this->getDataSetArray());\n }",
"protected function getDataSet()\n {\n return $this->getYamlDataSet('bookings.yml');\n }",
"public function getDataSetCollection(): DataSetCollection {\n\n return $this->dataSetCollection;\n\n }",
"protected function getDataSet()\n {\n return $this->createArrayDataSet([\n 'eventbus_event' => [\n [\n 'id' => '1',\n 'update_time' => '2017-11-20 17:12:59',\n 'create_time' => '2017-11-20 17:12:59',\n 'event_id' => '0115060e-cdd3-11e7-b85c-02427a6bfbd8',\n 'event_name' => 'open',\n 'topic' => 'merchant',\n 'payload' => '{\"merchant_id\":3333}',\n ],\n ],\n 'eventbus_subscriber' => [\n [\n 'id' => '1',\n 'update_time' => '2017-11-20 17:14:34',\n 'create_time' => '2017-11-20 17:14:34',\n 'topic' => 'merchant',\n 'notify_url' => 'http://localhost/event-bus/notification',\n 'enabled' => 1,\n ],\n ],\n 'eventbus_log' => [],\n ]);\n }",
"protected function fixtureData() {\n\t\t$rows = array();\n\t\tfor($i = 0; $i < 50; $i++) {\n\t\t\t$rows[] = array(\n\t\t\t\t\"name\" => \"Test Item \".$i,\n\t\t\t\t\"popularity\" => $i,\n\t\t\t\t\"author\" => \"Test Author \".$i,\n\t\t\t\t\"description\" => str_repeat(\"lorem ipsum dolor est \",rand(3,20)),\n\n\t\t\t);\n\t\t}\n\t\treturn $rows;\n\t}",
"public function getDataSet()\n {\n return new ArrayDataSet( array(\n 'Faculty' => array(\n array('facID' => 1, 'userName' => 'alvin', 'passWord' => 'pw', 'email' => '[email protected]', 'firstName' => 'alvin', 'lastName' => 'one'),\n array('facID' => 2, 'userName' => 'palmer', 'passWord' => 'pw123', 'email' => '[email protected]', 'firstName' => 'palmer', 'lastName' => 'two'),\n array('facID' => 3, 'userName' => 'gunay', 'passWord' => '$pw2', 'email' => '[email protected]', 'firstName' => 'gunay', 'lastName' => 'three')\n ),\n )\n );\n }",
"protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }",
"public function getData() {\n\t\t// si les donnée ne sont pas initialisé, on les crée\n\t\tif (empty($this->DataSet)) {$this->setDataSet(new pData());}\n\t\treturn $this->DataSet;\n\t}",
"public function testCanGetDatasetByTitleAndOptionallyByAccountAndProject() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n $topLevel = new DatasetInstanceSummary(\"Top Level Dataset\", \"test-json\");\n $topLevelId = $this->datasetService->saveDataSetInstance($topLevel, null, null);\n\n $account1 = new DatasetInstanceSummary(\"Account Dataset 1\", \"test-json\");\n $account1Id = $this->datasetService->saveDataSetInstance($account1, null, 1);\n\n $account2 = new DatasetInstanceSummary(\"Account Dataset 2\", \"test-json\");\n $account2Id = $this->datasetService->saveDataSetInstance($account2, null, 2);\n\n $project1 = new DatasetInstanceSummary(\"Project Dataset 1\", \"test-json\");\n $project1Id = $this->datasetService->saveDataSetInstance($project1, \"soapSuds\", 2);\n\n $project2 = new DatasetInstanceSummary(\"Project Dataset 2\", \"test-json\");\n $project2Id = $this->datasetService->saveDataSetInstance($project2, \"wiperBlades\", 2);\n\n $this->assertEquals($this->datasetService->getDataSetInstance($topLevelId), $this->datasetService->getDataSetInstanceByTitle(\"Top Level Dataset\", null, null));\n $this->assertEquals($this->datasetService->getDataSetInstance($account1Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 1\", null, 1));\n $this->assertEquals($this->datasetService->getDataSetInstance($account2Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 2\", null, 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project1Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 1\", \"soapSuds\", 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project2Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 2\", \"wiperBlades\", 2));\n\n\n }",
"public function provideTestData()\n {\n return [\n // variant one\n ['1197423162', true],\n ['1000000606', true],\n\n // variant one\n ['8137423260', false],\n ['600000606', false],\n ['51234309', false],\n\n // variant two\n ['1000000406', true],\n ['1035791538', true],\n ['1126939724', true],\n ['1197423460', true],\n\n // variant two\n ['1000000405', false],\n ['1035791539', false],\n ['8035791532', false],\n ['535791830', false],\n ['51234901', false],\n ];\n }",
"public function provideTestData()\n {\n return [\n // variant 1\n ['1016', true],\n ['26260', true],\n ['242243', true],\n ['242248', true],\n ['18002113', true],\n ['1821200043', true],\n ['1011', false],\n ['26265', false],\n ['18002118', false],\n ['6160000024', false],\n\n // variant 2\n ['1015', true],\n ['26263', true],\n ['242241', true],\n ['18002116', true],\n ['1821200047', true],\n ['3456789012', true],\n ['242249', false],\n ['1234567890', false],\n ];\n }",
"public function testData()\n {\n $output = $this->primer->getPatterns(array('components/test-group/data-autoload'), false);\n\n $this->assertEquals($output, '1.2');\n }",
"public function provideTestData()\n {\n return [\n // Variant 1\n ['6100272324', true],\n ['6100273479', true],\n\n ['6100272885', false],\n ['6100273377', false],\n ['6100274012', false],\n\n // Variant 2\n ['5700000000', true],\n ['5700000001', true],\n ['5799999998', true],\n ['5799999999', true],\n\n ['5699999999', false],\n ['5800000000', false],\n ];\n }",
"public final function getDataSet(): QueryDataSet {\n\t\t$dataset = new QueryDataSet($this->getConnection());\n\t\t$dataset->addTable(\"role\");\n\t\t$dataset->addTable(\"profile\");\n\t\t$dataset->addTable(\"posting\");\n\t\t$dataset->addTable(\"savedJob\");\n\t\treturn $dataset;\n\t}",
"public function get_all_tests()\n\t{\n\t\treturn $this->db->get('test')->result();\n\t}",
"protected function fixture() {\n return new \\rdbms\\sqlite3\\SQLite3Connection(new \\rdbms\\DSN('sqlite://localhost/'));\n }",
"function get_data()\n\t{\n\t\t$query = $this->db->get(\"Testing\");\n\n\t\treturn $query;\n\t}",
"public function getTestcases() {\n if ($this->graded_testcases === null) {\n $this->loadTestcases();\n }\n return $this->graded_testcases;\n }",
"protected function getDataSet()\n {\n $dir = $GLOBALS['DB_CSV_DIR'];\n\n // create a new CSV data set\n $dataSet = new CsvDataSet();\n\n $dataSet->addTable('Address', $dir . \"Address.csv\");\n $dataSet->addTable('Person', $dir . \"Person.csv\");\n $dataSet->addTable('EmailAddress', $dir . \"EmailAddress.csv\");\n $dataSet->addTable('L_EmailAddressType', $dir . \"L_EmailAddressType.csv\");\n $dataSet->addTable('R_PersonEmailAddress', $dir . \"R_PersonEmailAddress.csv\");\n\n return $dataSet;\n }",
"public static function getDataSetType()\n {\n return static::$datasetType;\n }",
"protected function fixture() {\n return new \\rdbms\\ibase\\InterBaseConnection(new \\rdbms\\DSN('ibase://localhost/'));\n }",
"public function getBigqueryDataset()\n {\n return $this->bigquery_dataset;\n }",
"public function dataSets()\n\t{\n\t\treturn $this->data_sets;\n\t}",
"function dataset0 ( ) // 允許外界直接[接觸]到內部的_dataset (可能反向排序)\n{\n return $this->_dataset;\n}",
"private function getTestData()\n {\n return [\n 'url' => 'http://www.mystore.com',\n 'access-token' => 'thisisaccesstoken',\n 'integration-token' => 'thisisintegrationtoken',\n 'method' => \\Magento\\Framework\\HTTP\\ZendClient::POST,\n 'body'=> ['token' => 'thisisintegrationtoken','url' => 'http://www.mystore.com'],\n ];\n }",
"public function getTestAddAndGetData()\n {\n return [\n ['namespace_1', 'key_11'],\n ['namespace_2', 'key_21'],\n ];\n }",
"public function getTests();",
"public static function getExampleResponseDataStore()\n {\n return array (\n 'id' => 1,\n 'name' => 'Tester Tesrov',\n 'email' => '[email protected]',\n 'email_verified_at' => '',\n 'role' => '0',\n 'api_token' => '733260741c131187810bc1a0a6446628653f9e5c4cc9f17402d6131b619cc5fb',\n 'created_at' => '2019-09-14 23:36:27',\n 'updated_at' => '2019-09-15 00:04:14',\n 'deleted_at' => '',\n );\n }",
"public function dataSet()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\DataSet');\n\t}",
"public function _fixtures()\n {\n return [\n\n 'base_date' => [\n 'class' => BaseDataFixture::class,\n 'dataFile' => codecept_data_dir() . 'base_data_data.php',\n ],\n\n ];\n }",
"public function getTrainDataset($strategy)\n {\n $res = new Bets(Bet::where('active', false)\n ->where('strategy_key', $strategy)\n ->orderBy('id', 'asc')->get());\n\n //$data = $res->toCsv();\n $dataset = $this->createDataset($res);\n\n\n return $dataset;\n\n }",
"public function getDataProvider()\n {\n return $this->dataProvider;\n }",
"public function getBigqueryOutputDataset()\n {\n return $this->bigquery_output_dataset;\n }",
"public function getSetDataProvider() {}",
"public function setTestData(Dataset $dataset)\n {\n $this->testData = $dataset;\n }",
"protected function getOneTest()\n {\n $endpoint = $this->getPluralName();\n $responseKey = $this->getCamelCasedPluralName();\n $loader = $this->getDataLoader();\n $data = $loader->getOne();\n $returnedData = $this->getOne($endpoint, $responseKey, $data['user']);\n $this->compareData($data, $returnedData);\n\n return $returnedData;\n }",
"protected function fixture() {\n return new \\rdbms\\pgsql\\PostgreSQLConnection(new \\rdbms\\DSN('pgsql://localhost/'));\n }",
"public function getData()\n {\n return DataTables::of(App\\Models\\Config::all())->make(true);\n }",
"public static function get_tests()\n {\n }",
"abstract protected function getFixtures();",
"public function testGetData()\n {\n $this->getWeather->setUrl();\n $result = $this->getWeather->getData();\n\n $this->assertIsArray($result);\n }",
"public function getDataProvider()\n\t{\n\t\treturn $this->_dataProvider;\n\t}",
"public function getTestCases ()\n {\n return $this->_testCases;\n }",
"public static function required_sample_data() {\n return null;\n }",
"public function getById($id) {\r\n return $this->testsetEntity->find($id);\r\n }",
"public function data()\n {\n return [\n 'name' => $this->faker->text,\n 'cast' => $this->faker->text,\n 'genere' => $this->faker->text,\n 'description' => $this->faker->paragraph,\n 'image' => $this->faker->text,\n ];\n }",
"public function getDatasetsList() {\n return $this->_get(3);\n }",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::className(),\n 'dataFile' => codecept_data_dir() . 'login_data.php',\n ],\n ];\n }",
"private function _get_test_data( $type, $filename ) {\n\t\treturn file_get_contents( HH_HUGO_COMMAND_DIR . '/tests/data/' . $type . '/' . $filename );\n\t}",
"public function getDatasetsList() {\n return $this->_get(1);\n }",
"public function getContent() {\n return $this->arDataset; \n }",
"public function getData()\n {\n $data = parent::getData();\n\n return $data;\n }",
"public function getData()\n {\n $this->initialize();\n\n return $this->data;\n }",
"public static function suite() {\n\t\t$suite = new CakeTestSuite('All Indicadores Tests');\n\t\t$suite->addTestDirectoryRecursive(App::pluginPath('Indicadores') . 'Test' . DS . 'Case' . DS);\n\n\t\treturn $suite;\n\t}",
"public function getPredictDataset($id = 0)\n {\n $request = Bet::where('active', true)\n ->where('traded', false)\n ->orderBy('id', 'asc');\n if($id){\n $request = $request->where('id', $id);\n }\n\n $res = new Bets($request->get());\n //$data = $res->toCsv();\n $dataset = $this->createDataset($res, true);\n\n return $dataset;\n }",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => BookFixture::class,\n 'dataFile' => codecept_data_dir() . 'book.php'\n ],\n ];\n }",
"public function getDataProvider();",
"public function getDataProvider();",
"public function getDatasetsList() {\n return $this->_get(4);\n }",
"public function getTest()\n {\n return $this->hasOne(Test::className(), ['id' => 'test_id']);\n }",
"public function getTests()\n\t{\n\t\t# code...\n\t\treturn $this->tests;\n\t}",
"public function getTestData()\n {\n yield [false, false, '-5 days', '+5 days', true];\n // changing before last dockdown period is not allowed with grace permission\n yield [false, true, '-5 days', '+5 days', true];\n // changing before last dockdown period is allowed with full permission\n yield [true, true, '-5 days', '+5 days', false];\n yield [true, false, '-5 days', '+5 days', false];\n // changing a value in the last lockdown period is allowed during grace period\n yield [false, false, '+5 days', '+5 days', false];\n // changing outside grace period is not allowed\n yield [false, false, '+5 days', '+11 days', true];\n // changing outside grace period is allowed with grace and full permission\n yield [false, true, '+5 days', '+11 days', false];\n yield [true, false, '+5 days', '+11 days', false];\n yield [true, true, '+5 days', '+11 days', false];\n }",
"function getTestDataFromFile($file) {\n return require $file;\n}",
"public function get_data();",
"public function fixtures() \n {\n return [\n 'categories' => CategoryFixture::className(),\n ];\n }",
"public function getData() {\r\n if ($this->data == null) {\r\n $this->data = new DataExport($this->chart);\r\n }\r\n\r\n return $this->data;\r\n }"
] | [
"0.7723198",
"0.7719603",
"0.7709923",
"0.7709923",
"0.76564926",
"0.74969155",
"0.7416149",
"0.7410265",
"0.7383849",
"0.7383849",
"0.73000264",
"0.7262511",
"0.7208042",
"0.7174706",
"0.7144803",
"0.70893824",
"0.705882",
"0.7034158",
"0.70333415",
"0.6942394",
"0.6715493",
"0.67067224",
"0.67011243",
"0.6680784",
"0.6619884",
"0.6619884",
"0.65945333",
"0.6456147",
"0.64102274",
"0.64073884",
"0.639251",
"0.63312423",
"0.62187135",
"0.6179517",
"0.61672574",
"0.6146724",
"0.611629",
"0.60986155",
"0.6071384",
"0.599983",
"0.5984957",
"0.59815675",
"0.5967247",
"0.59589595",
"0.59492093",
"0.5932539",
"0.5927817",
"0.58925253",
"0.588908",
"0.5873543",
"0.58490014",
"0.5848424",
"0.58114743",
"0.5783137",
"0.57656664",
"0.5745276",
"0.5737871",
"0.5705636",
"0.5694161",
"0.5675464",
"0.5661731",
"0.5630823",
"0.5623741",
"0.5622641",
"0.55977553",
"0.5572378",
"0.5569399",
"0.55658454",
"0.5562267",
"0.55504006",
"0.5500428",
"0.5469426",
"0.54568785",
"0.54532224",
"0.544612",
"0.5443081",
"0.5424961",
"0.54205877",
"0.5417626",
"0.5415216",
"0.54047316",
"0.54045236",
"0.53974205",
"0.53960174",
"0.538793",
"0.53826106",
"0.53729767",
"0.5372828",
"0.5367152",
"0.5364662",
"0.5363172",
"0.5363172",
"0.53618747",
"0.534964",
"0.5339446",
"0.5338701",
"0.5328708",
"0.5317081",
"0.53170687",
"0.5316751"
] | 0.61892724 | 33 |
/ This file is part of the LiveTest package. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. | function getHtmlContent($curResult)
{
switch ($curResult->getStatus())
{
case \LiveTest\TestRun\Result\Result::STATUS_SUCCESS :
$content['css_class'] = 'result_success';
$content['message'] = $curResult->getMessage();
break;
case \LiveTest\TestRun\Result\Result::STATUS_FAILED :
$content['css_class'] = 'result_failed';
$content['message'] = $curResult->getMessage();
break;
case \LiveTest\TestRun\Result\Result::STATUS_ERROR :
$content['css_class'] = 'result_error';
$content['message'] = $curResult->getMessage();
break;
default :
$content['css_class'] = 'result_none';
$content['message'] = '';
break;
}
return $content;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testServeChanges()\n {\n }",
"public function testGetTrackingSources()\n {\n }",
"public function testExample()\n {\n }",
"public function testBasicTest()\n {\n\n }",
"public function testInstance() { }",
"public function preTest() {}",
"public function testGetUnitDetails()\n {\n }",
"public function testInit()\n {\n\n }",
"public function preTesting() {}",
"public function testServeChange()\n {\n }",
"public function test() {\n\n\t}",
"public function testEditSnippet()\n {\n\n }",
"public function testGetSnippet()\n {\n\n }",
"public function testGetEvents()\n {\n }",
"public function testShow(): void { }",
"public function testSomething()\n {\n }",
"public function testWebinars()\n {\n }",
"function test(){\r\n //placeholder for future test functions\r\n }",
"public function testSuccess()\n {\n }",
"function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}",
"public function testValidateDocumentExecutableValidation()\n {\n }",
"public function testFindTemplates()\n {\n\n }",
"public function testListPastWebinarFiles()\n {\n }",
"public function testGetRevision()\n {\n }",
"public function testGetPackingPlanFiles()\n {\n }",
"public function testAddPackingPlanAudit()\n {\n }",
"public function testGetChangeIssue()\n {\n }",
"public function testGetGlobalTemplate()\n {\n\n }",
"public function testGetPublicDocument()\n {\n }",
"public function testStatusConfirm()\n {\n\n }",
"public function testValidateDocumentMsgValidation()\n {\n }",
"public function testEditGlobalTemplate()\n {\n\n }",
"public function isTesting() {}",
"public function testWebinarPanelists()\n {\n }",
"public function testGetExpert()\n {\n }",
"public function testPastWebinars()\n {\n }",
"public function testGetChallengeEvents()\n {\n }",
"function test_sample() {\n\t\t$this->assertTrue( true );\n\t}",
"public function testListPastWebinarQA()\n {\n }",
"public function notATestCase() {}",
"protected function test9() {\n\n }",
"public function testGetSettings()\n {\n }",
"public function testGetChallengeActivityTemplate()\n {\n }",
"public function testGetChangeVCSRootInstance()\n {\n }",
"public function testEditFile()\n {\n\n }",
"public function testGetChangeVCSRoot()\n {\n }",
"public function testGetUserrecordingsSummary()\n {\n }",
"public function testAddSnippet()\n {\n\n }",
"function setUp():void\n {\n parent::setUp();\n }",
"public function testGetTemplate()\n {\n\n }",
"public function testEditTemplate()\n {\n\n }",
"public function testValidateDocumentDocValidation()\n {\n }",
"public function testAddPackingPlanFile()\n {\n }",
"public function testGetDocument()\n {\n }",
"public function test()\n {\n }",
"public function test()\n {\n }",
"public function testGetSite()\n {\n }",
"public function testGetUserrecordings()\n {\n }",
"function testLoad()\n {\n $this->assertTrue(true);\n }",
"function tearDown() {\n\n }",
"function tearDown() {\n\n }",
"public function testWebinar()\n {\n }",
"public function testGetVoicemailMailbox()\n {\n }",
"public function testWebinarStatus()\n {\n }",
"function tearDown() {\n }",
"public function testGetTaskInstanceVariable()\n {\n }",
"public function test_addExternalShipmentAudit() {\n\n }",
"public function testGetVoicemailSearch()\n {\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() {}"
] | [
"0.6807251",
"0.6716925",
"0.6685993",
"0.65673894",
"0.65514505",
"0.65147704",
"0.648602",
"0.64488566",
"0.64487475",
"0.64031833",
"0.6380248",
"0.63588065",
"0.63585037",
"0.63431805",
"0.6333463",
"0.6326372",
"0.63088095",
"0.6279083",
"0.6274098",
"0.62703747",
"0.619886",
"0.6195834",
"0.61888707",
"0.6178804",
"0.617765",
"0.61744547",
"0.6169205",
"0.61667407",
"0.6166124",
"0.61603606",
"0.6150356",
"0.6147729",
"0.61431557",
"0.61306185",
"0.6126261",
"0.6125831",
"0.61240053",
"0.6118391",
"0.6112252",
"0.610917",
"0.61027366",
"0.6100993",
"0.6097806",
"0.608961",
"0.60888463",
"0.60699487",
"0.6064843",
"0.60587966",
"0.60574704",
"0.6057042",
"0.60564715",
"0.6056234",
"0.6052538",
"0.60506845",
"0.60458773",
"0.60458773",
"0.60424554",
"0.60411453",
"0.6037646",
"0.60330063",
"0.60330063",
"0.60309327",
"0.6026985",
"0.60237944",
"0.60237354",
"0.6020261",
"0.60196984",
"0.6019122",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.60082954",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206",
"0.6007206"
] | 0.0 | -1 |
Accepts input from the command line. | public function readStdin($prompt, $valid_inputs, $default = '') {
while(!isset($input) || (is_array($valid_inputs) && !in_array($input, $valid_inputs)) || ($valid_inputs == 'is_file' && !is_file($input))) {
echo $prompt;
$input = strtolower(trim(fgets(STDIN)));
if(empty($input) && !empty($default)) {
$input = $default;
}
}
return $input;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function promptInput()\n {\n while ($this->run) {\n $this->valid = true;\n $input = readline('Enter a command : ');\n $this->handleInput($input);\n }\n }",
"public function stdin();",
"function is_input($arg)\n{\n\tif (mb_substr ($arg, 0, 8) === \"--input=\")\n\t\treturn true;\n\treturn false;\n}",
"public function cli_validateArgs() {}",
"protected static function isCommandLine() {}",
"function _getInputCLI()\r\n{\r\n $opt = _read();\r\n $opt = strtoupper (trim($opt));\r\n return $opt;\r\n}",
"function parseCommLineArgs($argc, $argv){\n\t\t$args = array(\n\t\t\t\"help\" => false,\n\t\t\t\"input\" => null,\n\t\t\t\"output\" => null,\n\t\t\t\"query\" => null,\n\t\t\t\"n\" => false,\n\t\t\t\"root\" => null,\n\t\t);\n\n\t\t// Query file variable\n\t\t$qf = null;\n\n\t\t// No arguments passed\n\t\tif($argc == 1){\n\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\tprintHelp();\n\t\t\texit(EWARGS);\n\t\t}\n\n\t\t// Cycle, in which arguments are parsed\n\t\tfor($i = 1; $i < $argc; $i++){\n\t\t\tif($args[\"help\"] !== false){\n\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\texit(EWARGS);\n\t\t\t} \n\t\t\telseif($argv[$i] == \"--help\"){\n\t\t\t\tif($i > 1){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\n\t\t\t\t$args[\"help\"] = true;\n\t\t\t} \n\t\t\telseif($argv[$i] == \"-n\"){\n\t\t\t\tif($args[\"n\"]){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\n\t\t\t\t$args[\"n\"] = true;\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 8) == \"--input=\"){\n\t\t\t\tif($args[\"input\"] != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 8)\n\t\t\t\t\t$args[\"input\"] = 'php://stdin';\n\t\t\t\telse\n\t\t\t\t\t$args[\"input\"] = substr($argv[$i],8);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 9) == \"--output=\"){\n\t\t\t\tif($args[\"output\"] != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 9)\n\t\t\t\t\t$args[\"output\"] = 'STDOUT';\n\t\t\t\telse\n\t\t\t\t\t$args[\"output\"] = substr($argv[$i],9);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 8) == \"--query=\"){\n\t\t\t\tif($args[\"query\"] != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 8)\n\t\t\t\t\t$args[\"query\"] = '';\n\t\t\t\telse\n\t\t\t\t\t$args[\"query\"] = substr($argv[$i],8);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 5) == \"--qf=\"){\n\t\t\t\tif($qf != null){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\t\t\t\telse if(strlen($argv[$i]) == 5)\n\t\t\t\t\t$args[\"query\"] = '';\n\t\t\t\telse\n\t\t\t\t\t$qf = substr($argv[$i],5);\n\t\t\t} \n\t\t\telseif(substr($argv[$i], 0, 7) == \"--root=\"){\n\t\t\t\tif($args[\"root\"] != null || strlen($argv[$i]) == 7){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\t\texit(EWARGS);\n\t\t\t\t}\n\n\t\t\t\t$args[\"root\"] = substr($argv[$i],7);\n\t\t\t} \n\t\t\telse{\n\t\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\t\texit(EWARGS);\n\t\t\t}\n\t\t}\n\n\t\tif($args[\"help\"] !== false)\n\t\t\treturn $args;\n\n\n\n\t\t// Checks for a collision of --qf and --query arguments\n\t\tif($args[\"query\"] != null and $qf != null){\n\t\t\tfprintf(STDERR, \"ERROR! The script was launched with an illegal combination of arguments\\n\");\n\t\t\texit(EWARGS);\n\t\t}\n\t\telse if($args[\"query\"] == null and $qf == null){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\n\t\t// Loads query from file\n\t\tif($qf != null){\n\t\t\tif($qf == \"\"){\n\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t\t}\n\t\t\telseif(!file_exists($qf) || !is_readable($qf)){\n\t\t\t\tfprintf(STDERR, \"ERROR! File with query could not be open!\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t\t}\n\t\t\t$args[\"query\"] = file_get_contents($qf);\n\t\t}\n\t\t\n\t\tif($args[\"query\"] == null || $args[\"query\"] == \"\"){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\n\t\treturn $args;\n\t}",
"public function checkSTDIN()\n\t{\n if(defined('STDIN') ){\n\n //echo(\"Running from CLI Console\");\n $this->consoleCheckResult = \"Console\";\n\n }else{\n\n //echo(\"Not Running from CLI\");\n $this->consoleCheckResult = \"Web\";\n\n }\n\n return $this->consoleCheckResult;\n\t}",
"public function handle() {\n $params = getopt(implode($this->options));\n if(!empty($params) && is_array($params)) {\n foreach($params as $key => $value) {\n $obj = KeysFactory::parameter($key, $value);\n $this->params[KeysFactory::key($obj)] = $obj;\n }\n }\n }",
"public function handle() {\r\n\t\tdo {\r\n\t\t\t$number = (float) $this->ask('Input number integer: ');\r\n\t\t\t$this->line(\"Number format \" . $number . \": \" . $this->number_format_short($number));\r\n\t\t} while (true);\r\n\r\n\t}",
"public function readStandardInput(){\n $fr = fopen(\"php://stdin\", \"r\"); //open file pointer to read from stdin\n $input = fgets($fr); //read 128 max characters\n $input = rtrim($input); //trim right\n fclose($fr); //close the file handle\n\n $this->routeCommand($input);\n }",
"public function run(InputInterface $input, OutputInterface $output)\n{\n // block access no cli request\n self::blockAccess();\n\n // make sure input name file matches\n if($input->argument(0) !== $this->name)\n {\n exit(\n sprintf(\n 'Sorry command [ %s ] does not match console file name [ %s ]', \n $input->argument(0), \n $this->name\n )\n );\n }\n \n // execution processing\n return $this->process($input, $output);\n}",
"protected function userInput(InputInterface $input, OutputInterface $output)\n {\n $this->askForApp($input, $output, 'Which app would you like to start?', 'stopped');\n }",
"public function handleInput($input)\n {\n $input = strtoupper(trim($input));\n $input = preg_replace('/\\s+/', ' ', $input); // Remove any extra spaces.\n $input = preg_replace('/\\s*,\\s*/', ',', $input); // Remove any spaces after comma\n $args = explode(' ', $input);\n $this->command = $args[0];\n if ($this->isValidCommand($this->command)) {\n $placeArguments = [];\n if ($this->command === self::CMD_PLACE) {\n $placeArguments = $this->handlePlaceCommand(isset($args[1]) ? $args[1] : '');\n }\n if ($this->valid) {\n $this->processInput($this->command, $placeArguments);\n }\n } else {\n echo \"Please enter a valid command.\\n\";\n }\n }",
"function main(){\n while(1){\n // show initial options\n $user_input = readline(showOptions(0));\n\n /* Buy flight ticket */\n if($user_input == \"1\"){\n $user_input = readline(showOptions(1));\n if($user_input == \"0\")\n continue;\n buyTicket();\n }\n\n /* Book accomodation */\n else if($user_input == \"2\"){\n $user_input = readline(showOptions(2));\n if( $user_input == \"0\")\n continue;\n bookRoom();\n }\n\n /* Buy package */\n else if($user_input == \"3\"){\n $user_input = readline(showOptions(3));\n if( $user_input == \"0\")\n continue;\n buyPackage();\n }\n }\n}",
"public function handle()\n {\n $arr = $this->askArray('Please enter integer separated by comma: ');\n\n $this->info('Highest: '.$this->highest($arr));\n $this->info('Lowest: '.$this->lowest($arr));\n }",
"public function doRun(InputInterface $input, OutputInterface $output)\n {\n if (!$input->getFirstArgument()) {\n $input = new ArrayInput(array('--help'));\n }\n\n parent::doRun($input, $output);\n }",
"protected function onlyRunFromCommandLine() {\n if (php_sapi_name() != 'cli') {\n die(\"Please run this from the commandline.\\n\");\n }\n }",
"public static function isCli()\n {\n return defined('STDIN');\n }",
"public static function isCli()\n {\n return defined('STDIN');\n }",
"function input($prompt, $color = '')\n{\n ech($prompt, $color);\n if (PHP_OS == 'WINNT') {\n $line = stream_get_line(STDIN, 1024, PHP_EOL);\n } else {\n $line = readline('');\n }\n return $line;\n}",
"function commandLineController(array $input)\n{\n $payload = parseCommandLineArguments($input);\n helpController($payload);\n}",
"public function userInput() \n {\n \n if (!defined(\"STDIN\")) {\n define(\"STDIN\", fopen('php://stdin', 'r'));\n }\n // getting path from user\n echo 'Hello! What is your complete path to the directory or if ' .\n 'you want to append signature in php files of current directory' .\n 'just press Enter (enter below):' . PHP_EOL;\n $this->pathToDir = fread(STDIN, 80);\n $this->pathToDir = trim($this->pathToDir);\n // checking if user has entered the path or not\n // if not than use working directory for modification\n if ($this->pathToDir == NULL) {\n $this->pathToDir = getcwd() . '/';\n }\n if (substr($this->pathToDir, -1) != '/') {\n $this->pathToDir = $this->pathToDir . '/';\n }\n // get all text files with a .php extension into an array.\n $this->filesArray = glob($this->pathToDir . \"*.php\");\n //checking if files exits in folder or not\n if (count($this->filesArray) > 0) {\n //getting text from user\n echo 'Hello! Enter the Text that you want to merge' .\n ' in php file (enter below):' . PHP_EOL;\n $this->textInput = fread(STDIN, 80);\n $this->textInput = trim($this->textInput);\n $this->doEditingInPhp();\n } else {\n echo 'provided directory does not contain any php file' . PHP_EOL;\n }\n }",
"public static function exec(array $argv , array $param , string $input = '');",
"public function testPrompt(){\n $message = null;\n $input = 'hello';\n $go = new Getopt(null, function($msg)use(&$message){ $message = $msg;}, function(){}, function()use(&$input){return $input;});\n //test default\n $testOpt = array(\n 'arg'=>'test1',\n 'prompt'=>true,\n\n 'promptMsg'=>'please enter'\n );\n\n $go->setOption($testOpt);\n $go->parse();\n $this->assertEquals($testOpt['promptMsg'], $message);\n $this->assertEquals($input, $go->test1);\n\n $input = 'ok';\n $go->parse();\n $this->assertEquals($input, $go->test1);\n\n $input = ''; //empty input\n $go->parse();\n $this->assertNull($go->test1);\n\n\n }",
"public function runCommand(\\Diversen\\ParseArgv $args)\n {\n\n $input = $this->utils->readStdin();\n if (empty($input)) {\n $file = $args->getArgument(0);\n $input = $this->getFileContents($file);\n if (!$input) {\n echo \"No content was piped to STDIN or file was not specified\" . PHP_EOL;\n return 12;\n }\n }\n\n if ($args->getOption('up')) {\n $output = strtoupper($input) . PHP_EOL;\n } else if ($args->getOption('low')) {\n $output = strtolower($input) . PHP_EOL;\n } else {\n $output = $input . PHP_EOL;\n }\n\n echo $output;\n return 0;\n }",
"public function run(): void {\n $commandLineOptions = $this->mCommandLineOptions->readCommandLineOptions();\n $optionsAreValid = $this->mCommandLineOptions->validateOptions($commandLineOptions);\n if($optionsAreValid) {\n $filePath = $this->mCommandLineOptions->getFilename();\n $this->mEBNFReader->parseFile($filePath);\n $foodItemsFound = $this->mVendors->findFoodItems($commandLineOptions);\n $this->outputFoodItemsFound($foodItemsFound);\n } else {\n Logger::out('Options input were invalid.');\n Logger::outputHelpText();\n }\n }",
"function get_input($upper = false) {\n // Return filtered STDIN input\n if($upper == TRUE) {\n return strtoupper(trim(fgets(STDIN)));\n } else {\n return trim(fgets(STDIN));\n }\n}",
"function readInput($str){\n\t\tprint $str;\n\t\t$stdin= fopen(\"php://stdin\", \"r\");\n\t\t$entrada= fgets($stdin);\n\t\t$this->_stdin= trim($entrada);\n\t}",
"public function handle()\n {\n $test = $this->argument('type');\n\n if($test=='redis'){\n $this->testRedis();\n }\n //\n }",
"public function __construct($input = null)\n {\n $this->is_argv = is_null($input);\n $this->input = ($this->is_argv) ? $_SERVER['argv'] : $input;\n }",
"function getInput($upper = false) \n {\n // Return filtered STDIN input\n if ($upper) {\n return strtoupper(trim(fgets(STDIN)));\n } else {\n return (trim(fgets(STDIN)));\n\n }\n }",
"protected function sendInput()\n {\n fwrite(ConsoleStub::$inputStream, implode(PHP_EOL, func_get_args()) . PHP_EOL);\n\n rewind(ConsoleStub::$inputStream);\n }",
"function menu(){\n\n\n\tprint_r(\"-------------CONTACTS-------------\" . PHP_EOL . \" Name | Phone Number \" . PHP_EOL . \"----------------------------------\" . PHP_EOL);\n\tviewContacts(\"contacts.txt\");\n\tprint_r(PHP_EOL . PHP_EOL);\n\tprint_r(\"1. View Contacts\" . PHP_EOL . \"2. Add Contact\" . PHP_EOL . \"3. Search Contact By Name\" . PHP_EOL . \"4. Delete Contact\" . PHP_EOL . \"5. Exit\" . PHP_EOL);\n\n\tfwrite(STDOUT, 'Please enter a # to select an action' . PHP_EOL);\n\t$input = trim(fgets(STDIN));\n\n\tif ($input == 1) {\n\t\tviewContacts('contacts.txt');\n\t}\n\t\telseif ($input == 2) {\n\t\taddContact();\n\t\t}\n\t\telseif ($input == 3) {\n\t\t\tsearchContacts();\n\t\t}\n\t\telseif ($input == 4) {\n\t\t\tdeleteContact();\n\n\t\t}\n\t\telseif ($input == 5){\n\t\t\texit;\n\t\t}\n\t\telse {\n\t\t\techo \"Please choose a valid menu option\" . PHP_EOL;\n\t\t}\n\nvar_dump($input);\n// fclose($handle);\n}",
"function get_input($upper = FALSE) \n{\n // Return filtered STDIN input\n $result = trim(fgets(STDIN));\n \n if ($upper) \n {\n return strtoupper($result);\n } \n\n else \n\n {\n return $result;\n }\n}",
"public function getInput(array $argv = null)\n {\n try {\n return new ArgvInput($argv, $this->environment->getDefinition());\n } catch (\\Exception $e) {\n $this->renderException($e, new ConsoleOutput());\n exit(1);\n }\n }",
"function get_cli_args($param, $required = \\false)\n {\n }",
"public function handle()\n {\n $type = $this->argument('type');\n\n switch ($type) {\n case \"manual\" :\n $this->manual();\n break;\n case \"yesterday\" :\n $this->yesterday();\n break;\n case \"today\" :\n $this->today();\n break;\n default :\n throw new Exception('Empty type commaand.');\n break;\n }\n }",
"function input()\n{\n return trim(fgets(STDIN));\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 input ()\n\t{}",
"public function handle()\n {\n $type = $this->argument('type');\n\n switch($type){\n case \"import\" :\n $this->import();\n break;\n case \"addition\" :\n $this->addition();\n break;\n case \"investigate\" :\n $this->investigate();\n break;\n default :\n throw new Exception('Empty type commaand for import.');\n break;\n }\n }",
"function readline($prompt) {}",
"function get_input($upper = FALSE) \n{\n\t$result = trim(fgets(STDIN));\n\treturn $upper? strtoupper($result) : $result;\t\n}",
"function isCLI() {\n return (php_sapi_name() === 'cli' OR defined('STDIN'));\n }",
"public function cli_keyboardInput() {}",
"public function command()\n {\n $imdbTitle = implode(' ', $this->arguments);\n $imdbTitle = preg_replace('/\\s\\s+/', ' ', $imdbTitle);\n $imdbTitle = trim($imdbTitle);\n $imdbTitle = urlencode($imdbTitle);\n\n if (!strlen($imdbTitle)) {\n $this->say(sprintf('Enter movie title. (Usage: !imdb movie title)'));\n return;\n }\n\n $apiUri = sprintf($this->apiUri, $imdbTitle);\n $getJson = $this->fetch($apiUri);\n\n $json = json_decode($getJson, true);\n\n $title = $json[0]['title'];\n $rating = $json[0]['rating'];\n $imdbUrl = $json[0]['imdb_url'];\n\n /*\n * Check if response is given\n */\n if (!strlen($title)) {\n $this->say('IMDB: Error fetching data');\n return;\n }\n\n $this->say(sprintf('Title: %s | Rating: %s | %s', $title, $rating, $imdbUrl));\n }",
"public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }",
"public function cli()\n {\n _APP_=='varimax' && $this->registerConsoleCommand();\n }",
"public function execute($input, $output)\n {\n $output->write('hello, this in ' . __METHOD__);\n // $name = $input->getArg('name');\n\n $output->write(<<<EOF\nthis is argument and option example:\n the opt1's value\n option: opt1 |\n | |\nphp examples/app demo john male 43 --opt1 value1 -y\n | | | | | |\n script command | | |______ option: yes, it use shortcat: y, and it is a Input::OPT_BOOLEAN, so no value.\n | |___ |\n argument: name | argument: age\n argument: sex\nEOF\n);\n }",
"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 main()\n {\n // Validate input\n $this->cli_validateArgs();\n\n // Get task (function)\n $strTask = (string) $this->cli_args['_DEFAULT'][1];\n\n switch ($strTask) {\n case 'import':\n return $this->import();\n\n default:\n $this->cli_help();\n break;\n }\n\n return self::CLI_OK;\n }",
"protected function callFromConsole()\n {\n array_shift($_SERVER['argv']);\n\n $this->application->run(new ArgvInput($_SERVER['argv']), new ConsoleOutput());\n }",
"public function run(iConsoleInput $input, iConsoleOutput $output){\n $found_option = false;\n\n if ($input->getOption('--svn')){\n $found_option = true;\n $this->_runSVN($input, $output);\n\n }\n\n if ($input->getOption('--git')){\n $found_option = true;\n $this->_runGIT($input, $output);\n\n }\n\n if ($input->getOption('--garbage')){\n $found_option = true;\n $this->_runGarbage($input, $output);\n\n }\n\n if (!$found_option) {\n\n $this->_runHelp($input, $output);\n\n }\n\n }",
"public function handle()\n {\n $id = $this->ask('What is the equipment id?');\n $quantity = $this->ask('What is the equipment quantity?');\n $startDate = $this->ask('What is the start date? (e.g. 2019-04-11)');\n $endDate = $this->ask('What is the end date? (e.g. 2019-04-21)');\n\n $startDate = DateTime::createFromFormat('Y-m-d', $startDate);\n $endDate = DateTime::createFromFormat('Y-m-d', $endDate);\n\n $isAvailable = EquipmentAvailabilityHelper::isAvailable($id, $quantity, $startDate, $endDate);\n\n if ($isAvailable) {\n $this->info(\"The requested quantity is available within the given date range.\");\n } else {\n $this->warn(\"The requested quantity is not available within the given date range.\");\n }\n }",
"public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }",
"public function run()\n {\n $this->console->setAutoExit(false);\n\n return $this->console->run(new ArgvInput());\n }",
"protected function userInput() {\n return trim(fgets($this->_stdin));\n }",
"public function handle()\n {\n if ($this->argument('connection') == 'all') {\n $this->importAll();\n\n exit();\n }\n\n\n if (! $name = $this->argument('name')) {\n $name = $this->ask('The name?');\n }\n\n $this->importOne($this->argument('connection'), $name);\n }",
"function get_input($upper = false){\n\n $input = trim(fgets(STDIN));\n\n if ($upper == true) {\n $input = strtoupper($input);\n }\n\n return $input;\n}",
"public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }",
"function main() {\n\t$cmdline = new Recharg\\CommandLine();\n\n\t$progname = $GLOBALS['argv'][0];\n\n\t$cmdline->setUsage(<<<ETX\n$progname [OPTION]... [-T] SOURCE DEST\n or: $progname [OPTION]... SOURCE... DIRECTORY\n or: $progname [OPTION]... -t DIRECTORY SOURCE...\nETX\n );\n\n\t// Add description text, displayed above the option list.\n\t$cmdline\n\t\t->setDescription('Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.');\n\n\t$opt = new Recharg\\Option('help');\n\t$opt->setHelp('display this help and exit');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('version');\n\t$opt->setHelp('output version information and exit');\n\t$cmdline->addOption($opt);\n\n\t// Note: if no matches are provided, Recharg will assume \"--name\" for a\n\t// an option named \"name\".\n\t$opt = new Recharg\\Option('backup');\n\t$opt\n\t\t->setDefault('existing')\n\t\t->setAcceptsArguments(TRUE)\n\t\t->setPlaceholder('CONTROL')\n\t\t->setHelp('make a backup of each existing destination file');\n\t$cmdline->addOption($opt);\n\n\t// If a name consisting of a single character is passed, the option is\n\t// actually created with name \"opt_X\" (where \"X\" is the character\n\t// passed), and a single option \"X\"). In other words:\n\t//\n\t// new Option('a')\n\t//\n\t// is equivalent to\n\t//\n\t// new Option('opt_a', ['a']);\n\t$opt = new Recharg\\Option('b');\n\t$opt\n\t\t->setHelp('like --backup but does not accept an argument');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('force', ['f', 'force']);\n\t$opt\n\t\t->setHelp('do not prompt before overwriting');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('interactive', ['i', 'interactive']);\n\t$opt\n\t\t->setHelp('prompt before overwriting');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('no-clobber', ['n', 'no-clobber']);\n\t$opt\n\t\t->setHelp('do not overwrite an existing file');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('strip-trailing-slashes');\n\t$opt\n\t\t->setHelp('remove any trailing slashes from each SOURCE argument');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('suffix');\n\t$opt\n\t\t->setAcceptsArguments(TRUE)\n\t\t->setHelp('override the usual backup suffix');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('target-directory', ['t', 'target-directory']);\n\t$opt\n\t\t->setAcceptsArguments(TRUE)\n\t\t->setPlaceholder('DIRECTORY')\n\t\t->setHelp('move all SOURCE arguments into DIRECTORY');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('no-target-directory',\n\t ['T', 'no-target-directory']);\n\t$opt\n\t\t->setHelp('treat DEST as a normal file');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('update', ['u', 'update']);\n\t$opt\n\t\t->setHelp('move only when the SOURCE file is newer than the destination file or when the destination file is missing');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('verbose', ['v', 'verbose']);\n\t$opt\n\t\t->setHelp('explain what is being done');\n\t$cmdline->addOption($opt);\n\n\t$opt = new Recharg\\Option('context', ['Z', 'context']);\n\t$opt\n\t\t->setHelp('set SELinux security context of destination file to default type');\n\t$cmdline->addOption($opt);\n\n\n\t$cmdline->setFooter(<<<ETX\nIf you specify more than one of -i, -f, -n, only the final one takes effect.\n\nThe backup suffix is '~', unless set with --suffix. The version control method may be selected via the --backup option. CONTROL can be:\n\n none, off never make backups (even if --backup is given)\n numbered, t make numbered backups\n existing, nil numbered if numbered backups exist, simple otherwise\n simple, never always make simple backups\n\nThis is a example command line processor using PHP Recharg. Visit\nhttp://github.org/flaviovs/recharg for more information.\nETX\n );\n\n\n\t//\n\t// Parse the command line.\n\t//\n\t$p = new Recharg\\Parser($cmdline);\n\n\ttry {\n\t\t$res = $p->parse();\n\t} catch (Recharg\\ParserException $ex) {\n\t\t// Get current program name. This is set to the current program\n\t\t// automatically when we created the CommandLine without specifying a name\n\t\t// for it.\n\t\t$commands = $ex->getCommands();\n\t\t$progname = array_shift($commands);\n\n\t\t// Get the current command sequence.\n\t\t$commands = implode(' ', $commands);\n\n\t\t$prefix = $progname;\n\t\tif ($commands) {\n\t\t\t$prefix .= \" $commands\";\n\t\t}\n\n\t\t// FIXME - move this command building logic to the exception\n\n\t\t$hint = \"$progname --help\";\n\t\tif ($commands) {\n\t\t\t$hint .= \" $commands\";\n\t\t}\n\n\t\t// Display the error message.\n\t\tprint \"$prefix: \" . $ex->getMessage() . \"\\n\";\n\t\tprint \"Try \\\"$hint\\\"\\n\";\n\n\t\texit(1);\n\t}\n\n\t// Display help if \"--help\" was passed.\n\tif ($res['help']) {\n\t\tprint $cmdline->getHelp($res->getCommands()) . \"\\n\";\n\t\texit(0);\n\t}\n\n\t// Act on parser results.\n\tprint \"* Execute command: \" . implode(' ', $res->getCommands()) . \"\\n\";\n\tprint \"* Options:\\n\";\n\tprint_r($res->getArguments());\n\tprint \"* Operands:\\n\";\n\tprint_r($res->getOperands());\n}",
"public function run()\n\t{\n\t\t$this->cli->clearScreen();\n\n\t\t$this->welcome();\n\n\t\twhile(true)\n\t\t{\n\t\t\tif($this->readline)\n\t\t\t{\n\t\t\t\t$__input = readline('<< ');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfwrite(STDOUT, '<< ');\n\n\t\t\t\t$__input = fgets(STDIN);\n\t\t\t}\n\n\t\t\t$__input = rtrim(trim($__input), ';');\n\n\t\t\tif(empty($__input))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(in_array($__input, array('exit', 'quit')))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($this->readline)\n\t\t\t{\n\t\t\t\treadline_add_history($__input);\n\t\t\t}\n\n\t\t\tif($this->isImmediate($__input))\n\t\t\t{\n\t\t\t\t$__input = 'return (' . $__input . ')';\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$__return = eval('unset($__input); ' . $__input . ';');\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$this->cli->stderr('>> ' . $e->getMessage());\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(ob_get_length() == 0)\n\t\t\t{\n\t\t\t\tif(is_bool($__return))\n\t\t\t\t{\n\t\t\t\t\t$this->output(($__return ? 'true' : 'false'));\n\t\t\t\t}\n\t\t\t\telseif(is_string($__return))\n\t\t\t\t{\n\t\t\t\t\t$this->output('\\'' . addcslashes($__return, \"\\0..\\37\\177..\\377\") . '\\'');\n\t\t\t\t}\n\t\t\t\telseif(!is_null($__return))\n\t\t\t\t{\n\t\t\t\t\t$this->output(var_export($__return, true));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($__return);\n\n\t\t\t$__output = ob_get_contents();\n\n\t\t\tob_end_clean();\n\n\t\t\tif((strlen($__output) > 0))\n\t\t\t{\n\t\t\t\t$this->output($__output);\n\t\t\t}\n\n\t\t\tunset($__output);\n\t\t}\n\n\t\t$this->cli->stdout(PHP_EOL . 'Goodbye!');\n\t}",
"public function handle()\n {\n\t $input = realpath( $this->option('input') );\n\t $format = $this->option('format');\n\t $dir = realpath( $this->option('dir') );\n\t $output = $this->option('output');\n\t \n\t $convert_helper = new Converter();\n\t \n\t $convert_helper->setInput( $input );\n\t $convert_helper->setOutputFormat( $format );\n\t $result = $convert_helper->run();\n\t if($result->isSuccess()){\n\t \t$result->saveTo( $output );\n\t }else{\n\t \tdd($result->getErrors());\n\t }\n\t \n }",
"public function handle()\n {\n if (!is_readable($this->argument('input_file'))) {\n return $this->error('Input file is not readable.');\n }\n if (!is_dir($this->argument('output_dir'))) {\n return $this->error('Output directory is not a directory.');\n }\n if (!is_writeable($this->argument('output_dir'))) {\n return $this->error('Output directory is not writeable.');\n }\n\n $smbrOptions['pipeTransitions'] = $this->option('pipe-transitions');\n $smbrOptions['shuffleLevels'] = $this->option('shuffle-levels');\n $smbrOptions['normalWorldLength'] = $this->option('normal-world-length');\n $smbrOptions['enemies'] = $this->option('enemies');\n $smbrOptions['blocks'] = $this->option('blocks');\n $smbrOptions['bowserAbilities'] = $this->option('bowser-abilities');\n $smbrOptions['bowserHitpoints'] = $this->option('bowser-hitpoints');\n $smbrOptions['startingLives'] = $this->option('starting-lives');\n $smbrOptions['warpZones'] = $this->option('warp-zones');\n $smbrOptions['hiddenWarpDestinations'] = $this->option('hidden-warp-destinations');\n $smbrOptions['fireworks'] = $this->option('fireworks');\n $smbrOptions['shuffleUndergroundBonus'] = $this->option('shuffle-underground-bonus');\n $smbrOptions['randomizeBackground'] = $this->option('randomize-background');\n $smbrOptions['hardMode'] = $this->option('hard-mode');\n $smbrOptions['randomizeUndergroundBricks'] = $this->option('randomize-underground-bricks');\n $smbrOptions['excludeFirebars'] = $this->option('exclude-firebars');\n $smbrOptions['randomizeSpinSpeed'] = $this->option('randomize-spin-speed');\n $smbrOptions['shuffleSpinDirections'] = $this->option('shuffle-spin-directions');\n $smbrOptions['ohko'] = $this->option('ohko');\n $smbrOptions['shuffleMusic'] = $this->option('shuffle-music');\n $smbrOptions['mariocolors'] = $this->option('mariocolors');\n $smbrOptions['luigicolors'] = $this->option('luigicolors');\n $smbrOptions['firecolors'] = $this->option('firecolors');\n $smbrOptions['mysterySeed'] = false;\n $this->do_the_randomizer($this->argument('input_file'), $this->argument('output_dir'), $this->option('seed'), $smbrOptions, $this->option('log'), $this->option('savelog'));\n }",
"public function handle() {\n $env = $branch = $this->ask('Specify environment');\n $branch = $this->ask('Specify Git brach to deploy');\n\n $data = [\n 'environment' => $env,\n 'git_branch' => $branch\n ];\n\n if ($this->validateInput($data)) {\n $commands = config('deploy.commands');\n foreach ($commands as $command) {\n $this->execShellWithPrettyPrint($command);\n }\n } else {\n $this->error('Something went wrong!');\n }\n }",
"public function handle()\n {\n $user=$this->argument('user');\n // $this->line('hello'.$this->argument('user'));\n $this->line('Customised Testing Command',$user);\n }",
"abstract protected function main(array $arguments);",
"function handleArgs()\n{\n global $recursive;\n global $path;\n global $parseFile;\n global $intFile;\n\n $shortOpts = \"\";\n $longOpts = array(\n \"help\",\n \"directory:\",\n \"recursive\",\n \"parse-script:\",\n \"int-script:\"\n );\n\n # get arguments\n $options = getopt($shortOpts, $longOpts);\n\n foreach ($options as $key=>$value) {\n if ($key === \"help\" && count($options) == 1) {\n echo \"This is test script for parse.php and interpret.py scripts.\";\n echo \"Run by php test.php [--directory=pat] [--recursive] [--parse-script=file] [--in-script=file]\";\n exit(0);\n } elseif ($key === \"recursive\") {\n $recursive = 1;\n } elseif ($key === \"directory\") {\n $path = $value;\n } elseif ($key === \"parse-script\") {\n $parseFile = $value;\n } elseif ($key === \"int-script\") {\n $intFile = $value;\n } else {\n # undefined arguments are present\n errorMsg(10);\n }\n }\n}",
"public function handle()\n {\n if($this->argument('opration')=='sug'){\n $q = $this->option('q');\n $area = $this->option('area');\n \n \t\t\tif(!$area){\n \t\t\t\t$area = ['wireless'];\n \t\t }\n if($q){\n \t$this->keyword->sug($q,$area);\n }else{\n \t$this->keyword->sug();\n } \t\n\n }\n }",
"public function handle()\n {\n //Check if has command argument included, if so, it will execute requesting function\n //depending on the argument is the number of requests to execute\n //4 (interview process number 4) \n //5 (interview process number 5) \n if($this->argument('processOption')=='4')\n $this->sendRequest('https://atomic.incfile.com/fakepost',1);\n else if($this->argument('processOption')=='5')\n $this->sendRequest('https://atomic.incfile.com/fakepost',100000);\n else\n $this->info('Argument required to execute request,(accepted only:4 or 5), example:\"php artisan request:fake 4\"');\n }",
"public function handle()\n\t{\n\t\tif (parent::handle() === false && ! $this->option('force')) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($this->option('all', false)) {\n\t\t\t$this->input->setOption('model', true);\n\t\t\t$this->input->setOption('migration', true);\n\t\t\t$this->input->setOption('events', true);\n\t\t}\n\t\t\n\t\tif ($this->option('model', false)) {\n\t\t\t//$this->createModel();\n\t\t}\n\t\t\n\t\tif ($this->option('migration', false)) {\n\t\t\t$this->createMigration();\n\t\t}\n\t\t\n\t\tif($this->option('events', false)) {\n\t\t\t$this->createEvents();\n\t\t}\n\t}",
"public function handle()\n {\n $website = ($this->option('website'));\n if(!$website) {\n exit('websiteId empty');\n }\n $startPage = $this->option('startpage');\n if(!$startPage) {\n $startPage = 0;\n }\n\n $this->match($website,$startPage);\n exit;\n\n }",
"public function handle(): void\n {\n $text = $this->argument('text');\n\n if ($text === null) {\n $text = $this->ask('Enter the text you wish to convert to speech (quit to exit)');\n }\n\n if (strtolower($text) === 'quit' || strtolower($text) === 'exit') {\n exit;\n }\n $this->info('The following text is being converted to speech: ' . PHP_EOL . $text . PHP_EOL);\n\n try {\n $file = $this->watsonTextToSpeech->runTextToSpeech($text);\n } catch (Throwable $throwable) {\n $this->error('There was a problem converting the text. Error: ' . $throwable->getMessage());\n exit;\n }\n $this->info('Text has been converted to speech, see: ' . $file);\n }",
"public function handle()\n {\n $a = new US;\n $a->seeder($this->option('op')); \n }",
"public function handle()\n {\n //We need an action first to determine all other tasks\n $command = strtolower($this->argument('action'));\n\n //Make sure command is recognized\n if($command === 'commands' || !array_key_exists($command, $this->commands)) {\n if($command !== 'commands'){\n $this->error(' Command \"' . $command . '\" is not recognized ');\n }\n $this->listCommands();\n if($command !== 'commands'){\n //Prevent next CLI command from happening..\n exit(self::EXIT_GENERAL);\n }else{\n return true;\n }\n }\n\n $comm = $this->commands[$command];\n $args = $this->arguments();\n $opts = $this->options();\n //Unset system options for clarity\n unset($opts['help']);\n unset($opts['quiet']);\n unset($opts['verbose']);\n unset($opts['version']);\n unset($opts['ansi']);\n unset($opts['no-ansi']);\n unset($opts['no-interaction']);\n unset($opts['env']);\n\n //Map argument names for models\n if(!empty($comm['arg_map'])){\n foreach($comm['arg_map'] as $from => $to) {\n $args[$to] = $args[$from];\n unset($args[$from]);\n }\n }else{\n // default\n $args['name'] = empty($args['arg1']) ? '' : $args['arg1'];\n unset($args['arg1']);\n $args['description'] = empty($args['arg2'] ? '' : $args['arg2']);\n unset($args['arg2']);\n }\n\n //Unset options with default values if specified\n if(!empty($comm['unset'])){\n foreach($comm['unset'] as $unset) unset($opts[$unset]);\n }\n\n\n //Unset disallowed options; we will tell them if they enter an irrelevant option for clarity\n $disallowed = [];\n $allowed = !empty($comm['options']) ? $comm['options'] : [];\n foreach ($opts as $opt => $val) {\n if(!is_null($val)){\n if(is_bool($val)){\n //boolean values only represent flags and cannot be passed by user via CLI\n if($val === true && !in_array($opt, $allowed)){\n $disallowed[] = $opt;\n }else if(in_array($opt, $allowed)){\n continue;\n }\n //else will be unset\n }else if(!empty($this->optionDefaults[$opt]) && $this->optionDefaults[$opt] !== $val && !in_array($opt, $allowed)){\n //A non-null, non-allowed value; error.\n $disallowed[] = $opt;\n }else{\n continue;\n }\n }\n unset($opts[$opt]);\n }\n if($disallowed){\n $last = array_pop($disallowed);\n $str = implode('`, `', $disallowed);\n $str = implode('` and `', $str ? [$str, $last] : [$last]);\n $str = '`' . $str . '`';\n $error = 'Error:';\n $error .= ' Option' . ($disallowed ? 's ' : ' ') . $str . ($disallowed ? ' are' : ' is') . ' not allowed for the command \"' . $command . '\"';\n $this->info($error);\n exit;\n }\n\n //Prepare arguments for method call - note options can override\n $args = array_merge($args, $opts);\n\n // handle error(s)\n $errors = [];\n if(!empty($comm['validate'])){\n foreach($comm['validate'] as $n => $v){\n if(is_int($n)){\n $field = $v;\n $validation = 'required';\n }else{\n $field = $n;\n $validation = $v;\n }\n // Validation can be improved and moved to a this->validate method\n switch($validation){\n case 'required';\n // Note we can still pass values like 0, but not whitespace only\n if(!strlen(trim($args[$field]))){\n $arg_map = '';\n if(!empty($comm['arg_map']) && $arg_map = array_search($field, $comm['arg_map'])){\n $arg_map = ' ('.$arg_map.')';\n }\n $errors[] = $field . $arg_map . ': '. 'A value is required';\n }\n break;\n }\n }\n if($errors){\n $this->info('Following syntax errors:');\n foreach($errors as $error){\n $this->error($error);\n }\n exit(self::EXIT_GENERAL);\n }\n }\n\n //Instantiate the MenuManager model\n $this->menu = new MenuManager();\n\n //Call the specified command; use a try-catch to handle errors in CLI friendly way\n try{\n $return = $this->menu->$command($args);\n }catch(\\Exception $exception){\n $error = 'Error in ' . get_class($this->menu) . ':' . $command . '()' . \"\\n\";\n $error .= 'File: ' .$exception->getFile() . \"\\n\";\n $error .= 'Line: ' .$exception->getLine() . \"\\n\";\n $error .= $exception->getMessage();\n $this->error($error);\n exit(self::EXIT_METHOD);\n }\n\n //This might be modified if say the user demanded a verbose response etc.\n //However the intended purpose is to pipe returned values as arguments to other commands.\n if(!is_null($return) && !$this->option('no-interaction')) {\n if(Utils::is_2d_array($return)){\n //for now just print it out; soon we'll migrate to JSON\n print_r($return);\n }else if(is_array($return)){\n echo implode(',',$return);\n }else{\n echo $return;\n }\n }\n }",
"public static function getLine (\n\t)\t\t\t\t\t\t// RETURNS <str> the text entered into the command line.\n\t\n\t// $input = CLI_Input::getLine();\n\t{\n\t\treadline_callback_handler_remove();\n\t\treturn readline();\n\t}",
"public function handle()\n {\n parent::handle();\n\n exec('pstorm app/Http/Requests/Forms/' . $this->input->getArgument('name') . 'Form.php');\n }",
"public function readLine($prompt);",
"protected function interact(InputInterface $input, OutputInterface $output)\n {\n if (\n null !== $input->getArgument('domain-name') &&\n null !== $input->getArgument('bundle-name') &&\n null !== $input->getArgument('bundle-description') &&\n null !== $input->getArgument('bundle-keywords') &&\n null !== $input->getArgument('your-name') &&\n null !== $input->getArgument('your-email')) {\n\n $this->validator->validateDomainName($input->getArgument('domain-name'));\n $this->validator->validateBundleName($input->getArgument('bundle-name'));\n $this->validator->validateBundleDescription($input->getArgument('bundle-description'));\n $this->validator->validateBundleKeywords($input->getArgument('bundle-keywords'));\n $this->validator->validateFullName($input->getArgument('your-name'));\n $this->validator->validateEmail($input->getArgument('your-email'));\n return;\n }\n\n $this->io->title('Create Bundle Command Interactive Wizard');\n $this->io->text([\n 'If you prefer to not use this interactive wizard, provide the',\n 'arguments required by this command as follows:',\n '',\n ' $ php bin/console skeleton-bundle:create domain-name bundle-name bundle-description bundle-keywords your-name your-email',\n '',\n 'Now we\\'ll ask you for the value of all the missing command arguments.',\n ]);\n\n // Ask for arguments if they are not defined\n $this->askForArgument($input, 'domain-name', 'The domain name', 'validateDomainName');\n $this->askForArgument($input, 'bundle-name', 'The bundle name', 'validateBundleName');\n $this->askForArgument($input, 'bundle-description', 'The bundle description', 'validateBundleDescription');\n $this->askForArgument($input, 'bundle-keywords', 'The bundle keywords. Caution! Type it like this [\"foo\", \"bar\"]', 'validateBundleKeywords');\n $this->askForArgument($input, 'your-name', 'Your Full Name', 'validateFullName');\n $this->askForArgument($input, 'your-email', 'Your Email', 'validateEmail');\n\n }",
"function parseInput(InputInterface $input, OutputInterface $output) {\n\n if (null === $this->command) {\n $this->command = $this->getApplication()->find($input->getArgument('command_name'));\n }\n\n $this->input = $input;\n $this->output = $output;\n \n return [];\n }",
"public function handle()\n {\n global $argv;\n $action = $this->argument('action');\n $argv[0] = __FILE__;\n $argv[1] = $action;\n $argv[2] = $this->option('d') ? '-d' : '';\n $client = new client();\n return $client->listen();\n }",
"abstract public function getInput();",
"function main() {\n\t\t$this->out(__('I18n Shell', true));\n\t\t$this->hr();\n\t\t$this->out(__('[E]xtract POT file from sources', true));\n\t\t$this->out(__('[I]nitialize i18n database table', true));\n\t\t$this->out(__('[H]elp', true));\n\t\t$this->out(__('[Q]uit', true));\n\n\t\t$choice = strtolower($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q')));\n\t\tswitch ($choice) {\n\t\t\tcase 'e':\n\t\t\t\t$this->Extract->execute();\n\t\t\tbreak;\n\t\t\tcase 'i':\n\t\t\t\t$this->initdb();\n\t\t\tbreak;\n\t\t\tcase 'h':\n\t\t\t\t$this->help();\n\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\texit(0);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->out(__('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.', true));\n\t\t}\n\t\t$this->hr();\n\t\t$this->main();\n\t}",
"public function handleInput() {\n $this->button_input = fread(STDIN, 1);\n if ($this->isPressed(BUTTON_W)) {\n $this->buttonW->execute();\n } elseif ($this->isPressed(BUTTON_A)) {\n $this->buttonA->execute();\n } elseif ($this->isPressed(BUTTON_S)) {\n $this->buttonS->execute();\n } elseif ($this->isPressed(BUTTON_D)) {\n $this->buttonD->execute();\n }\n }",
"public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}",
"protected function parseCliArguments()\n {\n $shortOptions = 'm::h::';\n $longOptions = array(\n 'months:',\n 'output:',\n 'output_folder:',\n 'help::'\n );\n $options = getopt($shortOptions, $longOptions);\n\n if (isset($options['h']) || isset($options['help']))\n {\n throw new NoticeException('Please see information on how to use this tool below', 1);\n }\n\n if (!isset($options['m']) && !isset($options['months']))\n {\n throw new ErrorException('You must supply a months value using either -m or --months');\n }\n\n if (isset($options['m']) || isset($options['months']))\n {\n $months = (isset($options['m'])) ? $options['m'] : $options['months'];\n if (!is_numeric($months))\n {\n throw new ErrorException('The months value provided is not a numeric');\n }\n if ($months < 1)\n {\n throw new ErrorException('The months value needs to be greater than zero');\n }\n if ($months > 1200)\n {\n throw new ErrorException('You want \"' . $months . '\" months of output? Come on now, your being a bit silly. How about we try using \"1200\", Surely ten years will be enough for now?');\n }\n $this->setNumberOfMonths($months);\n }\n\n if (isset($options['output']))\n {\n $this->setOutput($options['output']);\n }\n\n if (isset($options['output_folder']))\n {\n $this->setOutputFolder($options['output_folder']);\n }\n }",
"public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }",
"public function handle()\n {\n $features = $this->choice('Select features to install (use commas to separate)', ['Horizon', 'InertiaJS'], null, null, true);\n $this->info(\"The following features will be installed: \" . implode(', ', $features) . '.');\n// $who = $this->argument('who');\n// while (!$who) {\n// $who = $this->ask('Who are you?'/*, \"Spencer\"*/);\n// }\n// $this->info(\"Hello, $who\");\n }",
"public function handle()\n {\n\n global $argv;\n $arg = $this->argument('action');\n $argv[1] = $argv[2];\n $argv[2] = isset($argv[3]) ? \"-{$argv[3]}\" : '';\n switch ($arg) {\n case 'start':\n $this->start();\n break;\n case 'stop':\n break;\n case 'restart':\n break;\n case 'reload':\n break;\n case 'status':\n break;\n case 'connections':\n break;\n }\n\n }",
"private function parse_args() {\n\t\t//exit;\t\t\n\t}",
"function handle() {\n\t\t$xgettextArgs = array();\n\t\t$twigTemplates = array();\n\t\t$this->readCommandLineArgs($xgettextArgs, $twigTemplates);\n\t\t$phpTemplates = $this->loadTemplate($twigTemplates);\n\t\t$command = implode(' ', $xgettextArgs);\n\t\t$phpTemplates = implode(' ', $phpTemplates);\n\t\t$command = self::XGETTEXT_PATH . \" $command $phpTemplates\";\n\t\tsystem($command);\n\t}",
"private function parseArgs(){\n $args=$GLOBALS['argv'];\n $this->fileMode = 'w';\n \n if (count($args) < 2) {\n die(\"\\nNo conversion script selected\\n\\nUsage: php CreateFileFromCsv.php updateShipping [--verbose] [--sample] [--append]\\n\\n\");\n }\n\n $scriptName = $args[1];\n\n if($scriptName == 'list') {\n $this->listScripts();\n die(\"\\n\\n\");\n }\n\n if (class_exists($scriptName, true)) {\n $this->script = new $scriptName();\n } else {\n die(\"\\nCould not find script model of class $scriptName\\n\\n\");\n }\n\n unset($args[0], $args[1]);\n \n foreach($args as $arg) {\n\n $a = explode('=', $arg);\n\n switch(strtolower($a[0])) {\n case '--verbose':\n $this->verbose = true;\n break;\n \n case '--sample':\n if($a[1] ?? null && is_numeric($a[1])) {\n $this->sample = $a[1];\n echo \"Number of samples: {$this->sample}\";\n } else {\n $this->sample = 1;\n }\n\n $this->verbose = true;\n break;\n \n case '--append':\n $this->fileMode = 'a';\n break;\n\n case '--input':\n if($a[1]) {\n $this->input = $a[1];\n } else {\n die(\"No file specified with --input\");\n }\n break;\n\n case '--output':\n if($a[1]) {\n $this->output = $a[1];\n } else {\n die(\"No file specified with --output\");\n }\n break;\n\n case '--nonewline':\n $this->newline = '';\n break;\n\n case '--newline':\n $this->newline = \"\\n\";\n break;\n }\n }\n }",
"function get_input($upper = FALSE) \n{ \n $userInput = trim(fgets(STDIN));\n\n // Return input as either UPPERCASE or as user typed\n return $upper ? $userInput = strtoupper($userInput) : $userInput;\n}",
"public function testParsingSingleArgument()\n {\n $request = $this->parser->parse('foo bar');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals(['bar'], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }",
"public function is_cli_request()\n\t{\n\t\treturn FALSE;\n\t}",
"private function input(){\n $this->params['controller_name'] = $this->ask('Controller name');\n $this->params['crud_url'] = $this->ask('CRUD url');\n $this->params['model_name'] = $this->ask('Model name');\n $this->params['table_name'] = $this->ask('Table name');\n $this->params['author'] = env('PACKAGE_AUTHOR');\n }",
"function arg_check($argv,$argc,$opt){\n $parse_error = false;\n foreach ($argv as $param_count => $value) {\n\n if ($param_count == 0) continue; //TODO: handle stdin and\n\n if ($value == \"--help\" && $param_count === 1) { //help was called, exiting with 0\n help();\n }\n if ($value == \"-n\" ){\n $opt->generate_header = false;\n continue;\n }\n if (preg_match(INPUTRGX, $value) === 1 ) { //--input=\n $opt->in_filename = get_filename(MATCHINFILENAME,$value);\n continue;\n }\n if (preg_match(OUTPUTRGX, $value) === 1 ) { //--output=\n $opt->out_filename = get_filename(MATCHOUTFILENAME,$value);\n $opt->write_to_file = true;\n continue;\n }\n if (preg_match(ROOTRGX, $value) === 1 ) { //-r=\n $opt->wrap_root = true;\n $opt->wrap_root_text = get_filename(MATCHROOTRGX,$value); // actually returns name of root tag not filename\n continue;\n }\n if (preg_match(ARRAYRGX, $value) === 1 ) { //--array-name\n $opt->array_text = get_filename(MATCHARRAYRGX,$value);\n continue;\n }\n if (preg_match(ITEMRGX, $value) === 1 ) { //--item-name\n $opt->item_text = get_filename(MATCHITEMRGX,$value);\n continue;\n }\n if ($value === \"-s\") { //-s\n $opt->string_is_attribute = false;\n continue;\n }\n if ($value === \"-i\") { //-i\n $opt->int_is_attribute = false;\n continue;\n }\n if ($value === \"-l\") { //-l\n $opt->values_to_elements = true;\n continue;\n }\n if ($value === \"-t\" || $value === \"--index-items\" ) { //-t\n $opt->index_items = true;\n continue;\n }\n if ($value === \"-a\" || $value === \"--array-size\" ) { //-a\n $opt->array_size = true;\n continue;\n }\n if (preg_match(REPLACEELEMENTRGX, $value) === 1 ) { //--h\n $opt->substitute_element = true;\n $opt->substitute_string = get_filename(MATCHELEMENTREPLACEMENTTGX,$value);\n continue;\n }\n if ($value === \"-c\" ) { //-c\n $opt->substitute_value = true;\n continue;\n }\n if (preg_match(STARTINDEXRGX, $value) === 1 ) { //--start\n $opt->change_start_index = true;\n $opt->index = get_filename(MATCHSTARTINDEXRGX,$value);\n continue;\n }\n $parse_error = true; //ending with error\n break;\n }\n check_start_index($opt); //check value entered after --start=\n\n if (check_element_validity($opt->wrap_root_text,$opt) || //check validity of\n check_element_validity($opt->array_text,$opt) || //entered params\n check_element_validity($opt->item_text,$opt) ) {\n err(\"Invalid element\",50);\n }\n\n if ($parse_error ) {\n err(\"Invalid parameters, try --help for more\",1); //ERR\n }\n }",
"function getInput ($lower = false)\n {\n\n if ($lower == true) {\n $input = strtolower(trim(fgets(STDIN)));\n }\n else{\n $input = trim(fgets(STDIN));\n }\n\n // if ($lower == true) {\n // $input = strtolower($input);\n // }\n\n // Return filtered STDIN input\n return $input;\n }",
"public function handle()\n {\n $language = $this->anticipate(\n 'What is your favorite programming language?',\n ['PHP', 'Java', 'Ruby']\n );\n\n $this->info(\"Your favorite language is $language\");\n }"
] | [
"0.6873208",
"0.65231436",
"0.6474971",
"0.6204128",
"0.60515654",
"0.60236055",
"0.6012309",
"0.6003527",
"0.5958324",
"0.58908033",
"0.58841646",
"0.5875639",
"0.5874265",
"0.581882",
"0.5817767",
"0.5762",
"0.57349926",
"0.57343304",
"0.5706909",
"0.5706909",
"0.56960154",
"0.5694572",
"0.5658465",
"0.56571984",
"0.5651484",
"0.5651257",
"0.5619582",
"0.56082433",
"0.5608064",
"0.5604249",
"0.56012934",
"0.5585048",
"0.55644715",
"0.556205",
"0.5555709",
"0.55547494",
"0.5544731",
"0.55371225",
"0.55343175",
"0.5526769",
"0.55059844",
"0.5504681",
"0.55019486",
"0.55013674",
"0.5500157",
"0.5498142",
"0.5493313",
"0.54778546",
"0.5473328",
"0.54625267",
"0.5440513",
"0.5433599",
"0.5420835",
"0.5413038",
"0.5410567",
"0.5407318",
"0.5406256",
"0.5384327",
"0.5384024",
"0.53724015",
"0.53672004",
"0.5362738",
"0.5351534",
"0.5329036",
"0.5326506",
"0.5317578",
"0.53163505",
"0.53030264",
"0.52949315",
"0.5287548",
"0.52803576",
"0.5277854",
"0.52573395",
"0.525154",
"0.52364284",
"0.52255225",
"0.52247727",
"0.5222492",
"0.52197874",
"0.52021194",
"0.5199037",
"0.5190651",
"0.5189194",
"0.51865935",
"0.5184546",
"0.5174472",
"0.51689476",
"0.51668537",
"0.5164698",
"0.5161928",
"0.51599777",
"0.5150911",
"0.5150876",
"0.51437604",
"0.5142663",
"0.5142076",
"0.51418227",
"0.513757",
"0.5124992",
"0.5122814"
] | 0.53649855 | 61 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.