FoxSecrets
Well-known member
I am trying to save data directly to db calling from the middle of another function (not by submitting process).
I can dump the data but it's not being saved. What's wrong? Is the filter related to new field or the incoming data?
	
	
	
		
				
			I can dump the data but it's not being saved. What's wrong? Is the filter related to new field or the incoming data?
		Code:
	
	public function createItem($data)
    {
        $item = $this->em()->create('My\Addon:Class');
        $input = $this->filter([
            'id'       => 'uint',
            'name'     => 'str',
            'qty'      => 'uint',
        ]);
        
        $input['name] = $data['name'];
        $input['qty'] = $data['qty'];
        $form = $this->formAction();
        $form->basicEntitySave($item, $input);
        return $form;
    } 
 
		