Download the PHP package thelia/customer-scope-module without Composer

On this page you can find all versions of the php package thelia/customer-scope-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package customer-scope-module

CustomerScope

Provide a scope mechanism to associate customers to entities.

Installation

Manually

Composer

Add it in your main Thelia composer.json file

Concepts

A scope is a kind of association that a customer can have. It is defined by a code, and the class of entity that will be associated. Any model class generated by Propel can be used to create a scope.

Scopes must be associated to a scope group.

Customer can be associated to a specific entity instance of a class that has a scope, creating a customer scope. A customer can be associated with any number of entities in any number of scopes. What this association means is up to your business logic.

For exemple, let's say you manage physical stores what to associate customers to them. You can use scopes for that.

Assuming that you have a Store class representing your stores, you can create:

You can then associate a customer to any instance of the Store class, and then easily check to what stores your customer is associated to in your application.

Usage

For the time being, scope and scope groups have to be inserted directly into the database. You could for example do this in a module specific to your site, on activation.

Handler

The customer scope handler service allows you to add customers to scopes, and to check the scopes a customer belongs to.

It is registered in the container under the id customerscope.customerscope.handler. See the CustomerScopeHandler class for the available methods.

Loops

customer-scope

A loop is also available to access the customer scopes.

Input arguments

Argument Description
customer_id Id or list of customer ids.
scope_id Id or list of scope ids.
entity_id Id or list of entity ids.
entity Entity class.

Output arguments

Variable Description
$CUSTOMER_SCOPE_CUSTOMER_ID Customer id.
$CUSTOMER_SCOPE_SCOPE_ID Scope id.
$CUSTOMER_SCOPE_ENTITY_ID Entity id.
$CUSTOMER_SCOPE_SCOPE_ENTITY Entity class.

Query

CustomerQuery

This module provides a CustomerQuery class that extends the base Thelia query and provides methods to filter cutomers by scope.

It can be used in replacement of the base CustomerQuery.

Or mixed in your own query class by using the static methods. These methods take a ModelCriteria query class and will act in it.

They assume that the customer table is already present in the query scope, so your query must for exemple extends CustomerQuery or make a join to the customer table.


All versions of customer-scope-module with dependencies

PHP Build Version
Package Version
Requires thelia/installer Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thelia/customer-scope-module contains the following files

Loading the files please wait ....