Save

Navigation:  Development > Function Reference > CategorySet >

Save

Previous pageReturn to chapter overviewNext page

Save method used to Add or Update data in database table. We can use two method to save data.
 
 

Format App::CategorySet(NAME)->Save($data);
 
This data variable  formed like $data['Category'] = array(Field1=Value1,Field2=Value2,Field3=Value3)

 
Note: For all CategorySet model name is always Category.
 

For example 
$data['Category']['parentid'] = 0;
$data['Category']['title'] = 'How to install Application';
$data['Category']['image'] = 'app.jpg';
$data['Category']['description'] = 'Application is one of the easiest solutions to incorporate new features.';
$data['Category']['type'] = 'blog-cat';
 
$obj = App::CategorySet()->Save($data);