Supplier (Nhà sản xuất)
#Get
static function Supplier::Get($args);
#Parameters
Tham số $args có thể là :
ID (int) nhà sản xuất
Mảng (array) các tham số model
#Gets
static function Supplier::Gets($args);
#Parameters
Tham số $args có thể là :
ID (int) đơn hàng
Mảng (array) các tham số model
#Count
static function Supplier::Count($args);
Tham số $args có thể là :
Mảng (array) các tham số model
#Insert
Tạo một nhà sản xuất mới hoặc cập nhật đơn hàng
static function Supplier::Insert($args);
#Parameters
Tham số $args Mảng (array) các tham số :
Parameter | Value | Description |
---|---|---|
id | int | default 0 | Nếu khác 0 nhà sản xuất sẽ được cập nhật. |
name | string | Tên nhà sản xuất. |
firstname | string | Họ tên người quản lý nhà sản xuất. |
lastname | string | Họ tên người quản lý nhà sản xuất. |
string | Email người quản lý nhà sản xuất. | |
phone | string | Số điện thoại người quản lý nhà sản xuất. |
address | string | Địa chỉ người quản lý nhà sản xuất. |
seo_title | string | meta title nếu để trống sẽ tự động lấy title. |
seo_description | string | meta description. |
seo_keywords | string | Meta keywords. |
image | string | Ảnh đại diện nhà sản xuất. |
language | array | Đa ngôn ngữ. |
#Example
$supplier = [
'title' => 'Tiki training',
'firstname' => 'Nguyễn Tung',
'lastname' => 'Hoành',
'phone' => '0123456789',
'email' => 'tunghoanh@gmail.com',
'address' => '213/14 D2 Binh Thanh',
'image' => 'nsx/banner.png',
];
Supplier::insert($supplier);
#Delete
Xóa một nhà sản xuất
static function Supplier::Delete($brandsID);
#Parameters
Tham số brandsID ID của nhà sản xuất cần xóa
#Metadata
#Get metadata
Hàm này dùng để lấy một metadata trong cơ sở dữ liệu
static function Supplier::getMeta($object_id = '', $meta_key = '', $single = false);
#Parameters
Parameter | Value | Description |
---|---|---|
$object_id | int | Id post |
$meta_key | string | Key của Meta data |
$single | true|false (default false) | Nếu $single = true thì nó sẽ trả về giá trị của $meta_key , ngược lại nó sẽ trả về một mảng chứa tất cả các thông tin của record đó. |
#Update metadata
Hàm này cập nhật giá trị cho một meta key nào đó, nếu meta_key không tồn tại sẽ tạo mới metadata
static function Supplier::updateMeta($object_id, $meta_key, $meta_value);
#Parameters
Parameter | Value | Description |
---|---|---|
$object_id | int | Id post |
$meta_key | string | Key của Meta data |
$meta_value | string | Giá trị của Meta data |
#Delete metadata
Hàm này xóa một hoặc nhiều metas ra khỏi cơ sở dữ liệu, cấu trúc như sau:
static function Supplier::deleteMeta($object_id, $meta_key, $meta_value, $delete_all = false);
#Parameters
$delete_all sẽ có giá trị true hoặc false, nếu true thì nó xóa hết tất cả các field có key trùng với $meta_key, ngược lại nó chỉ xóa field có key trùng với $meta_key và có object_id trùng với $object_id.
$meta_value nếu bạn thiết lập giá trị cho tham số này thì nó sẽ bổ sung thêm một điều kiện xóa đó là giá trị của key meta phải bằng với $meta_value.