Back to Opencart

Class Opencart\Admin\Model\Catalog\Attribute

docs/api/Opencart.Admin.Model.Catalog.Attribute.html

4.1.0.39.0 KB
Original Source

Namespaces

Classes

Class Opencart[Admin](http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.html)\[Model](http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Model.html)\[Catalog](http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.Model.Catalog.html)\[Attribute](http://localhost\opencart-master/docs/api/Opencart.Admin.Model.Catalog.Attribute.html)

| extends | Model |

Class Attribute Can be called from $this->load->model('catalog/attribute');

Located at admin\model\catalog\attribute.php

Methods
`
public

			` | `addAttribute(array<string, mixed> $data): int`

Add Attribute Create a new attribute record in the database.

Add Attribute Create a new attribute record in the database.

Returns

returns the primary key of the new attribute record

| # | | `

public

			` | `editAttribute(int $attribute_id, array<string, mixed> $data): void`

Edit Attribute Edit attribute record in the database.

Edit Attribute Edit attribute record in the database.

Parameters

| $attribute_id |

primary key of the attribute record to edit

| | $data |

array of data

|

| # | | `

public

			` | `deleteAttribute(int $attribute_id): void`

Delete Attribute Delete attribute record in the database.

Delete Attribute Delete attribute record in the database.

Parameters

| $attribute_id |

primary key of the attribute record to be deleted

|

| # | | `

public

			` | `getAttribute(int $attribute_id): array<string, mixed>`

Get Attribute Get the record of the attribute record in the database.

Get Attribute Get the record of the attribute record in the database.

Parameters

| $attribute_id |

primary key of the attribute record to be fetched

|

| # | | `

public

			` | `getAttributes(array<string, mixed> $data = []): array<int, array<string, mixed>>`

Get Attributes Get the record of the attribute record in the database.

Get Attributes Get the record of the attribute record in the database.

Parameters

| $data |

array of filters

|

| # | | `

public

			` | `getTotalAttributes(): int`

Get Total Attributes Get the total number of attribute records in the database.

Get Total Attributes Get the total number of attribute records in the database.

Returns

total number of attribute records

| # | | `

public

			` | `getTotalAttributesByAttributeGroupId(int $attribute_group_id): int`

Get Total Attributes By Attribute Group ID Get the total number of attribute records with group ID in the database.

Get Total Attributes By Attribute Group ID Get the total number of attribute records with group ID in the database.

Parameters

| $attribute_group_id |

foreign key of the attribute record to be fetched

|

Returns

total number of attribute records that have attribute group ID

| # | | `

public

			` | `addDescription(int $attribute_id, int $language_id, array<string, mixed> $data): void`

Add Description

Add Description

Parameters

| $attribute_id |

primary key of the attribute record

| | $language_id |

primary key of the attribute language

|

| # | | `

public

			` | `deleteDescriptions(int $attribute_id): void`

Delete Descriptions Delete attribute description record in the database.

Delete Descriptions Delete attribute description record in the database.

Parameters

| $attribute_id |

primary key of the attribute record to be fetched

|

| # | | `

public

			` | `deleteDescriptionsByLanguageId(int $language_id): void`

Delete Descriptions By Language ID Delete attribute description record in the database.

Delete Descriptions By Language ID Delete attribute description record in the database.

Parameters

| $language_id |

primary key of the attribute language

|

| # | | `

public

			` | `getDescription(int $attribute_id, int $language_id): array<string, mixed>`

Get Description Get the record of the attribute description record in the database.

Get Description Get the record of the attribute description record in the database.

Parameters

| $attribute_id |

primary key of the attribute record to be fetched

| | $language_id |

primary key of the attribute language

|

| # | | `

public

			` | `getDescriptions(int $attribute_id): array<int, array<string, string>>`

Get Descriptions Get the record of the attribute record in the database.

Get Descriptions Get the record of the attribute record in the database.

Parameters

| $attribute_id |

primary key of the attribute record to be fetched

|

Returns

Descriptions

| # | | `

public

			` | `getDescriptionsByLanguageId(int $language_id): array<int, array<string, string>>`

Get Descriptions By Language ID Get the record of the attribute record in the database.

Get Descriptions By Language ID Get the record of the attribute record in the database.

Parameters

| $language_id |

primary key of the attribute language

|

Returns

Descriptions by language_id

| # |

Methods inherited from Opencart\System\Engine\Model
__construct(),__get(), __set(),__isset()
Properties inherited from Opencart\System\Engine\Model
$registry

OpenCart API API documentation generated by ApiGen dev-master