Example #1
0
 public function loadSchemeByCode($schemeId)
 {
     try {
         return \Akzo\Scheme::with(array('initiator', 'reviewer', 'approver'))->where('code', 'like', $schemeId)->get()->first();
     } catch (\PDOException $e) {
         $GLOBALS['logger']->info("Error: " . $e->getMessage());
         throw new \InvalidArgumentException(\Akzo\Product\ErrorMessages::PROCESS_ERROR, \Native5\Core\Http\StatusCodes::BAD_REQUEST);
     }
 }
Example #2
0
 private function _updateSchemeUid(\Akzo\Scheme $scheme)
 {
     // Need to add today's month / year
     $dT = new \DateTime();
     // Now retrieve the id of this scheme saved in DB, build the uid and save it again
     $scheme->uid = self::_getSchemeTypeIdentifier($scheme->type) . $dT->format("my") . str_pad($scheme->id, 6, "0", STR_PAD_LEFT);
     $scheme->save();
     return $scheme;
 }