本文整理汇总了PHP中Area::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Area::create方法的具体用法?PHP Area::create怎么用?PHP Area::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area::create方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
Area::create(array('nombre' => 'Odontologías', 'descripcion' => 'Odontologías', 'tipo_ayuda_id' => '1'));
Area::create(array('nombre' => 'Traumatología', 'descripcion' => 'Traumatología', 'tipo_ayuda_id' => '1'));
Area::create(array('nombre' => 'Nefroligía', 'descripcion' => 'Nefroligía', 'tipo_ayuda_id' => '1'));
Area::create(array('nombre' => 'Obstetricia', 'descripcion' => 'Obstetricia', 'tipo_ayuda_id' => '1'));
Area::create(array('nombre' => 'Ginecología', 'descripcion' => 'Ginecología', 'tipo_ayuda_id' => '1'));
Area::create(array('nombre' => 'Cirugía', 'descripcion' => 'Cirugía', 'tipo_ayuda_id' => '1'));
Area::create(array('nombre' => 'Efectivo', 'descripcion' => 'Efectivo', 'tipo_ayuda_id' => '2'));
Area::create(array('nombre' => 'Remodelaciones', 'descripcion' => 'Remodelaciones', 'tipo_ayuda_id' => '3'));
}
示例2: store
/**
* Store a newly created area in storage.
*
* @return Response
*/
public function store()
{
$data = Input::all();
$area = Area::create($data);
$oc = Occupency::where('area_name', '=', $area->name)->first();
$oc->sound_level = $area->sound;
$oc->save();
if ($area) {
return Response::json(['error' => 'false', 'data' => $area->toArray()], 200);
}
return Response::json(['error' => 'true', 'message' => 'Could not create Area'], 400);
}
示例3: run
public function run()
{
Area::create(array('NombreArea' => 'Dirección', 'Objetivo_Id' => 1, 'Organigrama_Id' => 1));
Area::create(array('NombreArea' => 'Subdirección Técnica', 'Objetivo_Id' => 2, 'Organigrama_Id' => 2));
Area::create(array('NombreArea' => 'Subdirección de Posgrado', 'Objetivo_Id' => 5, 'Organigrama_Id' => 3));
Area::create(array('NombreArea' => 'Subdirección de Vinculación y Apoyo', 'Objetivo_Id' => 6, 'Organigrama_Id' => 4));
Area::create(array('NombreArea' => 'Departamento de Servicios Administrativos y Técnicos', 'Objetivo_Id' => 7, 'Organigrama_Id' => 5));
Area::create(array('NombreArea' => 'Departamento de Sistemas y Banco de Datos', 'Objetivo_Id' => 8, 'Organigrama_Id' => 6));
Area::create(array('NombreArea' => 'Sala de Juntas', 'Objetivo_Id' => 9));
Area::create(array('NombreArea' => 'Biblioteca', 'Objetivo_Id' => 10));
Area::create(array('NombreArea' => 'Vigilancia', 'Objetivo_Id' => 11));
$this->command->info('AreaTableSeeder: Areas cargadas correctamente');
}
示例4: run
public function run()
{
Area::create(['name' => 'Coffee Room', 'sound' => '120', 'temperature' => '20']);
}
示例5: create_case
/**
* create one test case
*
* @param integer $case
* @param integer $stopcase
* @return mixed null after one stopcase, false after one branchcase, true after last case
*/
function create_case($case, $stopcase) {
global $bcase, $date, $login, $proposal, $proposal2, $casetitle, $ngroup;
$stop = 0;
$branch = 0;
$casedesc = $case." (stop: ".$stopcase.", branches:";
foreach ($bcase as $value) $casedesc .= " ".$value;
$casedesc .= ")";
echo "Test case ".$casedesc."\n";
Login::$member = $login;
$proposal = null;
$proposal2 = null;
$casetitle = "";
// create area
$area = new Area;
$area->ngroup = $ngroup->id;
$area->name = "Test area case ".$casedesc;
$area->create();
// create new proposal
$proposal = new Proposal;
$proposal->title = "Test ".$date." case ".$casedesc;
$proposal->content = "Test content";
$proposal->reason = "Test reason";
$proposal->create("Test proponent ".$date." proposal case ".$casedesc, $area->id);
$proponents = array(Login::$member);
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
$casetitle = "draft";
return;
}
$issue = $proposal->issue();
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
$proposal->remove_proponent(Login::$member);
cron();
$casetitle = "remove proponent from draft";
return;
}
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
$proposal->remove_proponent(Login::$member);
time_warp($issue, "1 week");
cron();
$casetitle = "remove proponent from draft and finally revoke proposal";
return;
}
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
$proposal->remove_proponent(Login::$member);
add_proponent($proposal, "px");
time_warp($issue, "1 week");
cron();
$casetitle = "remove proponent from draft, add new proponent";
return;
}
// add proponents
for ( $i=2; $i<=REQUIRED_PROPONENTS; $i++ ) {
add_proponent($proposal, "pi".$i);
$proponents[] = Login::$member;
}
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
$casetitle = "draft with proponents";
return;
}
$proposal->submit();
if ($proposal->state=="submitted") {
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
foreach ($proponents as $proponent) {
$proposal->remove_proponent($proponent);
}
cron();
$casetitle = "remove all proponents from submitted proposal";
return;
}
if (no_branch_skip($branch, $bcase) and $stopcase == ++$stop) {
foreach ($proponents as $proponent) {
$proposal->remove_proponent($proponent);
}
for ( $i=1; $i<=REQUIRED_PROPONENTS-1; $i++ ) {
add_proponent($proposal, "pr".$i);
}
time_warp($issue, "1 week");
cron();
//.........这里部分代码省略.........
示例6: create
public function create()
{
if (!empty($_POST['area'])) {
$newArea = new Area();
if (isset($_FILES['fupload']) && $_FILES['fupload']['error'] == 0) {
//if file upload is set
move_uploaded_file($_FILES['fupload']['tmp_name'], "public/uploads/" . basename($_FILES['fupload']['name']));
$image = new Imageresize();
// an instance of image resize object
$image->load("public/uploads/" . basename($_FILES['fupload']['name']));
//$image->image =;
$image->resize(400, 400);
$image->save("public/uploads/" . basename($_FILES['fupload']['name']));
//this section is needed to get the extension for image type in renaming the image
if ($_FILES['fupload']['type'] == "image/gif") {
$ext = ".gif";
}
if ($_FILES['fupload']['type'] == "image/png") {
$ext = ".png";
}
if ($_FILES['fupload']['type'] == "image/jpeg") {
$ext = ".jpeg";
}
if ($_FILES['fupload']['type'] == "image/pjpeg") {
$ext = ".jpeg";
}
if ($_FILES['fupload']['type'] == "image/gif") {
$ext = ".gif";
}
if ($_FILES['fupload']['type'] == "image/jpg") {
$ext = ".jpg";
}
$new_name = uniqid() . "_" . time() . $ext;
//new name for the image
rename("public/uploads/" . basename($_FILES['fupload']['name']), "public/uploads/" . $new_name);
$photo = $new_name;
$newArea->img_url = $photo;
} else {
//$applicant->img_url = $_POST['imgvalue'];
}
$newArea->name = $_POST['area'];
$newArea->description = $_POST['description'];
$newArea->datecreated = date("Y:m:s H:i:s");
if ($newArea->create()) {
return 1;
//returns 1 on success
} else {
return 2;
// returns 2 on insert error
}
} else {
return 3;
//returns 3 if requiered input field is not supplied
}
}
示例7: run
public function run()
{
Area::create(['area' => 'Tecnico en Logistica']);
Area::create(['area' => 'Tecnico y Soporte y Mantenimiento en Equipo de Computo']);
}
示例8: create_ngroup
/**
* create group and areas
*
* @param string $name
* @param object $parent (optional)
* @return array
*/
function create_ngroup($name, Ngroup $parent=null) {
$ngroup = new Ngroup;
$ngroup->id = DB::fetchfield("SELECT max(id) FROM ngroup") + 1;
$ngroup->name = $name;
if ($parent) $ngroup->parent = $parent->id;
$ngroup->active = true;
$ngroup->minimum_population = 200;
$ngroup->minimum_quorum_votingmode = 10;
$ngroup->create(['id', 'name', 'parent', 'active', 'minimum_population', 'minimum_quorum_votingmode']);
$area = new Area;
$area->ngroup = $ngroup->id;
$area->name = "Politik";
$area->create();
$area2 = new Area;
$area2->ngroup = $ngroup->id;
$area2->name = "Innerparteiliches";
$area2->create();
return [$ngroup, $area];
}