CustomerGroupWriter
in package
implements
CustomerGroupWriterInterface
Class CustomerGroupWriter
Tags
Interfaces, Classes and Traits
- CustomerGroupWriterInterface
- Interface CustomerGroupWriterInterface
Table of Contents
- $languageProvider : LanguageProvider
- $queryBuilder : CI_DB_query_builder
- __construct() : mixed
- CustomerGroupWriter constructor.
- createBase() : CustomerGroupWriter
- Create base data from chosen personal offers table.
- store() : $this|CustomerGroupWriterInterface
- Saves customer group entity data in database.
- update() : $this|CustomerGroupWriterInterface
- Updates customer group entity data in database.
- _addGroupPermissionToCategories() : $this
- Add group permission id to categories table.
- _addGroupPermissionToProducts() : $this
- Add group permission id to products table.
- _columnNotExists() : bool
- Check if given column exists in given table.
- _createGroupPermissionColumn() : $this
- Creates an group_permission by id column in given table.
- _createPersonalOfferTable() : $this
- Creates an personal offer table with given id as suffix.
- _dropPersonalOfferTableIfExists() : $this
- Drops personal offer table, if table with id exist.
- _setDefault() : CustomerGroupWriter
- Updates the default customer group in the configuration data table.
Properties
$languageProvider
protected
LanguageProvider
$languageProvider
$queryBuilder
protected
CI_DB_query_builder
$queryBuilder
Methods
__construct()
CustomerGroupWriter constructor.
public
__construct(CI_DB_query_builder $queryBuilder, LanguageProvider $languageProvider) : mixed
Parameters
- $queryBuilder : CI_DB_query_builder
- $languageProvider : LanguageProvider
Return values
mixed —createBase()
Create base data from chosen personal offers table.
public
createBase(IntType $customerGroupId, IntType $baseId) : CustomerGroupWriter
Parameters
Return values
CustomerGroupWriter —store()
Saves customer group entity data in database.
public
store(CustomerGroupInterface $customerGroup) : $this|CustomerGroupWriterInterface
Parameters
- $customerGroup : CustomerGroupInterface
-
Customer group to be saved.
Return values
$this|CustomerGroupWriterInterface —Same instance for chained method calls.
update()
Updates customer group entity data in database.
public
update(CustomerGroupInterface $customerGroup) : $this|CustomerGroupWriterInterface
Parameters
- $customerGroup : CustomerGroupInterface
-
Customer group to be updated.
Return values
$this|CustomerGroupWriterInterface —Same instance for chained method calls.
_addGroupPermissionToCategories()
Add group permission id to categories table.
protected
_addGroupPermissionToCategories( $customerGroupId) : $this
Parameters
Return values
$this —_addGroupPermissionToProducts()
Add group permission id to products table.
protected
_addGroupPermissionToProducts( $customerGroupId) : $this
Parameters
Return values
$this —_columnNotExists()
Check if given column exists in given table.
protected
_columnNotExists( $column, $table) : bool
Parameters
Return values
bool —_createGroupPermissionColumn()
Creates an group_permission by id column in given table.
protected
_createGroupPermissionColumn( $id, $table) : $this
Parameters
Return values
$this —_createPersonalOfferTable()
Creates an personal offer table with given id as suffix.
protected
_createPersonalOfferTable( $customerGroupId) : $this
Parameters
Return values
$this —_dropPersonalOfferTableIfExists()
Drops personal offer table, if table with id exist.
protected
_dropPersonalOfferTableIfExists( $customerGroupId) : $this
Parameters
Return values
$this —_setDefault()
Updates the default customer group in the configuration data table.
protected
_setDefault(CustomerGroupInterface $customerGroup, $customerGroupId) : CustomerGroupWriter
Parameters
- $customerGroup : CustomerGroupInterface
- $customerGroupId :