Skip to content

2. Models and Collection

Pranjal Pandey edited this page May 25, 2022 · 8 revisions

Model

A row in database is represented by a model in Arca. Arca can perform all magic due to models to create a new row, you just need to create a new model and save

//create a new model 
$user = $db->create('user');
$user->name = "John Doe";
$user->email = "John@test.com";
$user->save();

magic methods

Model utilised php's magic __get() and __set() method to provide a neat and simple ways to set values in model and retrive values , once a row is fetched it is sync with model properties

Clone this wiki locally