Welcome Guest, Not a member yet? Register   Sign In
Call to undefined method App\Models\[...]::transStart
#1

My model function is given bellow:

PHP Code:
class Product extends Model
{

    protected $table            'products';
    protected $primaryKey      'product_ID';
    protected $returnType      'object';
    protected $useSoftDeletes  false;
    protected $allowedFields    = ['....'];


    public function saveProduct$new ){
        $val = [];
        if( $new ){
            $val['product_AID']    AID;
            $val['product_GPID']    $this->GPID();
            $val['product_by']      session('user41BApp'.AID);
        }else{
            $info['updated']        time();
        }

        $val['product_title']  esc($this->request->getPost('pName'));
        $val['product_slug']    planeText(esc($this->request->getPost('pName')));
        $val['product_price']  esc($this->request->getPost('pPrice'));
        $val['product_data']    json_encode($data);
        $val['product_info']    json_encode($info);

        $this->transStart();
        $this->save($val);
        $this->saveCat();
        $this->transComplete();

        return ($this->transStatus() === FALSE) ? FALSE : [$val['product_GPID'], $this->request->getPost('cat')];

    }




There is a strange problem.
PHP Code:
model->saveProduct(true); // This is working fine 

PHP Code:
model->saveProduct(false); // This is not working. Showing error:
//Call to undefined method App\Models\Product::transStart 
"Who thinks in code"
Perfectly describes who I am
mbparvez.me
Reply


Messages In This Thread
Call to undefined method App\Models\[...]::transStart - by webdevron - 11-25-2020, 04:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB