当前位置: 首页>>代码示例>>PHP>>正文


PHP Job::all方法代码示例

本文整理汇总了PHP中Job::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::all方法的具体用法?PHP Job::all怎么用?PHP Job::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Job的用法示例。


在下文中一共展示了Job::all方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMyprofile

 public function getMyprofile()
 {
     $id = Auth::user()->id;
     $alumni_id = null;
     $sql = "SELECT * FROM alumni WHERE account_id = ?";
     $prof = DB::select($sql, array($id));
     if ($prof != null) {
         $alumni_id = $prof[0]->id;
     }
     $sql2 = "SELECT * FROM degree WHERE alumni_id = ?";
     $deg = DB::select($sql2, array($alumni_id));
     $sql3 = "SELECT * FROM work_experience WHERE alumni_id = ?";
     $wrk_exp = DB::select($sql3, array($alumni_id));
     $sql4 = "SELECT * FROM certificate WHERE alumni_id = ?";
     $certificate = DB::select($sql4, array($alumni_id));
     // $sql5 = "SELECT * FROM alumni_tracer WHERE alumni_id = ?";
     $sql5 = "SELECT at.*, sq.question, sc.choice\n\t\t\t\tFROM alumni_tracer AS at\n\t\t\t\tINNER JOIN survey_questions AS sq\n\t\t\t\tON sq.id = at.question_id\n\t\t\t\tINNER JOIN survey_choices AS sc\n\t\t\t\tON sc.id = at.choice_id\n\t\t\t\tWHERE at.alumni_id = ?\n\t\t\t\tORDER BY at.question_id";
     $a_tracer = DB::select($sql5, array($alumni_id));
     $dept = Department::all();
     $region = Region::all();
     $province = Province::all();
     $occupation = Occupation::all();
     $company = Company::all();
     $deg_title = DegreeTitle::all();
     $school = School::all();
     $jobs = Job::all();
     $field = Field::all();
     $questions = DB::select("SELECT * FROM survey_questions");
     $civil_status = DB::select("SELECT * FROM civil_status");
     return View::make('user.profile')->with('company', $company)->with('field', $field)->with('occupation', $occupation)->with('work_exp', $wrk_exp)->with('degree', $deg)->with('a_tracer', $a_tracer)->with('certificate', $certificate)->with('school', $school)->with('deg_title', $deg_title)->with('profile', $prof)->with('dept', $dept)->with('region', $region)->with('province', $province)->with('civil_status', $civil_status)->with('questions', $questions)->with('jobs', $jobs);
 }
开发者ID:patocjurel,项目名称:capstone-project,代码行数:31,代码来源:UserController.php

示例2: fire

 /**
  * Execute the console command
  *
  * @return void
  */
 public function fire()
 {
     // Check for a list option
     $list = $this->option('list');
     $job_name = $this->argument('jobname');
     if (empty($list) && !empty($job_name)) {
         $inputController = new InputController();
         list($collection_uri, $name) = $inputController->getParts($job_name);
         // Check if the job exists
         $job = \Job::where('name', '=', $name)->where('collection_uri', '=', $collection_uri)->first();
         if (empty($job)) {
             $this->error("The job with identified by: {$job_name} could not be found.\n");
             exit;
         }
         $this->info('The job has been found.');
         // Configure a log handler if configured
         $this->addLogHandler();
         $startDate = new Carbon();
         $iso8601 = $startDate->toISo8601String();
         \Log::info("Executing job {$name} at {$iso8601}");
         try {
             $job_exec = new JobExecuter($job, $this);
             $job_exec->execute();
         } catch (\Exception $ex) {
             $endDate = new Carbon();
             $iso8601 = $endDate->toISO8601String();
             \Log::error("The job {$job_name} has failed at {$iso8601}");
             \Log::error($ex->getMessage());
             \Log::error($ex->getTraceAsString());
         }
         $endDate = new Carbon();
         $iso8601 = $endDate->toISO8601String();
         $job->date_executed = time();
         $job->added_to_queue = false;
         $job->save();
         \Log::info("The job has ended at {$iso8601}");
     } else {
         $jobs = \Job::all(['name', 'collection_uri'])->toArray();
         if (!empty($jobs)) {
             $this->info("=== Job names ===");
             foreach ($jobs as $job) {
                 $this->info($job['collection_uri'] . '/' . $job['name']);
             }
         } else {
             $this->info("No jobs found.");
         }
     }
 }
开发者ID:tdt,项目名称:input,代码行数:53,代码来源:ExecuteJob.php

示例3: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $queue = $this->argument('queue') ? $this->argument('queue') : \Config::get('queue.connections.beanstalkd.queue');
     $this->info(sprintf('Clearing queue: %s', $queue));
     $pheanstalk = \Queue::getPheanstalk();
     $pheanstalk->useTube($queue);
     $pheanstalk->watch($queue);
     while ($job = $pheanstalk->reserve(0)) {
         $pheanstalk->delete($job);
     }
     // Set the flag of the jobs
     $jobs = \Job::all();
     foreach ($jobs as $job) {
         $job->added_to_queue = false;
         $job->save();
     }
     $this->info('The Beankstalk queue has been cleared.');
 }
开发者ID:tdt,项目名称:input,代码行数:23,代码来源:ClearBeanstalk.php

示例4: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // Get the file option from the command line
     $filename = $this->option('file');
     if (empty($filename)) {
         $filename = self::getExportFile();
     }
     // Get the jobid, if none is provided, return all of the jobs by default
     $jobid = $this->argument('jobid');
     $content = null;
     if (empty($jobid)) {
         $jobs = \Job::all();
         $content = array();
         foreach ($jobs as $job) {
             $content[$job->collection_uri . '/' . $job->name] = $job->getAllProperties();
         }
         $content = json_encode($content);
     } else {
         $job = InputController::get($jobid);
         if (empty($job)) {
             $this->error("No input job has been found with the given identifer ({$jobid}).");
             die;
         }
         $content[$job->collection_uri . '/' . $job->name] = $job->getAllProperties();
         $content = json_encode($content);
     }
     try {
         // Write to file
         $fs = new Filesystem();
         if ($fs->exists($filename)) {
             $fs->put($filename, $content);
         } else {
             $handle = fopen($filename, "w");
             if (!$handle) {
                 \App::abort('Could not open/create the file ' . $filename);
             }
             fwrite($handle, $content);
         }
         $this->info("The export has been written to the file '{$filename}'.");
     } catch (Exception $e) {
         $this->error("The contents could not be written to the file '{$filename}'.");
         die;
     }
 }
开发者ID:tdt,项目名称:input,代码行数:49,代码来源:Export.php

示例5: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // Get the file option from the command line
     $filename = $this->option('file');
     if (empty($file)) {
         $file = self::getExportFile();
     }
     // Get the jobid, if none is provided, return all of the jobs by default
     $jobid = $this->argument('jobid');
     $content = null;
     if (empty($jobid)) {
         $jobs = \Job::all();
         $content = array();
         foreach ($jobs as $job) {
             $content[$job->collection_uri . '/' . $job->name] = $job->getAllProperties();
         }
         $content = json_encode($content);
     } else {
         $job = InputController::get($jobid);
         if (empty($job)) {
             $this->error("No input job has been found with the given identifer ({$jobid}).");
             die;
         }
         $content[$job->collection_uri . '/' . $job->name] = $job->getAllProperties();
         $content = json_encode($content);
     }
     // Output
     if (empty($filename)) {
         // Print to console
         echo $content;
     } else {
         try {
             // Write to file
             file_put_contents($filename, $content);
             $this->info("The export has been written to the file '{$filename}'.");
         } catch (Exception $e) {
             $this->error("The contents could not be written to the file '{$filename}'.");
             die;
         }
     }
 }
开发者ID:Tjoosten,项目名称:input,代码行数:46,代码来源:Export.php

示例6: listJobs

 /**
  * Return a list of jobs
  *
  * @return \View
  */
 private function listJobs()
 {
     // Get list of jobs
     $jobs = \Job::all();
     return \View::make('input::ui.jobs.list')->with('title', 'Jobs management | The Datatank')->with('jobs', $jobs);
 }
开发者ID:tdt,项目名称:input,代码行数:11,代码来源:UiController.php

示例7: function

    }
    $app->response->body($pros->toJson());
});
//---------------------------//
//------JOBS FUNCTIONS-------//
/*
 * Get Jobs(all) - OK
 * Job details - OK
 * New Job - OK
 * Edit Job - OK
 * Delete Job - OK
 * Take offer -
 */
//Job by any condition
$app->get("/jobs", function () use($app) {
    $app->response->body(Job::all()->toJson());
});
//Job Details
$app->get("/job/:job_id", function ($job_id) use($app) {
    $job = Job::find($job_id);
    $app->response->body($job->toJson());
});
//New job
$app->post('/job/new/', function () use($app) {
    $params = $app->request()->params();
    //Get all aprameters
    $r = Job::new_job($params);
    $app->response->body($r);
});
//Edit Job
$app->post('/job/update', function () use($app) {
开发者ID:Mitsaras1911,项目名称:api,代码行数:31,代码来源:index.php

示例8: feed

 public function feed()
 {
     $jobs = Job::all()->toArray();
     return Response::json(['data' => $jobs], 200);
 }
开发者ID:paulstefanday,项目名称:HumbleCommunity,代码行数:5,代码来源:JobsController.php

示例9: getJob

 /**
  * GET a job based on the uri provided
  *
  * @return \Response
  */
 private function getJob()
 {
     $uri = $this->getUri();
     // If the uri is nothing, return a list of all the jobs
     if ($uri == '/') {
         $jobs = \Job::all();
         $input_document = array();
         foreach ($jobs as $job) {
             $input_document[$job->collection_uri . '/' . $job->name] = $job->getAllProperties();
         }
         return $this->makeResponse(str_replace('\\/', '/', json_encode($input_document)), 200);
     }
     if (!$this->exists($uri)) {
         \App::abort(404, "No job has been found with the uri {$uri}");
     }
     // Get Definition object based on the given uri
     $job = $this->get($uri);
     $job = $job->getAllProperties();
     return $this->makeResponse(str_replace('\\/', '/', json_encode($job)), 200);
 }
开发者ID:tdt,项目名称:input,代码行数:25,代码来源:InputController.php

示例10: index

 /**
  * Display a listing of jobs
  *
  * @return Response
  */
 public function index()
 {
     $jobs = Job::all();
     return View::make('jobs.index', compact('jobs'));
 }
开发者ID:aeastmead,项目名称:blinxly,代码行数:10,代码来源:JobsController.php


注:本文中的Job::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。