Categories

Otsikko

Ei muutoksia

Kestolinkki

Ei muutoksia

Sisältö

OldNew
8$category = new ent_category(); 8$category = new ent_category();
9$category->data['name']['en'] = 'Rubber Ducks'; 9$category->data['name']['en'] = 'Rubber Ducks';
10$category->save(); 10$category->save();
11```
12
13## Reference Model
14
15```php
16echo reference::category($category_id)->name;
17```
18
19### Database Query
20
21```php
22$query = database::query(
23 "select c.id, ci.name from ". DB_TABLE_PREFIX ."categories c
24 left join ". DB_TABLE_PREFIX ."categories_info ci on (ci.category_id = c.id and ci.language_code = 'en')
25 where c.id = ". (int)$category_id ."
26 limit 1;"
27);
28
29$category = database::fetch($query);
11```30```

Muokannut tim 29 tammik. 2024 kello 23:14

This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.