function create_job($defaults = array()) { static $category = null; if (is_null($category)) { $category = JobeetCategoryPeer::doSelectOne(new Criteria()); } $job = new JobeetJob(); $job->fromArray(array_merge(array('category_id' => $category->getId(), 'company' => 'Sensio Labs', 'position' => 'Senior Tester', 'location' => 'Paris, France', 'description' => 'Testing is fun', 'how_to_apply' => 'Send e-Mail', 'email' => '*****@*****.**', 'token' => rand(1111, 9999), 'is_activated' => true), $defaults), BasePeer::TYPE_FIELDNAME); return $job; }
function create_job($defaults = array()) { static $category = null; if (is_null($category)) { $category = Doctrine::getTable('JobeetCategory')->createQuery()->limit(1)->fetchOne(); } $job = new JobeetJob(); $job->fromArray(array_merge(array('category_id' => $category->getId(), 'company' => 'Sensio Labs', 'position' => 'Senior Tester', 'location' => 'Paris, France', 'description' => 'Testing is fun', 'how_to_apply' => 'Send e-Mail', 'email' => '*****@*****.**', 'token' => rand(1111, 9999), 'is_activated' => true), $defaults)); return $job; }