Beispiel #1
0
    public function validate($data = null){

        $this->name=$data['Name'];
        $this->image=$data['Image'];
        $this->prize=$data['Price'];
        $this->condition=$data['Condition'];
        $this->summary=$data['Summary'];
        $this->quantity=$data['Quantity'];
        $this->brand=implode(array_slice($data, 7, 1),'');
        $this->brand_id = array_search($this->brand , $this->BrandList());
        $this->category=implode(array_slice($data, 6, 1),'');
        $this->cat_id = array_search($this->category , $this->CategoryList());
        $this->company= Auction::username();
        $this->c_id = Auction::company();

        $extraCondition = array_slice($data, 8 , count($data));

        $extraCond= [];

        foreach($extraCondition as $key=>$value){;
            $extraCond[]=[$key => $value];
        }

        $this->extra_cond = $extraCond;

        return parent::validate();
    }