本文整理汇总了PHP中Job::type方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::type方法的具体用法?PHP Job::type怎么用?PHP Job::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job::type方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Job
function do_get_testchainedphp_hello_v1($job, $resp)
{
$content = json_encode("Hello from job");
// do internal hello1 which just appends it name to our content
$j = new Job($job);
$j->name("do_get_internalphp_hello1_v1");
$j->type(Job::JOB_SYNC);
$j->content($content);
$r = $j->run();
// create sync http rest job back to localhost which takes
// the output from previous job and adds its own name.
$j = $this->job_manager()->job(HttpClient::METHOD_POST, $job->base_uri() . "/hello2");
$j->content($r->content());
$j->headers($r->headers());
$r = $j->run();
$resp->content($r->content());
$resp->headers($r->headers());
return Worker::WORKER_SUCCESS;
}
示例2: while
require 'includes/themesJob.php';
require 'objets/ObjetJob.php';
require 'includes/bbcodeTexte.php';
echo '<section id="voirJobs"><h2>Les meilleures propostions et recherches d\'emplois dans cette ville</h2>';
$request = $bdd->query('SELECT * FROM freeCitizenJob WHERE ville = "' . $ville . '" AND type = "' . $type . '" AND statut = "' . $statut . '" ORDER BY votes LIMIT 0, 10');
while ($donnees = $request->fetch(PDO::FETCH_ASSOC)) {
$job = new Job($donnees);
echo $job->id();
echo "</br>";
echo $job->titre();
echo "</br>";
echo $job->date();
echo "</br>";
echo $job->ville();
echo "</br>";
echo $job->type();
echo "</br>";
echo $job->statut();
echo "</br>";
echo $job->votes();
echo "</br>";
$texte = $job->descriptif();
echo $texte;
echo "</br>";
echo "</br>";
//formulaire d'envois de commentaire
require 'includes/includesJob.php';
}
$request->closeCursor();
echo '</section>';
} else {
示例3: getCfreldirvector
public function getCfreldirvector()
{
$jobs = Job::type('RelDir')->get();
$count = 0;
foreach ($jobs as $job) {
foreach ($job->workerunits as $ann) {
$count++;
$u = $ann->unit['content'];
$ann->type = $job->type;
$ans = $ann->content['direction'];
if ($ans == 'no_relation') {
$realans = 'Choice3';
} else {
if (strpos($ans, $u['terms']['first']['formatted']) === 0) {
$realans = 'Choice1';
} elseif (strpos($ans, $u['terms']['first']['formatted']) > 0) {
$realans = 'Choice2';
} else {
$realans = '-------';
}
}
echo "{$realans} - {$ans}\r\n";
$ann->annotationVector = array('Choice1' => $ans == 'Choice1' ? 1 : 0, 'Choice2' => $ans == 'Choice2' ? 1 : 0, 'Choice3' => $ans == 'Choice3' ? 1 : 0);
$ann->save();
}
$job = Job::id('entity/text/medical/job/0')->first();
Queue::push('Queues\\UpdateJob', array('job' => serialize($job)));
}
}
示例4: getRegenerateamtrelex
public function getRegenerateamtrelex()
{
$count = $failed = 0;
foreach (Job::type('RelEx')->where('softwareAgent_id', 'amt')->get() as $job) {
foreach ($job->workerunits as $ann) {
//dd($ann);
$ann->annotationVector = $ann->createAnnotationVector();
$ann->save();
echo "saved";
if (is_null($ann->annotationVector)) {
$failed++;
} else {
$count++;
}
}
Queue::push('Queues\\UpdateJob', array('job' => serialize($job)));
}
echo "\r\nOK: {$count}. Failed: {$failed}";
}