public function __construct($model = null)
 {
     $this->name = "pda eShop";
     $this->owner = "pda";
     $this->country = Country::whereName("Greece")->first();
     if ($this->country != null) {
         $this->zone = Zone::where('country_id', $this->country->id)->where('name', 'Attica')->first();
     }
 }
Esempio n. 2
0
 public function setCode($code)
 {
     if (is_null($code)) {
         $this->fv_error_message = $this->fv_error_message . '<br>- Código' . ERROR_NULL;
         return;
     }
     $codeZ = Zone::where('reg_code', $code)->select('reg_code')->first();
     if (!empty($codeZ->reg_code)) {
         $this->fv_error_message = $this->fv_error_message . '<br>- Código ' . ERROR_DUPLICADO;
         return;
     }
     $this->reg_code = $code;
     return $this;
 }
Esempio n. 3
0
 public function show($id)
 {
     $zones = Zone::where('id', $id)->first();
     return View::make('zonas.show', array('zone' => $zones));
 }