diff --git a/.github/workflows/deploy-documents.yml b/.github/workflows/deploy-documents.yml index 1708e6d0d..6f26b554b 100644 --- a/.github/workflows/deploy-documents.yml +++ b/.github/workflows/deploy-documents.yml @@ -1,4 +1,7 @@ -name: Deploy Documents +# Workflow inspiration and adaptation came from Andruino-Cli +# https://github.com/arduino/arduino-cli/blob/master/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml + +name: Deploy Documents 5.8 env: PYTHON_VERSION: "3.9" @@ -6,7 +9,7 @@ env: on: push: branches: - # Branch to base "dev" website on. Set in siteversion.py also. + # Branch to base "dev" website on. - master # Release branches have names like 0.8.x, 0.9.x, ... - "[0-9]+.[0-9]+.x" @@ -25,15 +28,16 @@ jobs: if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then RESULT="true" else - RESULT="true" + RESULT="false" fi echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "Deploy documents: $RESULT" publish: runs-on: ubuntu-latest needs: pre-publish - if: needs.publish-determination.outputs.result == 'true' + if: needs.pre-publish.outputs.result == 'true' steps: - name: Checkout repository @@ -49,23 +53,56 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements.txt - - name: Create all generated documentation content - run: mkdocs build + - name: Get sponsors and fanart + run: | + wget -O docs/assets/sponsors.md \ + https://raw.githubusercontent.com/phalcon/assets/master/phalcon/sponsors-fragment.html + wget -O overrides/fanart.md \ + https://raw.githubusercontent.com/phalcon/assets/master/phalcon/fanart-fragment.html + + - name: Update NFR list + run: | + python ./update-nfr.py - name: Determine versioning parameters id: determine-versioning - run: echo "data={"version":"5.4.0", "alias"="latest"}" >> $GITHUB_OUTPUT + run: | + # Read the first line from the VERSION file + LINE=$(head -n 1 ./VERSION) + + # Extract version and alias using parameter expansion + VERSION="${LINE%%|*}" + ALIAS="${LINE#*|}" + + # Print the extracted values for verification + echo "Version: $VERSION" + echo "Alias: $ALIAS" + + echo "PH_DOCS_VERSION=$VERSION" >> $GITHUB_ENV + echo "PH_DOCS_ALIAS=$ALIAS" >> $GITHUB_ENV - name: Deploy - if: fromJson(steps.determine-versioning.outputs.data).version != null + if: ${{ env.PH_DOCS_VERSION }} != null run: | - # Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits. - git config --global user.email "deploy@phalcon.io" - git config --global user.name "Phalcon Team Deploy Bot" - git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production - poetry run mike deploy \ + # Publishing implies creating a git commit on the production branch, + # We will need to create a user for this at some point + echo "Deploying with Mike" + git config user.name niden + git config user.email nikos@niden.net + git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages + mike deploy \ --update-aliases \ + --alias-type=redirect \ --push \ - --remote origin \ - ${{ fromJson(steps.determine-versioning.outputs.data).version }} \ - ${{ fromJson(steps.determine-versioning.outputs.data).alias }} + ${{ env.PH_DOCS_VERSION }} \ + ${{ env.PH_DOCS_ALIAS }} + echo "Deployed" + +# git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production +# mike deploy \ +# --update-aliases \ +# --alias-type=redirect \ +## --branch production \ +# --push \ +# ${{ env.PH_DOCS_VERSION }} \ +# ${{ env.PH_DOCS_ALIAS }} diff --git a/.gitignore b/.gitignore index 45ddf0ae3..e9f715adf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ site/ + +# JetBrains IDE +.idea/ +*.iml diff --git a/README.md b/README.md index 10423a61f..a51ad3349 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ for details about contributions to this repository. ## Sponsors -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)] +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)] diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..934b4d1d1 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +5.8| diff --git a/docs/acl.md b/docs/acl.md index 1d5991199..a1f2f303f 100644 --- a/docs/acl.md +++ b/docs/acl.md @@ -2,34 +2,45 @@ - - - ## Overview -[Phalcon\Acl][acl-acl] provides an easy and lightweight management of ACLs as well as the permissions attached to them. [Access Control Lists][acl] (ACL) allow an application to control access to its areas and the underlying objects from requests. +The [Phalcon\Acl][acl-acl] component offers a lightweight and straightforward +method for managing Access Control Lists (ACLs) and associated permissions. +ACLs play a crucial role in regulating access to areas and underlying objects +within an application. -In short, ACLs have two objects: The object that needs access, and the object that we need access to. In the programming world, these are usually referred to as Roles and Resources. In the Phalcon world, we use the terminology [Role][acl-role] and [Component][acl-component]. +In programming, ACLs typically involve two key entities: the object seeking access (Role) and the object being accessed (Component or Resource). For Phalcon, these are called [Roles][acl-role] and [Components][acl-component]. Looking at a practical scenario, [Roles][acl-role] define the groups of users, and [Components][acl-component] represent areas of the application. !!! info "Use Case" An accounting application needs to have different groups of users have access to various areas of the application. **Role** + - Administrator Access + - Accounting Department Access + - Manager Access + - Guest Access **Component** + - Login page + - Admin page + - Invoices page + - Reports page -As seen above in the use case, a [Role][acl-role] is defined as who needs to access a particular [Component][acl-component] i.e. an area of the application. A [Component][acl-component] is defined as the area of the application that needs to be accessed. -Using the [Phalcon\Acl][acl-acl] component, we can tie those two together, and strengthen the security of our application, allowing only specific roles to be bound to specific components. +In this example, a [Role][acl-role] indicates who needs access to a specific [Component][acl-component]. A [Component][acl-component] represents an area of the application. +Using the [Phalcon\Acl][acl-acl] component, you can establish associations between these [Roles][acl-role] and [Components][acl-component], enhancing the application's security by allowing only specific roles to access designated components. ## Activation -[Phalcon\Acl][acl-acl] uses adapters to store and work with roles and components. The only adapter available right now is [Phalcon\Acl\Adapter\Memory][acl-adapter-memory]. Having the adapter use the memory, significantly increases the speed that the ACL is accessed but also comes with drawbacks. The main drawback is that memory is not persistent, so the developer will need to implement a storing strategy for the ACL data, so that the ACL is not generated at every request. This could easily lead to delays and unnecessary processing, especially if the ACL is quite big and/or stored in a database or file system. +[Phalcon\Acl][acl-acl] relies on adapters to manage roles and components. Presently, the only available adapter is [Phalcon\Acl\Adapter\Memory][acl-adapter-memory]. While using the memory adapter significantly enhances ACL access speed, it comes with the trade-off of non-persistent memory. Therefore, developers need to implement a storage strategy for ACL data to avoid regenerating the ACL at every request. This is particularly crucial for large ACLs stored in a database or file system. -The [Phalcon\Acl][acl-acl] constructor takes as its first parameter an adapter used to retrieve the information related to the control list. +The [Phalcon\Acl][acl-acl] constructor takes an adapter as its first parameter for retrieving information related to the control list. ```php setDefaultAction(Enum::ALLOW); ``` ## Constants -The [Phalcon\Acl\Enum][acl-enum] class offers two constants that can be used when defining access levels. +The [Phalcon\Acl\Enum][acl-enum] class provides two constants for defining access levels: - `Phalcon\Acl\Enum::ALLOW` (`1`) -- `Phalcon\Acl\Enum::DENY` (`0` - default) +- `Phalcon\Acl\Enum::DENY` (`0` – default) -You can use these constants to define access levels for your ACL. +These constants help specify access levels within your ACL. ## Adding Roles -As mentioned above, a [Phalcon\Acl\Role][acl-role] is an object that can or cannot access a set of [Component][acl-component] in the access list. +[Phalcon\Acl\Roles][acl-role] represent objects that can or cannot access a set of [Components][acl-component] in the ACL. There are two methods for adding roles: -There are two ways of adding roles to our list. -* by using a [Phalcon\Acl\Role][acl-role] object or -* using a string, representing the name of the role +* Using a [Phalcon\Acl\Role][acl-role] object +* Using a string, representing the role name -To see this in action, using the example outlined above, we will add the relevant [Phalcon\Acl\Role][acl-role] objects in our list. +In the example below, roles related to the outlined use case are added to the ACL: -Role objects. The first parameter is the name of the role, the second the description +Using [Phalcon\Acl\Role][acl-role] objects: ```php addRole($roleAdmins); $acl->addRole($roleAccounting); ``` -Strings. Add the role with just the name directly to the ACL: +Using strings: ```php addRole('guest'); ``` ## Adding Components -A [Component][acl-component] is the area of the application where access is controlled. In an MVC application, this would be a Controller. Although not mandatory, the [Phalcon\Acl\Component][acl-component] class can be used to define components in the application. Also, it is important to add related actions to a component so that the ACL can understand what it should control. +A [Component][acl-component] in the context of Phalcon\Acl represents an area of the application where access is controlled. In an MVC application, this typically corresponds to a Controller. Although it is not mandatory, you can use the [Phalcon\Acl\Component][acl-component] class to define components in the application. It is important to add related actions to a component so that the ACL understands what it should control. -There are two ways of adding components to our list. -* by using a [Phalcon\Acl\Component][acl-component] object or -* using a string, representing the name of the role +There are two ways to add components to our list: -Similar to the `addRole`, `addComponent` requires a name for the component and an optional description. +* By using a [Phalcon\Acl\Component][acl-component] object. +* Using a string, representing the name of the component. -Component objects. The first parameter is the name of the component, the second the description +Similar to the `addRole` method, the addComponent method requires a name for the component and an optional description. + +### Component objects: ```php addComponent( ); ``` -Strings. Add the component with just the name directly to the ACL: +### Strings: ```php addComponent( ``` ## Defining Access Controls -After both the `Roles` and `Components` have been defined, we need to tie them together so that the access list can be created. This is the most important step in the role since a small mistake here can allow access to roles for components that the developer does not intend to. As mentioned earlier, the default access action for [Phalcon\Acl][acl-acl] is `Phalcon\Acl\Enum::DENY`, following the [white list][whitelist] approach. +After defining both the `Roles` and `Components`, the next step is to tie them together to create the access list. This is a critical step, as a small mistake here can inadvertently allow access to roles for components that the developer did not intend to. As mentioned earlier, the default access action for [Phalcon\Acl][acl-acl] is `Phalcon\Acl\Enum::DENY`, following the [whitelist][whitelist] approach. + +To associate Roles and Components, you use the `allow()` and `deny()` methods provided by the [Phalcon\Acl\Memory][acl-adapter-memory] class. -To tie `Roles` and `Components` together we use the `allow()` and `deny()` methods exposed by the [Phalcon\Acl\Memory][acl-adapter-memory] class. +**Example:** ```php addRole('manager'); $acl->addRole('accounting'); $acl->addRole('guest'); - $acl->addComponent( 'admin', [ @@ -214,56 +227,29 @@ $acl->allow('accounting', 'reports', '*'); $acl->allow('*', 'session', '*'); ``` -What the above lines tell us: +In the above example: -```php -$acl->allow('manager', 'admin', 'users'); -``` - -For the `manager` role, allow access to the `admin` component and `users` action. To bring this into perspective with an MVC application, the above line says that the group `manager` is allowed to access the `admin` controller and `users` action. - -```php -$acl->allow('manager', 'reports', ['list', 'add']); -``` - -You can also pass an array as the `action` parameter when invoking the `allow()` command. The above means that for the `manager` role, allow access to the `reports` component and `list` and `add` actions. Again to bring this into perspective with an MVC application, the above line says that the group `manager` is allowed to access the `reports` controller and `list` and `add` actions. +* `$acl->allow('manager', 'admin', 'dashboard');`: For the `manager` role, allow access to the `admin` component and `dashboard` action. In MVC terms, this allows the `manager` role to access the `admin` controller and `dashboard` action. +* `$acl->allow('manager', 'reports', ['list', 'add']);`: You can pass an array as the `action` parameter when invoking the `allow()` method. This line means that for the `manager` role, allow access to the `reports` component and `list` and `add` actions. In MVC terms, this allows the `manager` role to access the `reports` controller and `list` and `add` actions. +* `$acl->allow('*', 'session', '*');`: Wildcards can be used for mass matching roles, components, or actions. This line allows every role to access every action in the `session` component. +* `$acl->allow('*', '*', 'view');`: This line gives access to the `view` action to every role. In MVC terms, it allows any role to access any controller that exposes a `viewAction`. +* `$acl->deny('guest', '*', 'view');`: For the `guest` role, deny access to all components with the `view` action. Despite the default access level being `Acl\Enum::DENY`, this line specifically denies the `view` action to all roles and components. It ensures that the `guest` role only has access to the `session` component and the `login` and `logout` actions since guests are not logged into the application. +* `$acl->allow('*', '*', 'view');`: This line gives access to the `view` action to every role. However, the following line excludes the `guest` role from that access: ```php -$acl->allow('*', 'session', '*'); -``` - -Wildcards can also be used to do mass matching for roles, components or actions. In the above example, we allow every role to access every action in the `session` component. This command will give access to the `manager`, `accounting` and `guest` roles, access to the `session` component and to the `login` and `logout` actions. - -```php -$acl->allow('*', '*', 'view'); +$acl->deny('guest', '*', 'view'); ``` -Similarly, the above gives access to any role, any component that has the `view` action. In an MVC application, the above is the equivalent of allowing any group to access any controller that exposes a `viewAction`. - !!! danger "NOTE" Please be **VERY** careful when using the `*` wildcard. It is very easy to make a mistake and the wildcard, although it seems convenient, it may allow users to access areas of your application that they are not supposed to. The best way to be 100% sure is to write tests specifically to test the permissions and the ACL. These can be done in the `unit` test suite by instantiating the component and then checking the `isAllowed()` if it is `true` or `false`. There are plenty of tests in our GitHub repository (`tests` folder) to offer guidance and ideas. -```php -$acl->deny('guest', '*', 'view'); -``` - -For the `guest` role, we deny access to all components with the `view` action. Despite the fact that the default access level is `Acl\Enum::DENY` in our example above, we specifically allowed the `view` action to all roles and components. This includes the `guest` role. We want to allow the `guest` role access only to the `session` component and the `login` and `logout` actions, since `guests` are not logged into our application. - -```php -$acl->allow('*', '*', 'view'); -``` - -This gives access to the `view` access to everyone, but we want the `guest` role to be excluded from that so the following line does what we need. - -```php -$acl->deny('guest', '*', 'view'); -``` - ## Querying -Once the list has been defined, we can query it to check if a particular role has access to a particular component and action. To do so, we need to use the `isAllowed()` method. +Once the list is defined, you can query it to check if a particular role has access to a specific component and action using the isAllowed() method. + +**Example:** ```php addRole('manager'); -$acl->addRole('accounting'); -$acl->addRole('guest'); +// (Roles and Components setup...) -// Add components -$acl->addComponent( - 'admin', - [ - 'dashboard', - 'users', - 'view', - ] -); - -$acl->addComponent( - 'reports', - [ - 'list', - 'add', - 'view', - ] -); - -$acl->addComponent( - 'session', - [ - 'login', - 'logout', - ] -); - -// Set up the `allow` list -$acl->allow('manager', 'admin', 'users'); -$acl->allow('manager', 'reports', ['list', 'add']); -$acl->allow('*', 'session', '*'); -$acl->allow('*', '*', 'view'); - -// Set up the `deny` list -$acl->deny('guest', '*', 'view'); - -// .... - -// `true` - defined explicitly -$acl->isAllowed('manager', 'admin', 'dashboard'); - -// `true` - defined with wildcard -$acl->isAllowed('manager', 'session', 'login'); - -// `true` - defined with wildcard -$acl->isAllowed('accounting', 'reports', 'view'); - -// `false` - defined explicitly -$acl->isAllowed('guest', 'reports', 'view'); - -// `false` - default access level -$acl->isAllowed('guest', 'reports', 'add'); +// Check permissions +$acl->isAllowed('manager', 'admin', 'dashboard'); // true – explicitly defined +$acl->isAllowed('manager', 'session', 'login'); // true – defined with wildcard +$acl->isAllowed('accounting', 'reports', 'view'); // true – defined with wildcard +$acl->isAllowed('guest', 'reports', 'view'); // false – explicitly defined +$acl->isAllowed('guest', 'reports', 'add'); // false – default access level ``` -## Function Based Access -Depending on the needs of your application, you might need another layer of calculations to allow or deny access to users through the ACL. The method `isAllowed()` accepts a 4th parameter which is a callable such as an anonymous function. +In the above example, the `isAllowed()` method checks whether a role has permission to access a specific component and action. It returns `true` if access is allowed, and `false` otherwise. This method is valuable for implementing role-based access control in your application. + +## Function-Based Access +Depending on the needs of your application, you might require an additional layer +of calculations to allow or deny access to users through the ACL. The `isAllowed()` +method in Phalcon's ACL accepts a fourth parameter, which is a `callable` such as +an anonymous function. To take advantage of this functionality, you need to define +your function when calling the `allow()` method for the role and component you need. +For example, assume you need to allow access to all `manager` roles to the +`admin` component except if their name is 'Bob.' To achieve this, you register +an anonymous function that checks this condition. -To take advantage of this functionality, you will need to define your function when calling the `allow()` method for the role and component you need. Assume that we need to allow access to all `manager` roles to the `admin` component except if their name is 'Bob' (Poor Bob!). To achieve this we will register an anonymous function that will check this condition. +**Example:** ```php addComponent( ] ); -// Set access level for role into components with custom function +// Set access level for `role` into `components` with a custom function $acl->allow( 'manager', 'admin', @@ -371,7 +317,9 @@ $acl->allow( ); ``` -Now that the callable is defined in the ACL, we will need to call the `isAllowed()` method with an array as the fourth parameter: +Now that the callable is defined in the ACL, you need to call the `isAllowed()` method with an array as the fourth parameter: + +**Example:** ```php addComponent( ] ); -// Set access level for role into components with custom function +// Set access level for `role` into `components` with a custom function $acl->allow( 'manager', 'admin', @@ -428,9 +376,11 @@ $acl->isAllowed( !!! info "NOTE" - The fourth parameter must be an array. Each array element represents a parameter that your anonymous function accepts. The key of the element is the name of the parameter, while the value is what will be passed as the value of that the parameter of to the function. + The fourth parameter must be an array. Each array element represents a parameter that your anonymous function accepts. The key of the element is the name of the parameter, while the value is what will be passed as the value of that parameter to the function. -You can also omit to pass the fourth parameter to `isAllowed()` if you wish. The default action for a call to `isAllowed()` without the last parameter is `Acl\Enum::DENY`. To change this behavior, you can make a call to `setNoArgumentsDefaultAction()`: +You can also omit to pass the fourth parameter to `isAllowed()` if you wish. The default action for a call to `isAllowed()` without the last parameter is `Acl\Enum::DENY`. To change this behavior, you can make a call to `setNoArgumentsDefaultAction()`: + +**Example:** ```php addComponent( ] ); -// Set access level for role into components with custom function +// Set access level for `role` into `components` with a custom function $acl->allow( 'manager', 'admin', @@ -479,19 +429,19 @@ $acl->isAllowed('manager', 'admin', 'dashboard'); ## Custom Objects Phalcon allows developers to define their own role and component objects. These objects must implement the supplied interfaces: -* [Phalcon\Acl\RoleAwareInterface][acl-roleawareinterface] for Role -* [Phalcon\Acl\ComponentAwareInterface][acl-componentawareinterface] for Component +* [Phalcon\Acl\RoleAwareInterface][acl-roleaware] for Role +* [Phalcon\Acl\ComponentAwareInterface][acl-componentaware] for Component ### Role -We can implement the [Phalcon\Acl\RoleAwareInterface][acl-roleawareinterface] in our custom class with its own logic. The example below shows a new role object called `ManagerRole`: +You can implement the [Phalcon\Acl\RoleAwareInterface][acl-roleaware] in your custom class with its own logic. The example below shows a new role object called `ManagerRole`: ```php id = $id; + $this->id = $id; $this->roleName = $roleName; } @@ -517,15 +467,15 @@ class ManagerRole implements RoleAware ``` ### Component -We can implement the [Phalcon\Acl\ComponentAware][acl-componentaware] in our custom class with its own logic. The example below shows a new role object called `ReportsComponent`: +You can implement the [Phalcon\Acl\ComponentAwareInterface][acl-componentaware] in your custom class with its own logic. The example below shows a new role object called `ReportsComponent`: ```php id = $id; + $this->id = $id; $this->componentName = $componentName; - $this->userId = $userId; + $this->userId = $userId; } public function getId() @@ -559,7 +509,7 @@ class ReportsComponent implements ComponentAware ``` ### ACL -These objects can now be used in our ACL. +These objects can now be used in your ACL. ```php allow( 'manager', 'reports', 'list', - function (ManagerRole $manager, ModelComponent $model) { + function (ManagerRole $manager, ReportsComponent $model) { return boolval($manager->getId() === $model->getUserId()); } ); @@ -602,8 +552,8 @@ $levelOne = new ManagerRole(1, 'manager-1'); $levelTwo = new ManagerRole(2, 'manager'); $admin = new ManagerRole(3, 'manager'); -// id - name - userId -$reports = new ModelComponent(2, 'reports', 2); +// id – name – userId +$reports = new ReportsComponent(2, 'reports', 2); // Check whether our user objects have access. Returns `false` $acl->isAllowed($levelOne, $reports, 'list'); @@ -615,10 +565,12 @@ $acl->isAllowed($levelTwo, $reports, 'list'); $acl->isAllowed($admin, $reports, 'list'); ``` -The second call for `$levelTwo` evaluates `true` since the `getUserId()` returns `2` which in turn is evaluated in our custom function. Also note that in the custom function for `allow()` the objects are automatically bound, providing all the data necessary for the custom function to work. The custom function can accept any number of additional parameters. The order of the parameters defined in the `function()` constructor does not matter, because the objects will be automatically discovered and bound. +The second call for `$levelTwo` evaluates `true` since the `getUserId()` returns `2` which in turn is evaluated in our custom function. Also, note that in the custom function for `allow()`, the objects are automatically bound, providing all the data necessary for the custom function to work. The custom function can accept any number of additional parameters. The order of the parameters defined in the `function()` constructor does not matter because the objects will be automatically discovered and bound. ## Roles Inheritance -To remove duplication and increase efficiency in your application, the ACL offers inheritance in roles. This means that you can define one [Phalcon\Acl\Role][acl-role] as a base and after that inherit from it offering access to supersets or subsets of components. To use role inheritance, you need, you need to pass the inherited role as the second parameter of the method call, when adding that role in the list. +To remove duplication and increase efficiency in your application, the ACL offers inheritance in roles. This means that you can define one [Phalcon\Acl\Role][acl-role] as a base and then inherit from it, offering access to supersets or subsets of components. To use role inheritance, you need to pass the inherited role as the second parameter of the method call when adding that role to the list. + +**Example:** ```php addRole($guest); -// Add the `accounting` inheriting from `guest` +// Add the `accounting` role inheriting from `guest` $acl->addRole($accounting, $guest); -// Add the `manager` inheriting from `accounting` +// Add the `manager` role inheriting from `accounting` $acl->addRole($manager, $accounting); ``` -Whatever access `guests` have will be propagated to `accounting` and in turn `accounting` will be propagated to `manager`. You can also pass an array of roles as the second parameter of `addRole` offering more flexibility. +Whatever access `guests` have will be propagated to `accounting`, and in turn, `accounting` will be propagated to `manager`. You can also pass an array of roles as the second parameter of `addRole`, offering more flexibility. ## Roles Relationships -Based on the application design, you might prefer to add first all the roles and then define the relationship between them. +Based on the application design, you might prefer to add all the roles first and then define the relationships between them. + +**Example:** ```php addInherit($accounting, $guest); ``` ## Serialization -[Phalcon\Acl][acl-acl] can be serialized and stored in a cache system to improve efficiency. You can store the serialized object in APC, session, file system, database, Redis etc. This way you can retrieve the ACL quickly without having to read the underlying data that create the ACL nor will you have to compute the ACL in every request. +[Phalcon\Acl][acl-acl] can be serialized and stored in a cache system to improve efficiency. You can store the serialized object in APC, session, the file system, database, Redis, etc. This way, you can retrieve the ACL quickly without having to read the underlying data that creates the ACL, nor will you have to compute the ACL in every request. + +**Example:** ```php addInherit($accounting, $guest); use Phalcon\Acl\Adapter\Memory; $aclFile = 'app/security/acl.cache'; + // Check whether ACL data already exist -if (true !== is_file($aclFile)) { - - // The ACL does not exist - build it +if (!is_file($aclFile)) { + // The ACL does not exist – build it $acl = new Memory(); // Define roles, components, access, etc. @@ -702,14 +658,14 @@ if (true !== is_file($aclFile)) { } // Use the ACL list as needed -if (true === $acl->isAllowed('manager', 'admin', 'dashboard')) { +if ($acl->isAllowed('manager', 'admin', 'dashboard')) { echo 'Access granted!'; } else { echo 'Access denied :('; } ``` -It is a good practice to not use serialization of the ACL during development, to ensure that your ACL is rebuilt with every request, while other adapters or means of serializing and storing the ACL in production. +It is a good practice to not use serialization of the ACL during development to ensure that your ACL is rebuilt with every request, while other adapters or means of serializing and storing the ACL in production. ## Events [Phalcon\Acl][acl-acl] can work in conjunction with the [Events Manager][events] if present, to fire events to your application. Events are triggered using the type `acl`. Events that return `false` can stop the active role. The following events are available: @@ -719,7 +675,7 @@ It is a good practice to not use serialization of the ACL during development, to | `afterCheckAccess` | Triggered after checking if a role/component has access | No | | `beforeCheckAccess` | Triggered before checking if a role/component has access | Yes | -The following example demonstrates how to attach listeners to the ACL: +**Example:** ```php setEventsManager($eventsManager); ``` ## Exceptions -Any exceptions thrown in the `Phalcon\Acl` namespace will be of type [Phalcon\Acl\Exception][acl-exception]. You can use this exception to selectively catch exceptions thrown only from this component. +Any exceptions thrown in the [Phalcon\Acl][acl-acl] namespace will be of type [Phalcon\Acl\Exception][acl-exception]. You can use this exception to selectively catch exceptions thrown only from this component. + +**Example:** ```php 'my-prefix', - 'lifetime' => 3600, -]; - -$factory = new AdapterFactory(); -$apcu = $factory->newInstance('apcu', $options); -``` - -### `load` -The [Phalcon\Annotations\AnnotationsFactory][annotations-annotationsfactory] also offers the `load` method, which accepts a configuration object. This object can be an array or a [Phalcon\Config\Config][config] object, with directives that are used to set up the adapter. The object requires the `adapter` element, as well as the `options` element with the necessary directives. - -```php - 'apcu', - 'options' => [ - 'prefix' => 'my-prefix', - 'lifetime' => 3600, - ] -]; - -$factory = new AdapterFactory(); -$apcu = $factory->load($options); -``` - -## Reading Annotations -A reflector is implemented to easily get the annotations defined on a class using an object-oriented interface. [Phalcon\Annotations\Reader][annotations-reader] is used along with [Phalcon\Annotations\Reflection][annotations-reflection]. They also utilize the collection [Phalcon\Annotations\Collection][annotations-collection] that contains [Phalcon\Annotations\Annotation][annotations-annotation] objects once the annotations are parsed. - -```php -get('Invoices'); -$annotations = $reflector->getClassAnnotations(); - -foreach ($annotations as $annotation) { - echo $annotation->getName(), PHP_EOL; - echo $annotation->numberArguments(), PHP_EOL; - - print_r($annotation->getArguments()); -} -``` -In the above example we first create the memory annotations adapter. We then call `get` on it to load the annotations from the `Invoices` class. The `getClassAnnotations` will return a [Phalcon\Annotations\Collection][annotations-collection] class. We iterate through the collection and print out the name (`getName`), the number arguments (`numberArguments`) and then we print all the arguments (`getArguments`) on screen. - -The annotation reading process is very fast, however, for performance reasons it is recommended to store the parsed annotations using an adapter to reduce unnecessary CPU cycles for parsing. +[Phalcon\Annotations\Adapter\AdapterInterface][annotations-adapter-adapterinterface] is available ## Exceptions Any exceptions thrown in the `Phalcon\Annotations` namespace will be of type [Phalcon\Annotations\Exception][annotations-exception]. You can use these exceptions to selectively catch exceptions thrown only from this component. @@ -367,12 +276,10 @@ class IndexController extends Controller ``` ## Examples +### Controller-based Access +You can use annotations to define which areas are controlled by the ACL. This can be achieved by registering a plugin in the events manager listening to the `beforeExecuteRoute` event, or simply by implementing the method in your base controller. -**Controller based access** - -You can use annotations to define which areas are controlled by the ACL. We can do this by registering a plugin in the events manager listening to the `beforeExceuteRoute` event, or simply implement the method in our base controller. - -First we need to set the annotations manager in our DI container: +First, set the annotations manager in your DI container: ```php set( } ); ``` - -and now in the base controller we implement the `beforeExceuteRoute` method: +Now, in the base controller, implement the `beforeExecuteRoute` method: ```php getControllerClass(); @@ -434,11 +340,11 @@ class BaseController extends Controller ->has('Private') ; - if (true !== $exists) { + if (!$exists) { return true; } - if (true === $this->auth->isLoggedIn()) { + if ($this->auth->isLoggedIn()) { return true; } @@ -453,12 +359,7 @@ class BaseController extends Controller } } ``` - -!!! info "NOTE" - - You can also implement the above to a listener and use the `beforeDispatch` event if you wish. - -and in our controllers we can specify: +In your controllers, specify: ```php set( 'annotations', @@ -504,7 +404,7 @@ $container->set( ); ``` -and now in the base controller we implement the `beforeExceuteRoute` method: +Now, in the base controller, implement the `beforeExecuteRoute` method: ```php getControllerClass(); - $actionName = $dispatcher->getActionName() - . 'Action'; + $actionName = $dispatcher->getActionName() . 'Action'; $data = $this ->annotations @@ -554,7 +453,7 @@ class BaseController extends Controller $allowed = array_intersect($userGroups, $aclGroups); $allowed = (count($allowed) > 0); - if (true === $allowed) { + if ($allowed) { return true; } @@ -569,8 +468,7 @@ class BaseController extends Controller } } ``` - -and in our controllers: +In your controllers: ```php Interface Phalcon\Acl\Adapter\AdapterInterface +## Acl\Adapter\AdapterInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/Adapter/AdapterInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/Adapter/AdapterInterface.zep) -| Namespace | Phalcon\Acl\Adapter | -| Uses | Phalcon\Acl\ComponentInterface, Phalcon\Acl\RoleInterface | +- __Namespace__ + + - `Phalcon\Acl\Adapter` + +- __Uses__ + + - `Phalcon\Acl\ComponentInterface` + - `Phalcon\Acl\RoleInterface` + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Acl adapters -## Methods +### Methods ```php public function addComponent( mixed $componentValue, mixed $accessList ): bool; @@ -263,13 +269,34 @@ accessKey -

Class Phalcon\Acl\Adapter\Memory

+## Acl\Adapter\Memory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/Adapter/Memory.zep) + + +- __Namespace__ + + - `Phalcon\Acl\Adapter` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/Adapter/Memory.zep) +- __Uses__ + + - `Phalcon\Acl\Component` + - `Phalcon\Acl\ComponentAwareInterface` + - `Phalcon\Acl\ComponentInterface` + - `Phalcon\Acl\Enum` + - `Phalcon\Acl\Exception` + - `Phalcon\Acl\Role` + - `Phalcon\Acl\RoleAwareInterface` + - `Phalcon\Acl\RoleInterface` + - `ReflectionClass` + - `ReflectionFunction` -| Namespace | Phalcon\Acl\Adapter | -| Uses | Phalcon\Acl\Enum, Phalcon\Acl\Role, Phalcon\Acl\RoleInterface, Phalcon\Acl\Component, Phalcon\Acl\Exception, Phalcon\Acl\RoleAwareInterface, Phalcon\Acl\ComponentAwareInterface, Phalcon\Acl\ComponentInterface, ReflectionClass, ReflectionFunction | -| Extends | AbstractAdapter | +- __Extends__ + + `AbstractAdapter` + +- __Implements__ + Manages ACL lists in memory @@ -334,88 +361,88 @@ foreach ($privateComponents as $component => $actions) { ``` -## Properties +### Properties ```php /** * Access * * @var mixed */ -protected access; +protected $access; /** * Access List * * @var mixed */ -protected accessList; +protected $accessList; /** * Returns the latest function used to acquire access * * @var mixed */ -protected activeFunction; +protected $activeFunction; /** * Returns number of additional arguments(excluding role and resource) for active function * * @var int */ -protected activeFunctionCustomArgumentsCount = 0; +protected $activeFunctionCustomArgumentsCount = ; /** * Returns the latest key used to acquire access * * @var string|null */ -protected activeKey; +protected $activeKey; /** * Components * * @var mixed */ -protected components; +protected $components; /** * Component Names * * @var mixed */ -protected componentsNames; +protected $componentsNames; /** * Function List * * @var mixed */ -protected func; +protected $func; /** * Default action for no arguments is `allow` * * @var mixed */ -protected noArgumentsDefaultAction; +protected $noArgumentsDefaultAction; /** * Roles * * @var mixed */ -protected roles; +protected $roles; /** * Role Inherits * * @var mixed */ -protected roleInherits; +protected $roleInherits; ``` -## Methods +### Methods ```php public function __construct(); @@ -510,6 +537,7 @@ $acl->allow("*", "products", "browse"); // Allow access to any role to browse on any component $acl->allow("*", "*", "browse"); +``` ```php @@ -619,35 +647,47 @@ accessKey -

Class Phalcon\Acl\Component

+## Acl\Component + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/Component.zep) + + +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/Component.zep) +- __Extends__ + -| Namespace | Phalcon\Acl | -| Implements | ComponentInterface | +- __Implements__ + + - `ComponentInterface` This class defines component entity and its description -## Properties +### Properties ```php /** * Component description * * @var string */ -private description; +private $description; /** * Component name * * @var string */ -private name; +private $name; ``` -## Methods +### Methods ```php public function __construct( string $name, string $description = null ); @@ -675,16 +715,28 @@ public function getName(): string; -

Interface Phalcon\Acl\ComponentAwareInterface

+## Acl\ComponentAwareInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/ComponentAwareInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/ComponentAwareInterface.zep) -| Namespace | Phalcon\Acl | +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for classes which could be used in allow method as RESOURCE -## Methods +### Methods ```php public function getComponentName(): string; @@ -694,16 +746,28 @@ Returns component name -

Interface Phalcon\Acl\ComponentInterface

+## Acl\ComponentInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/ComponentInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/ComponentInterface.zep) -| Namespace | Phalcon\Acl | + +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Acl\Component -## Methods +### Methods ```php public function __toString(): string; @@ -725,62 +789,98 @@ Returns the component name -

Class Phalcon\Acl\Enum

+## Acl\Enum + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/Enum.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/Enum.zep) +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + -| Namespace | Phalcon\Acl | +- __Extends__ + + +- __Implements__ + Constants for Phalcon\Acl\Adapter adapters -## Constants +### Constants ```php const ALLOW = 1; const DENY = 0; ``` -

Class Phalcon\Acl\Exception

+## Acl\Exception -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/Exception.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/Exception.zep) -| Namespace | Phalcon\Acl | -| Extends | \Exception | + +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Class for exceptions thrown by Phalcon\Acl -

Class Phalcon\Acl\Role

+## Acl\Role + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/Role.zep) + + +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/Role.zep) +- __Extends__ + -| Namespace | Phalcon\Acl | -| Implements | RoleInterface | +- __Implements__ + + - `RoleInterface` This class defines role entity and its description -## Properties +### Properties ```php /** * Role description * * @var string */ -private description; +private $description; /** * Role name * * @var string */ -private name; +private $name; ``` -## Methods +### Methods ```php public function __construct( string $name, string $description = null ); @@ -808,16 +908,28 @@ public function getName(): string; -

Interface Phalcon\Acl\RoleAwareInterface

+## Acl\RoleAwareInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/RoleAwareInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/RoleAwareInterface.zep) -| Namespace | Phalcon\Acl | +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for classes which could be used in allow method as ROLE -## Methods +### Methods ```php public function getRoleName(): string; @@ -827,16 +939,28 @@ Returns role name -

Interface Phalcon\Acl\RoleInterface

+## Acl\RoleInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Acl/RoleInterface.zep) + + +- __Namespace__ + + - `Phalcon\Acl` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Acl/RoleInterface.zep) +- __Extends__ + -| Namespace | Phalcon\Acl | +- __Implements__ + Interface for Phalcon\Acl\Role -## Methods +### Methods ```php public function __toString(): string; @@ -854,3 +978,5 @@ Returns role description public function getName(): string; ``` Returns the role name + + diff --git a/docs/api/phalcon_annotations.md b/docs/api/phalcon_annotations.md index 74c8fc623..f6a038969 100644 --- a/docs/api/phalcon_annotations.md +++ b/docs/api/phalcon_annotations.md @@ -1,43 +1,56 @@ +--- +hide: + - navigation +--- -* [Phalcon\Annotations\Adapter\AbstractAdapter](#annotations-adapter-abstractadapter) -* [Phalcon\Annotations\Adapter\AdapterInterface](#annotations-adapter-adapterinterface) -* [Phalcon\Annotations\Adapter\Apcu](#annotations-adapter-apcu) -* [Phalcon\Annotations\Adapter\Memory](#annotations-adapter-memory) -* [Phalcon\Annotations\Adapter\Stream](#annotations-adapter-stream) -* [Phalcon\Annotations\Annotation](#annotations-annotation) -* [Phalcon\Annotations\AnnotationsFactory](#annotations-annotationsfactory) -* [Phalcon\Annotations\Collection](#annotations-collection) -* [Phalcon\Annotations\Exception](#annotations-exception) -* [Phalcon\Annotations\Reader](#annotations-reader) -* [Phalcon\Annotations\ReaderInterface](#annotations-readerinterface) -* [Phalcon\Annotations\Reflection](#annotations-reflection) +!!! info "NOTE" -

Abstract Class Phalcon\Annotations\Adapter\AbstractAdapter

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Adapter/AbstractAdapter.zep) -| Namespace | Phalcon\Annotations\Adapter | -| Uses | Phalcon\Annotations\Reader, Phalcon\Annotations\Exception, Phalcon\Annotations\Collection, Phalcon\Annotations\Reflection, Phalcon\Annotations\ReaderInterface | -| Implements | AdapterInterface | + +## Annotations\Adapter\AbstractAdapter ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Adapter/AbstractAdapter.zep) + + +- __Namespace__ + + - `Phalcon\Annotations\Adapter` + +- __Uses__ + + - `Phalcon\Annotations\Collection` + - `Phalcon\Annotations\Exception` + - `Phalcon\Annotations\Reader` + - `Phalcon\Annotations\ReaderInterface` + - `Phalcon\Annotations\Reflection` + +- __Extends__ + + +- __Implements__ + + - `AdapterInterface` This is the base class for Phalcon\Annotations adapters -## Properties +### Properties ```php /** * @var array */ -protected annotations; +protected $annotations; /** * @var Reader */ -protected reader; +protected $reader; ``` -## Methods +### Methods ```php public function get( mixed $className ): Reflection; @@ -95,17 +108,31 @@ Sets the annotations parser -

Interface Phalcon\Annotations\Adapter\AdapterInterface

+## Annotations\Adapter\AdapterInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Adapter/AdapterInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Adapter/AdapterInterface.zep) -| Namespace | Phalcon\Annotations\Adapter | -| Uses | Phalcon\Annotations\Reflection, Phalcon\Annotations\Collection, Phalcon\Annotations\ReaderInterface | +- __Namespace__ + + - `Phalcon\Annotations\Adapter` + +- __Uses__ + + - `Phalcon\Annotations\Collection` + - `Phalcon\Annotations\ReaderInterface` + - `Phalcon\Annotations\Reflection` + +- __Extends__ + + +- __Implements__ + This interface must be implemented by adapters in Phalcon\Annotations -## Methods +### Methods ```php public function get( string $className ): Reflection; @@ -163,13 +190,25 @@ Sets the annotations parser -

Class Phalcon\Annotations\Adapter\Apcu

+## Annotations\Adapter\Apcu + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Adapter/Apcu.zep) + + +- __Namespace__ + + - `Phalcon\Annotations\Adapter` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Adapter/Apcu.zep) +- __Uses__ + + - `Phalcon\Annotations\Reflection` -| Namespace | Phalcon\Annotations\Adapter | -| Uses | Phalcon\Annotations\Reflection | -| Extends | AbstractAdapter | +- __Extends__ + + `AbstractAdapter` + +- __Implements__ + Stores the parsed annotations in APCu. This adapter is suitable for production @@ -180,21 +219,21 @@ $annotations = new Apcu(); ``` -## Properties +### Properties ```php /** * @var string */ -protected prefix = ; +protected $prefix = ; /** * @var int */ -protected ttl = 172800; +protected $ttl = 172800; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -216,28 +255,40 @@ Writes parsed annotations to APCu -

Class Phalcon\Annotations\Adapter\Memory

+## Annotations\Adapter\Memory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Adapter/Memory.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Adapter/Memory.zep) + - `Phalcon\Annotations\Adapter` -| Namespace | Phalcon\Annotations\Adapter | -| Uses | Phalcon\Annotations\Reflection | -| Extends | AbstractAdapter | +- __Uses__ + + - `Phalcon\Annotations\Reflection` + +- __Extends__ + + `AbstractAdapter` + +- __Implements__ + Stores the parsed annotations in memory. This adapter is the suitable development/testing -## Properties +### Properties ```php /** * @var mixed */ -protected data; +protected $data; ``` -## Methods +### Methods ```php public function read( string $key ): Reflection | bool; @@ -253,13 +304,27 @@ Writes parsed annotations to memory -

Class Phalcon\Annotations\Adapter\Stream

+## Annotations\Adapter\Stream + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Adapter/Stream.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Adapter/Stream.zep) +- __Namespace__ -| Namespace | Phalcon\Annotations\Adapter | -| Uses | Phalcon\Annotations\Reflection, Phalcon\Annotations\Exception, RuntimeException | -| Extends | AbstractAdapter | + - `Phalcon\Annotations\Adapter` + +- __Uses__ + + - `Phalcon\Annotations\Exception` + - `Phalcon\Annotations\Reflection` + - `RuntimeException` + +- __Extends__ + + `AbstractAdapter` + +- __Implements__ + Stores the parsed annotations in files. This adapter is suitable for production @@ -274,16 +339,16 @@ $annotations = new Stream( ``` -## Properties +### Properties ```php /** * @var string */ -protected annotationsDir = ./; +protected $annotationsDir = ./; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -305,41 +370,53 @@ Writes parsed annotations to files -

Class Phalcon\Annotations\Annotation

+## Annotations\Annotation + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Annotation.zep) + + +- __Namespace__ + + - `Phalcon\Annotations` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Annotation.zep) +- __Extends__ + -| Namespace | Phalcon\Annotations | +- __Implements__ + Represents a single annotation in an annotations collection -## Properties +### Properties ```php /** * Annotation Arguments * * @var array */ -protected arguments; +protected $arguments; /** * Annotation ExprArguments * * @var array */ -protected exprArguments; +protected $exprArguments; /** * Annotation Name * * @var string|null */ -protected name; +protected $name; ``` -## Methods +### Methods ```php public function __construct( array $reflectionData ); @@ -403,18 +480,32 @@ Returns the number of arguments that the annotation has -

Class Phalcon\Annotations\AnnotationsFactory

+## Annotations\AnnotationsFactory -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/AnnotationsFactory.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/AnnotationsFactory.zep) -| Namespace | Phalcon\Annotations | -| Uses | Phalcon\Annotations\Adapter\AdapterInterface, Phalcon\Factory\AbstractFactory, Phalcon\Support\Helper\Arr\Get | -| Extends | AbstractFactory | + +- __Namespace__ + + - `Phalcon\Annotations` + +- __Uses__ + + - `Phalcon\Annotations\Adapter\AdapterInterface` + - `Phalcon\Factory\AbstractFactory` + - `Phalcon\Support\Helper\Arr\Get` + +- __Extends__ + + `AbstractFactory` + +- __Implements__ + Factory to create annotations components -## Methods +### Methods ```php public function __construct( array $services = [] ); @@ -448,13 +539,27 @@ Returns the available adapters -

Class Phalcon\Annotations\Collection

+## Annotations\Collection + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Collection.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Collection.zep) + - `Phalcon\Annotations` -| Namespace | Phalcon\Annotations | -| Uses | Countable, Iterator | -| Implements | Iterator, Countable | +- __Uses__ + + - `Countable` + - `Iterator` + +- __Extends__ + + +- __Implements__ + + - `Countable` + - `Iterator` Represents a collection of annotations. This class allows to traverse a group of annotations easily @@ -473,21 +578,21 @@ $annotation = $classAnnotations->get("Cacheable"); ``` -## Properties +### Properties ```php /** * @var array */ -protected annotations; +protected $annotations; /** * @var int */ -protected position = 0; +protected $position = ; ``` -## Methods +### Methods ```php public function __construct( array $reflectionData = [] ); @@ -557,29 +662,53 @@ Check if the current annotation in the iterator is valid -

Class Phalcon\Annotations\Exception

+## Annotations\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Exception.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Exception.zep) +- __Namespace__ -| Namespace | Phalcon\Annotations | -| Extends | \Exception | + - `Phalcon\Annotations` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Class for exceptions thrown by Phalcon\Annotations -

Class Phalcon\Annotations\Reader

+## Annotations\Reader + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Reader.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Reader.zep) -| Namespace | Phalcon\Annotations | -| Uses | ReflectionClass | -| Implements | ReaderInterface | +- __Namespace__ + + - `Phalcon\Annotations` + +- __Uses__ + + - `ReflectionClass` + +- __Extends__ + + +- __Implements__ + + - `ReaderInterface` Parses docblocks returning an array with the found annotations -## Methods +### Methods ```php public function parse( string $className ): array; @@ -595,16 +724,28 @@ Parses a raw doc block returning the annotations found -

Interface Phalcon\Annotations\ReaderInterface

+## Annotations\ReaderInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/ReaderInterface.zep) + + +- __Namespace__ + + - `Phalcon\Annotations` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/ReaderInterface.zep) +- __Uses__ + -| Namespace | Phalcon\Annotations | +- __Extends__ + + +- __Implements__ + Parses docblocks returning an array with the found annotations -## Methods +### Methods ```php public function parse( string $className ): array; @@ -620,11 +761,23 @@ Parses a raw docblock returning the annotations found -

Class Phalcon\Annotations\Reflection

+## Annotations\Reflection + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Annotations/Reflection.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Annotations/Reflection.zep) + - `Phalcon\Annotations` -| Namespace | Phalcon\Annotations | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Allows to manipulate the annotations reflection in an OO manner @@ -644,36 +797,36 @@ $classAnnotations = $reflection->getClassAnnotations(); ``` -## Properties +### Properties ```php /** * @var Collection|null */ -protected classAnnotations; +protected $classAnnotations; /** * @var array */ -protected constantAnnotations; +protected $constantAnnotations; /** * @var array */ -protected propertyAnnotations; +protected $propertyAnnotations; /** * @var array */ -protected methodAnnotations; +protected $methodAnnotations; /** * @var array */ -protected reflectionData; +protected $reflectionData; ``` -## Methods +### Methods ```php public function __construct( array $reflectionData = [] ); @@ -710,3 +863,5 @@ public function getReflectionData(): array; ``` Returns the raw parsing intermediate definitions used to construct the reflection + + diff --git a/docs/api/phalcon_application.md b/docs/api/phalcon_application.md index ef067b568..0fa9de862 100644 --- a/docs/api/phalcon_application.md +++ b/docs/api/phalcon_application.md @@ -1,44 +1,66 @@ +--- +hide: + - navigation +--- -* [Phalcon\Application\AbstractApplication](#application-abstractapplication) -* [Phalcon\Application\Exception](#application-exception) +!!! info "NOTE" -

Abstract Class Phalcon\Application\AbstractApplication

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Application/AbstractApplication.zep) -| Namespace | Phalcon\Application | -| Uses | Phalcon\Di\DiInterface, Phalcon\Di\Injectable, Phalcon\Events\EventsAwareInterface, Phalcon\Events\ManagerInterface | -| Extends | Injectable | -| Implements | EventsAwareInterface | + +## Application\AbstractApplication ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Application/AbstractApplication.zep) + + +- __Namespace__ + + - `Phalcon\Application` + +- __Uses__ + + - `Phalcon\Di\DiInterface` + - `Phalcon\Di\Injectable` + - `Phalcon\Events\EventsAwareInterface` + - `Phalcon\Events\ManagerInterface` + +- __Extends__ + + `Injectable` + +- __Implements__ + + - `EventsAwareInterface` Base class for Phalcon\Cli\Console and Phalcon\Mvc\Application. -## Properties +### Properties ```php /** * @var DiInterface|null */ -protected container; +protected $container; /** * @var string */ -protected defaultModule = ""; +protected $defaultModule = ; /** * @var ManagerInterface|null */ -protected eventsManager; +protected $eventsManager; /** * @var array */ -protected modules; +protected $modules; ``` -## Methods +### Methods ```php public function __construct( DiInterface $container = null ); @@ -105,11 +127,24 @@ Sets the events manager -

Class Phalcon\Application\Exception

+## Application\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Application/Exception.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Application/Exception.zep) + - `Phalcon\Application` -| Namespace | Phalcon\Application | -| Extends | \Exception | +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Application class will use this class + diff --git a/docs/api/phalcon_assets.md b/docs/api/phalcon_assets.md index f326a6388..ba536bfb5 100644 --- a/docs/api/phalcon_assets.md +++ b/docs/api/phalcon_assets.md @@ -1,25 +1,32 @@ +--- +hide: + - navigation +--- -* [Phalcon\Assets\Asset](#assets-asset) -* [Phalcon\Assets\Asset\Css](#assets-asset-css) -* [Phalcon\Assets\Asset\Js](#assets-asset-js) -* [Phalcon\Assets\AssetInterface](#assets-assetinterface) -* [Phalcon\Assets\Collection](#assets-collection) -* [Phalcon\Assets\Exception](#assets-exception) -* [Phalcon\Assets\FilterInterface](#assets-filterinterface) -* [Phalcon\Assets\Filters\CssMin](#assets-filters-cssmin) -* [Phalcon\Assets\Filters\JsMin](#assets-filters-jsmin) -* [Phalcon\Assets\Filters\None](#assets-filters-none) -* [Phalcon\Assets\Inline](#assets-inline) -* [Phalcon\Assets\Inline\Css](#assets-inline-css) -* [Phalcon\Assets\Inline\Js](#assets-inline-js) -* [Phalcon\Assets\Manager](#assets-manager) +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Assets\Asset -

Class Phalcon\Assets\Asset

+[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Asset.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Asset.zep) -| Namespace | Phalcon\Assets | -| Implements | AssetInterface | +- __Namespace__ + + - `Phalcon\Assets` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `AssetInterface` Represents an asset @@ -28,63 +35,63 @@ $asset = new \Phalcon\Assets\Asset("js", "js/jquery.js"); ``` -## Properties +### Properties ```php /** * @var array */ -protected attributes; +protected $attributes; /** * @var bool */ -protected isAutoVersion = false; +protected $isAutoVersion = false; /** * @var bool */ -protected filter; +protected $filter; /** * @var bool */ -protected isLocal; +protected $isLocal; /** * @var string */ -protected path; +protected $path; /** * @var string */ -protected sourcePath; +protected $sourcePath; /** * @var string */ -protected targetPath; +protected $targetPath; /** * @var string */ -protected targetUri; +protected $targetUri; /** * @var string */ -protected type; +protected $type; /** * Version of resource * * @var string|null */ -protected version; +protected $version; ``` -## Methods +### Methods ```php public function __construct( string $type, string $path, bool $isLocal = bool, bool $filter = bool, array $attributes = [], string $version = null, bool $isAutoVersion = bool ); @@ -257,18 +264,30 @@ protected function phpFileGetContents( string $filename ); -

Class Phalcon\Assets\Asset\Css

+## Assets\Asset\Css + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Asset/Css.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Asset/Css.zep) -| Namespace | Phalcon\Assets\Asset | -| Uses | Phalcon\Assets\Asset | -| Extends | AssetBase | +- __Namespace__ + + - `Phalcon\Assets\Asset` + +- __Uses__ + + - `Phalcon\Assets\Asset` + +- __Extends__ + + `AssetBase` + +- __Implements__ + Represents CSS assets -## Methods +### Methods ```php public function __construct( string $path, bool $local = bool, bool $filter = bool, array $attributes = [], string $version = null, bool $autoVersion = bool ); @@ -278,18 +297,30 @@ Phalcon\Assets\Asset\Css constructor -

Class Phalcon\Assets\Asset\Js

+## Assets\Asset\Js + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Asset/Js.zep) + + +- __Namespace__ + + - `Phalcon\Assets\Asset` + +- __Uses__ + + - `Phalcon\Assets\Asset` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Asset/Js.zep) +- __Extends__ + + `AssetBase` -| Namespace | Phalcon\Assets\Asset | -| Uses | Phalcon\Assets\Asset | -| Extends | AssetBase | +- __Implements__ + Represents JavaScript assets -## Methods +### Methods ```php public function __construct( string $path, bool $local = bool, bool $filter = bool, array $attributes = [], string $version = null, bool $autoVersion = bool ); @@ -299,16 +330,28 @@ Phalcon\Assets\Asset\Js constructor -

Interface Phalcon\Assets\AssetInterface

+## Assets\AssetInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/AssetInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/AssetInterface.zep) -| Namespace | Phalcon\Assets | + +- __Namespace__ + + - `Phalcon\Assets` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for custom Phalcon\Assets resources -## Methods +### Methods ```php public function getAssetKey(): string; @@ -354,89 +397,104 @@ Sets the asset's type. -

Class Phalcon\Assets\Collection

+## Assets\Collection + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Collection.zep) + + +- __Namespace__ + + - `Phalcon\Assets` + +- __Uses__ + + - `ArrayIterator` + - `Countable` + - `IteratorAggregate` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Collection.zep) +- __Extends__ + -| Namespace | Phalcon\Assets | -| Uses | ArrayIterator, Countable, IteratorAggregate | -| Implements | Countable, IteratorAggregate | +- __Implements__ + + - `Countable` + - `IteratorAggregate` Collection of asset objects -## Properties +### Properties ```php /** * @var array */ -protected assets; +protected $assets; /** * @var array */ -protected attributes; +protected $attributes; /** * Should version be determined from file modification time * * @var bool */ -protected autoVersion = false; +protected $autoVersion = false; /** * @var array */ -protected codes; +protected $codes; /** * @var array */ -protected filters; +protected $filters; /** * @var bool */ -protected isLocal = true; +protected $isLocal = true; /** * @var bool */ -protected join = true; +protected $join = true; /** * @var string */ -protected prefix = ; +protected $prefix = ; /** * @var string */ -protected sourcePath = ; +protected $sourcePath = ; /** * @var bool */ -protected targetIsLocal = true; +protected $targetIsLocal = true; /** * @var string */ -protected targetPath = ; +protected $targetPath = ; /** * @var string */ -protected targetUri = ; +protected $targetUri = ; /** * @var string */ -protected version = ; +protected $version = ; ``` -## Methods +### Methods ```php public function add( AssetInterface $asset ): Collection; @@ -672,27 +730,51 @@ Adds an asset or inline-code to the collection -

Class Phalcon\Assets\Exception

+## Assets\Exception -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Exception.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Exception.zep) -| Namespace | Phalcon\Assets | -| Extends | \Exception | + +- __Namespace__ + + - `Phalcon\Assets` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Assets will use this class -

Interface Phalcon\Assets\FilterInterface

+## Assets\FilterInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/FilterInterface.zep) + + +- __Namespace__ + + - `Phalcon\Assets` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/FilterInterface.zep) +- __Uses__ + -| Namespace | Phalcon\Assets | +- __Extends__ + + +- __Implements__ + Interface for custom Phalcon\Assets filters -## Methods +### Methods ```php public function filter( string $content ): string; @@ -702,71 +784,105 @@ Filters the content returning a string with the filtered content -

Class Phalcon\Assets\Filters\Cssmin

+## Assets\Filters\Cssmin + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Filters/CssMin.zep) + + +- __Namespace__ + + - `Phalcon\Assets\Filters` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Filters/CssMin.zep) +- __Uses__ + + - `Phalcon\Assets\FilterInterface` -| Namespace | Phalcon\Assets\Filters | -| Uses | Phalcon\Assets\FilterInterface | -| Implements | FilterInterface | +- __Extends__ + + +- __Implements__ + + - `FilterInterface` Minify the CSS - removes comments removes newlines and line feeds keeping removes last semicolon from last property -## Methods +### Methods ```php public function filter( string $content ): string; ``` Filters the content using CSSMIN -!!! info "NOTE" +> NOTE: This functionality is not currently available +{: .alert .alert-info } + + + - This functionality is not currently available +## Assets\Filters\Jsmin +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Filters/JsMin.zep) +- __Namespace__ -

Class Phalcon\Assets\Filters\Jsmin

+ - `Phalcon\Assets\Filters` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Filters/JsMin.zep) +- __Uses__ + + - `Phalcon\Assets\FilterInterface` -| Namespace | Phalcon\Assets\Filters | -| Uses | Phalcon\Assets\FilterInterface | -| Implements | FilterInterface | +- __Extends__ + + +- __Implements__ + + - `FilterInterface` Deletes the characters which are insignificant to JavaScript. Comments will be removed. Tabs will be replaced with spaces. Carriage returns will be replaced with linefeeds. Most spaces and linefeeds will be removed. -## Methods +### Methods ```php public function filter( string $content ): string; ``` Filters the content using JSMIN -!!! info "NOTE" +> NOTE: This functionality is not currently available +{: .alert .alert-info } + + + - This functionality is not currently available +## Assets\Filters\None +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Filters/None.zep) +- __Namespace__ -

Class Phalcon\Assets\Filters\None

+ - `Phalcon\Assets\Filters` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Filters/None.zep) +- __Uses__ + + - `Phalcon\Assets\FilterInterface` -| Namespace | Phalcon\Assets\Filters | -| Uses | Phalcon\Assets\FilterInterface | -| Implements | FilterInterface | +- __Extends__ + + +- __Implements__ + + - `FilterInterface` Returns the content without make any modification to the original source -## Methods +### Methods ```php public function filter( string $content ): string; @@ -776,12 +892,24 @@ Returns the content as is -

Class Phalcon\Assets\Inline

+## Assets\Inline + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Inline.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Inline.zep) + - `Phalcon\Assets` -| Namespace | Phalcon\Assets | -| Implements | AssetInterface | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `AssetInterface` Represents an inline asset @@ -790,31 +918,31 @@ $inline = new \Phalcon\Assets\Inline("js", "alert('hello world');"); ``` -## Properties +### Properties ```php /** * @var array */ -protected attributes; +protected $attributes; /** * @var string */ -protected content; +protected $content; /** * @var bool */ -protected filter; +protected $filter; /** * @var string */ -protected type; +protected $type; ``` -## Methods +### Methods ```php public function __construct( string $type, string $content, bool $filter = bool, array $attributes = [] ); @@ -872,18 +1000,30 @@ Sets the inline's type -

Class Phalcon\Assets\Inline\Css

+## Assets\Inline\Css + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Inline/Css.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Inline/Css.zep) + - `Phalcon\Assets\Inline` -| Namespace | Phalcon\Assets\Inline | -| Uses | Phalcon\Assets\Inline | -| Extends | InlineBase | +- __Uses__ + + - `Phalcon\Assets\Inline` + +- __Extends__ + + `InlineBase` + +- __Implements__ + Represents an inlined CSS -## Methods +### Methods ```php public function __construct( string $content, bool $filter = bool, array $attributes = [] ); @@ -893,18 +1033,30 @@ Phalcon\Assets\Inline\Css constructor -

Class Phalcon\Assets\Inline\Js

+## Assets\Inline\Js + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Inline/Js.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Inline/Js.zep) + - `Phalcon\Assets\Inline` -| Namespace | Phalcon\Assets\Inline | -| Uses | Phalcon\Assets\Inline | -| Extends | InlineBase | +- __Uses__ + + - `Phalcon\Assets\Inline` + +- __Extends__ + + `InlineBase` + +- __Implements__ + Represents an inline JavaScript -## Methods +### Methods ```php public function __construct( string $content, bool $filter = bool, array $attributes = [] ); @@ -914,42 +1066,62 @@ Phalcon\Assets\Inline\Js constructor -

Class Phalcon\Assets\Manager

+## Assets\Manager + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Assets/Manager.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Assets/Manager.zep) + - `Phalcon\Assets` -| Namespace | Phalcon\Assets | -| Uses | Phalcon\Assets\Asset\Css, Phalcon\Assets\Asset\Js, Phalcon\Assets\Inline\Css, Phalcon\Assets\Inline\Js, Phalcon\Di\AbstractInjectionAware, Phalcon\Html\Helper\Element, Phalcon\Html\Helper\Link, Phalcon\Html\Helper\Script, Phalcon\Html\TagFactory | -| Extends | AbstractInjectionAware | +- __Uses__ + + - `Phalcon\Assets\Asset\Css` + - `Phalcon\Assets\Asset\Js` + - `Phalcon\Assets\Inline\Css` + - `Phalcon\Assets\Inline\Js` + - `Phalcon\Di\AbstractInjectionAware` + - `Phalcon\Html\Helper\Element` + - `Phalcon\Html\Helper\Link` + - `Phalcon\Html\Helper\Script` + - `Phalcon\Html\TagFactory` + +- __Extends__ + + `AbstractInjectionAware` + +- __Implements__ + Manages collections of CSS/JavaScript assets -## Properties +### Properties ```php /** * @var array */ -protected collections; +protected $collections; /** * @var bool */ -protected implicitOutput = true; +protected $implicitOutput = true; /** * @var array */ -protected options; +protected $options; /** * @var TagFactory */ -protected tagFactory; +protected $tagFactory; ``` -## Methods +### Methods ```php public function __construct( TagFactory $tagFactory, array $options = [] ); @@ -1138,3 +1310,5 @@ Sets the manager options public function useImplicitOutput( bool $implicitOutput ): Manager; ``` Sets if the HTML generated must be directly printed or returned + + diff --git a/docs/api/phalcon_autoload.md b/docs/api/phalcon_autoload.md index a9490b19c..f85140fd0 100644 --- a/docs/api/phalcon_autoload.md +++ b/docs/api/phalcon_autoload.md @@ -1,91 +1,122 @@ +--- +hide: + - navigation +--- -* [Phalcon\Autoload\Exception](#autoload-exception) -* [Phalcon\Autoload\Loader](#autoload-loader) +!!! info "NOTE" -

Class Phalcon\Autoload\Exception

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Autoload/Exception.zep) -| Namespace | Phalcon\Autoload | -| Extends | \Exception | + +## Autoload\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Autoload/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Autoload` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Autoload will use this class -

Class Phalcon\Autoload\Loader

+## Autoload\Loader -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Autoload/Loader.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Autoload/Loader.zep) -| Namespace | Phalcon\Autoload | -| Uses | Phalcon\Events\AbstractEventsAware | -| Extends | AbstractEventsAware | + +- __Namespace__ + + - `Phalcon\Autoload` + +- __Uses__ + + - `Phalcon\Events\AbstractEventsAware` + +- __Extends__ + + `AbstractEventsAware` + +- __Implements__ + The Phalcon Autoloader provides an easy way to automatically load classes (namespaced or not) as well as files. It also features extension loading, allowing the user to autoload files with different extensions than .php. -## Properties +### Properties ```php /** * @var string|null */ -protected checkedPath; +protected $checkedPath; /** * @var array */ -protected classes; +protected $classes; /** * @var array */ -protected debug; +protected $debug; /** * @var array */ -protected directories; +protected $directories; /** * @var array */ -protected extensions; +protected $extensions; /** * @var string|callable */ -protected fileCheckingCallback = is_file; +protected $fileCheckingCallback = is_file; /** * @var array */ -protected files; +protected $files; /** * @var string|null */ -protected foundPath; +protected $foundPath; /** * @var bool */ -protected isDebug = false; +protected $isDebug = false; /** * @var bool */ -protected isRegistered = false; +protected $isRegistered = false; /** * @var array */ -protected namespaces; +protected $namespaces; ``` -## Methods +### Methods ```php public function __construct( bool $isDebug = bool ); @@ -255,3 +286,5 @@ Unregister the autoload method protected function requireFile( string $file ): bool; ``` If the file exists, require it and return true; false otherwise + + diff --git a/docs/api/phalcon_cache.md b/docs/api/phalcon_cache.md index 901b26ac7..bdc9f508b 100644 --- a/docs/api/phalcon_cache.md +++ b/docs/api/phalcon_cache.md @@ -1,42 +1,62 @@ +--- +hide: + - navigation +--- -* [Phalcon\Cache\AbstractCache](#cache-abstractcache) -* [Phalcon\Cache\Adapter\AdapterInterface](#cache-adapter-adapterinterface) -* [Phalcon\Cache\Adapter\Apcu](#cache-adapter-apcu) -* [Phalcon\Cache\Adapter\Libmemcached](#cache-adapter-libmemcached) -* [Phalcon\Cache\Adapter\Memory](#cache-adapter-memory) -* [Phalcon\Cache\Adapter\Redis](#cache-adapter-redis) -* [Phalcon\Cache\Adapter\Stream](#cache-adapter-stream) -* [Phalcon\Cache\Adapter\Weak](#cache-adapter-weak) -* [Phalcon\Cache\AdapterFactory](#cache-adapterfactory) -* [Phalcon\Cache\Cache](#cache-cache) -* [Phalcon\Cache\CacheFactory](#cache-cachefactory) -* [Phalcon\Cache\CacheInterface](#cache-cacheinterface) -* [Phalcon\Cache\Exception\Exception](#cache-exception-exception) -* [Phalcon\Cache\Exception\InvalidArgumentException](#cache-exception-invalidargumentexception) - -

Abstract Class Phalcon\Cache\AbstractCache

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/AbstractCache.zep) - -| Namespace | Phalcon\Cache | -| Uses | DateInterval, Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Cache\Exception\InvalidArgumentException, Traversable | -| Implements | CacheInterface | +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Cache\AbstractCache ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/AbstractCache.zep) + + +- __Namespace__ + + - `Phalcon\Cache` + +- __Uses__ + + - `DateInterval` + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Cache\Exception\InvalidArgumentException` + - `Phalcon\Events\EventsAwareInterface` + - `Phalcon\Events\ManagerInterface` + - `Traversable` + +- __Extends__ + + +- __Implements__ + + - `CacheInterface` + - `EventsAwareInterface` This component offers caching capabilities for your application. -## Properties +### Properties ```php /** * The adapter * * @var AdapterInterface */ -protected adapter; +protected $adapter; + +/** + * Event Manager + * + * @var ManagerInterface|null + */ +protected $eventsManager; ``` -## Methods +### Methods ```php public function __construct( AdapterInterface $adapter ); @@ -50,6 +70,18 @@ public function getAdapter(): AdapterInterface; Returns the current adapter +```php +public function getEventsManager(): ManagerInterface | null; +``` +Get the event manager + + +```php +public function setEventsManager( ManagerInterface $eventsManager ): void; +``` +Sets the event manager + + ```php protected function checkKey( string $key ): void; ``` @@ -81,13 +113,13 @@ Deletes multiple cache items in a single operation. ```php -protected function doGet( string $key, mixed $defaultValue = null ); +protected function doGet( string $key, mixed $defaultValue = null ): mixed; ``` Fetches a value from the cache. ```php -protected function doGetMultiple( mixed $keys, mixed $defaultValue = null ); +protected function doGetMultiple( mixed $keys, mixed $defaultValue = null ): array; ``` Obtains multiple cache items by their unique keys. @@ -111,6 +143,12 @@ protected function doSetMultiple( mixed $values, mixed $ttl = null ): bool; Persists a set of key => value pairs in the cache, with an optional TTL. +```php +protected function fire( string $eventName, mixed $keys ): void; +``` +Trigger an event for the eventsManager. + + ```php abstract protected function getExceptionClass(): string; ``` @@ -119,117 +157,264 @@ Returns the exception class that will be used for exceptions thrown -

Interface Phalcon\Cache\Adapter\AdapterInterface

+## Cache\Adapter\AdapterInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/AdapterInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/AdapterInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Storage\Adapter\AdapterInterface | -| Extends | StorageAdapterInterface | + - `Phalcon\Cache\Adapter` + +- __Uses__ + + - `Phalcon\Storage\Adapter\AdapterInterface` + +- __Extends__ + + `StorageAdapterInterface` + +- __Implements__ + Interface for Phalcon\Cache adapters -

Class Phalcon\Cache\Adapter\Apcu

+## Cache\Adapter\Apcu + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/Apcu.zep) + + +- __Namespace__ + + - `Phalcon\Cache\Adapter` + +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Storage\Adapter\Apcu` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/Apcu.zep) +- __Extends__ + + `StorageApcu` -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Storage\Adapter\Apcu | -| Extends | StorageApcu | -| Implements | CacheAdapterInterface | +- __Implements__ + + - `CacheAdapterInterface` Apcu adapter +### Properties +```php +// +protected $eventType = 'cache'; + +``` + + +## Cache\Adapter\Libmemcached + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/Libmemcached.zep) + -

Class Phalcon\Cache\Adapter\Libmemcached

+- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/Libmemcached.zep) + - `Phalcon\Cache\Adapter` -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Storage\Adapter\Libmemcached | -| Extends | StorageLibmemcached | -| Implements | CacheAdapterInterface | +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Storage\Adapter\Libmemcached` + +- __Extends__ + + `StorageLibmemcached` + +- __Implements__ + + - `CacheAdapterInterface` Libmemcached adapter +### Properties +```php +// +protected $eventType = 'cache'; + +``` + + +## Cache\Adapter\Memory -

Class Phalcon\Cache\Adapter\Memory

+[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/Memory.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/Memory.zep) -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Storage\Adapter\Memory | -| Extends | StorageMemory | -| Implements | CacheAdapterInterface | +- __Namespace__ + + - `Phalcon\Cache\Adapter` + +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Storage\Adapter\Memory` + +- __Extends__ + + `StorageMemory` + +- __Implements__ + + - `CacheAdapterInterface` Memory adapter +### Properties +```php +// +protected $eventType = 'cache'; + +``` + + +## Cache\Adapter\Redis + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/Redis.zep) + -

Class Phalcon\Cache\Adapter\Redis

+- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/Redis.zep) + - `Phalcon\Cache\Adapter` -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Storage\Adapter\Redis | -| Extends | StorageRedis | -| Implements | CacheAdapterInterface | +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Storage\Adapter\Redis` + +- __Extends__ + + `StorageRedis` + +- __Implements__ + + - `CacheAdapterInterface` Redis adapter +### Properties +```php +// +protected $eventType = 'cache'; + +``` + + +## Cache\Adapter\Stream + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/Stream.zep) + + +- __Namespace__ + + - `Phalcon\Cache\Adapter` -

Class Phalcon\Cache\Adapter\Stream

+- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Storage\Adapter\Stream` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/Stream.zep) +- __Extends__ + + `StorageStream` -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Storage\Adapter\Stream | -| Extends | StorageStream | -| Implements | CacheAdapterInterface | +- __Implements__ + + - `CacheAdapterInterface` Stream adapter +### Properties +```php +// +protected $eventType = 'cache'; + +``` + + +## Cache\Adapter\Weak + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Adapter/Weak.zep) + -

Class Phalcon\Cache\Adapter\Weak

+- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Adapter/Weak.zep) + - `Phalcon\Cache\Adapter` -| Namespace | Phalcon\Cache\Adapter | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Storage\Adapter\Weak | -| Extends | StorageWeak | -| Implements | CacheAdapterInterface | +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Storage\Adapter\Weak` + +- __Extends__ + + `StorageWeak` + +- __Implements__ + + - `CacheAdapterInterface` * WeakCache implementation based on WeakReference */ +### Properties +```php +// +protected $eventType = 'cache'; + +``` + + +## Cache\AdapterFactory -

Class Phalcon\Cache\AdapterFactory

+[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/AdapterFactory.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/AdapterFactory.zep) -| Namespace | Phalcon\Cache | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Cache\Exception\Exception, Phalcon\Factory\AbstractFactory, Phalcon\Storage\SerializerFactory | -| Extends | AbstractFactory | +- __Namespace__ + + - `Phalcon\Cache` + +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Cache\Exception\Exception` + - `Phalcon\Factory\AbstractFactory` + - `Phalcon\Storage\SerializerFactory` + +- __Extends__ + + `AbstractFactory` + +- __Implements__ + Factory to create Cache adapters -## Properties +### Properties ```php /** * @var SerializerFactory */ -private serializerFactory; +private $serializerFactory; ``` -## Methods +### Methods ```php public function __construct( SerializerFactory $factory, array $services = [] ); @@ -257,18 +442,32 @@ Returns the available adapters -

Class Phalcon\Cache\Cache

+## Cache\Cache + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Cache.zep) + + +- __Namespace__ + + - `Phalcon\Cache` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Cache.zep) +- __Uses__ + + - `DateInterval` + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Cache\Exception\InvalidArgumentException` -| Namespace | Phalcon\Cache | -| Uses | DateInterval, Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Cache\Exception\InvalidArgumentException | -| Extends | AbstractCache | +- __Extends__ + + `AbstractCache` + +- __Implements__ + This component offers caching capabilities for your application. -## Methods +### Methods ```php public function clear(): bool; @@ -327,27 +526,43 @@ Returns the exception class that will be used for exceptions thrown -

Class Phalcon\Cache\CacheFactory

+## Cache\CacheFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/CacheFactory.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/CacheFactory.zep) + - `Phalcon\Cache` -| Namespace | Phalcon\Cache | -| Uses | Phalcon\Cache\Adapter\AdapterInterface, Phalcon\Cache\Cache, Phalcon\Cache\Exception\Exception, Phalcon\Config\ConfigInterface, Phalcon\Factory\AbstractConfigFactory | -| Extends | AbstractConfigFactory | +- __Uses__ + + - `Phalcon\Cache\Adapter\AdapterInterface` + - `Phalcon\Cache\Cache` + - `Phalcon\Cache\Exception\Exception` + - `Phalcon\Config\ConfigInterface` + - `Phalcon\Factory\AbstractConfigFactory` + +- __Extends__ + + `AbstractConfigFactory` + +- __Implements__ + Creates a new Cache class -## Properties +### Properties ```php /** * @var AdapterFactory */ -protected adapterFactory; +protected $adapterFactory; ``` -## Methods +### Methods ```php public function __construct( AdapterFactory $factory ); @@ -375,17 +590,30 @@ protected function getExceptionClass(): string; -

Interface Phalcon\Cache\CacheInterface

+## Cache\CacheInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/CacheInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/CacheInterface.zep) -| Namespace | Phalcon\Cache | -| Uses | DateInterval, Phalcon\Cache\Exception\InvalidArgumentException | +- __Namespace__ + + - `Phalcon\Cache` + +- __Uses__ + + - `DateInterval` + - `Phalcon\Cache\Exception\InvalidArgumentException` + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Cache\Cache -## Methods +### Methods ```php public function clear(): bool; @@ -438,22 +666,46 @@ Persists a set of key => value pairs in the cache, with an optional TTL. -

Class Phalcon\Cache\Exception\Exception

+## Cache\Exception\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Exception/Exception.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Exception/Exception.zep) + - `Phalcon\Cache\Exception` -| Namespace | Phalcon\Cache\Exception | -| Extends | \Exception | +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Cache will use this class -

Class Phalcon\Cache\Exception\InvalidArgumentException

+## Cache\Exception\InvalidArgumentException + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cache/Exception/InvalidArgumentException.zep) + + +- __Namespace__ + + - `Phalcon\Cache\Exception` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cache/Exception/InvalidArgumentException.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\Cache\Exception | -| Extends | \Exception | +- __Implements__ + Exceptions thrown in Phalcon\Cache will use this class diff --git a/docs/api/phalcon_cli.md b/docs/api/phalcon_cli.md index ff6d14311..8aacb900b 100644 --- a/docs/api/phalcon_cli.md +++ b/docs/api/phalcon_cli.md @@ -1,43 +1,56 @@ +--- +hide: + - navigation +--- -* [Phalcon\Cli\Console](#cli-console) -* [Phalcon\Cli\Console\Exception](#cli-console-exception) -* [Phalcon\Cli\Dispatcher](#cli-dispatcher) -* [Phalcon\Cli\Dispatcher\Exception](#cli-dispatcher-exception) -* [Phalcon\Cli\DispatcherInterface](#cli-dispatcherinterface) -* [Phalcon\Cli\Router](#cli-router) -* [Phalcon\Cli\Router\Exception](#cli-router-exception) -* [Phalcon\Cli\Router\Route](#cli-router-route) -* [Phalcon\Cli\Router\RouteInterface](#cli-router-routeinterface) -* [Phalcon\Cli\RouterInterface](#cli-routerinterface) -* [Phalcon\Cli\Task](#cli-task) -* [Phalcon\Cli\TaskInterface](#cli-taskinterface) +!!! info "NOTE" -

Class Phalcon\Cli\Console

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Console.zep) -| Namespace | Phalcon\Cli | -| Uses | Phalcon\Application\AbstractApplication, Phalcon\Cli\Router\Route, Phalcon\Cli\Console\Exception, Phalcon\Di\DiInterface, Phalcon\Events\ManagerInterface | -| Extends | AbstractApplication | + +## Cli\Console + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Console.zep) + + +- __Namespace__ + + - `Phalcon\Cli` + +- __Uses__ + + - `Phalcon\Application\AbstractApplication` + - `Phalcon\Cli\Console\Exception` + - `Phalcon\Cli\Router\Route` + - `Phalcon\Di\DiInterface` + - `Phalcon\Events\ManagerInterface` + +- __Extends__ + + `AbstractApplication` + +- __Implements__ + This component allows to create CLI applications using Phalcon -## Properties +### Properties ```php /** * @var array */ -protected arguments; +protected $arguments; /** * @var array */ -protected options; +protected $options; ``` -## Methods +### Methods ```php public function handle( array $arguments = null ); @@ -53,25 +66,52 @@ Set an specific argument -

Class Phalcon\Cli\Console\Exception

+## Cli\Console\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Console/Exception.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Console/Exception.zep) +- __Namespace__ -| Namespace | Phalcon\Cli\Console | -| Extends | \Phalcon\Application\Exception | + - `Phalcon\Cli\Console` + +- __Uses__ + + +- __Extends__ + + `\Phalcon\Application\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Cli\Console will use this class -

Class Phalcon\Cli\Dispatcher

+## Cli\Dispatcher + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Dispatcher.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Dispatcher.zep) +- __Namespace__ -| Namespace | Phalcon\Cli | -| Uses | Phalcon\Cli\Dispatcher\Exception, Phalcon\Dispatcher\AbstractDispatcher, Phalcon\Events\ManagerInterface, Phalcon\Filter\FilterInterface | -| Extends | CliDispatcher | -| Implements | DispatcherInterface | + - `Phalcon\Cli` + +- __Uses__ + + - `Phalcon\Cli\Dispatcher\Exception` + - `Phalcon\Dispatcher\AbstractDispatcher` + - `Phalcon\Events\ManagerInterface` + - `Phalcon\Filter\FilterInterface` + +- __Extends__ + + `CliDispatcher` + +- __Implements__ + + - `DispatcherInterface` Dispatching is the process of taking the command-line arguments, extracting the module name, task name, action name, and optional parameters contained in @@ -95,29 +135,31 @@ $handle = $dispatcher->dispatch(); ``` -## Properties +### Properties ```php -// -protected defaultHandler = main; +/** + * @var string + */ +protected $defaultHandler = main; /** * @var string */ -protected defaultAction = main; +protected $defaultAction = main; /** * @var string */ -protected handlerSuffix = Task; +protected $handlerSuffix = Task; /** * @var array */ -protected options; +protected $options; ``` -## Methods +### Methods ```php public function callActionMethod( mixed $handler, string $actionMethod, array $params = [] ): mixed; @@ -205,29 +247,53 @@ Throws an internal exception -

Class Phalcon\Cli\Dispatcher\Exception

+## Cli\Dispatcher\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Dispatcher/Exception.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Dispatcher/Exception.zep) + - `Phalcon\Cli\Dispatcher` -| Namespace | Phalcon\Cli\Dispatcher | -| Extends | \Phalcon\Dispatcher\Exception | +- __Uses__ + + +- __Extends__ + + `\Phalcon\Dispatcher\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Cli\Dispatcher will use this class -

Interface Phalcon\Cli\DispatcherInterface

+## Cli\DispatcherInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/DispatcherInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/DispatcherInterface.zep) + - `Phalcon\Cli` -| Namespace | Phalcon\Cli | -| Uses | Phalcon\Dispatcher\DispatcherInterface | -| Extends | DispatcherInterfaceBase | +- __Uses__ + + - `Phalcon\Dispatcher\DispatcherInterface` + +- __Extends__ + + `DispatcherInterfaceBase` + +- __Implements__ + Interface for Phalcon\Cli\Dispatcher -## Methods +### Methods ```php public function getActiveTask(): TaskInterface; @@ -285,13 +351,31 @@ Sets the default task suffix -

Class Phalcon\Cli\Router

+## Cli\Router + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Router.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Router.zep) + - `Phalcon\Cli` -| Namespace | Phalcon\Cli | -| Uses | Phalcon\Di\DiInterface, Phalcon\Di\AbstractInjectionAware, Phalcon\Cli\Router\Route, Phalcon\Cli\Router\Exception, Phalcon\Cli\Router\RouteInterface | -| Extends | AbstractInjectionAware | +- __Uses__ + + - `Phalcon\Cli\RouterInterface` + - `Phalcon\Cli\Router\Exception` + - `Phalcon\Cli\Router\Route` + - `Phalcon\Cli\Router\RouteInterface` + - `Phalcon\Di\AbstractInjectionAware` + - `Phalcon\Di\DiInterface` + +- __Extends__ + + `AbstractInjectionAware` + +- __Implements__ + + - `RouterInterface` Phalcon\Cli\Router is the standard framework router. Routing is the process of taking a command-line arguments and decomposing it into parameters to @@ -313,71 +397,71 @@ echo $router->getTaskName(); ``` -## Properties +### Properties ```php /** - * @var string|null + * @var string */ -protected action; +protected $action = ; /** - * @var string|null + * @var string */ -protected defaultAction; +protected $defaultAction = ; /** * @var string */ -protected defaultModule = ""; +protected $defaultModule = ; /** * @var array */ -protected defaultParams; +protected $defaultParams; /** - * @var string|null + * @var string */ -protected defaultTask; +protected $defaultTask = ; /** * @var RouteInterface|null */ -protected matchedRoute; +protected $matchedRoute; /** * @var array */ -protected matches; +protected $matches; /** * @var string */ -protected module = ""; +protected $module = ; /** * @var array */ -protected params; +protected $params; /** * @var array */ -protected routes; +protected $routes; /** - * @var string|null + * @var string */ -protected task; +protected $task = ; /** * @var bool */ -protected wasMatched = false; +protected $wasMatched = false; ``` -## Methods +### Methods ```php public function __construct( bool $defaultRoutes = bool ); @@ -464,13 +548,13 @@ Handles routing information received from command-line arguments ```php -public function setDefaultAction( string $actionName ); +public function setDefaultAction( string $actionName ): RouterInterface; ``` Sets the default action name ```php -public function setDefaultModule( string $moduleName ); +public function setDefaultModule( string $moduleName ): RouterInterface; ``` Sets the name of the default module @@ -482,7 +566,7 @@ Sets the default controller name ```php -public function setDefaults( array $defaults ): Router; +public function setDefaults( array $defaults ): RouterInterface; ``` Sets an array of default paths. If a route is missing a path the router will use the defined here. This method must not be used to set a 404 @@ -506,92 +590,116 @@ Checks if the router matches any of the defined routes -

Class Phalcon\Cli\Router\Exception

+## Cli\Router\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Router/Exception.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Router/Exception.zep) + - `Phalcon\Cli\Router` -| Namespace | Phalcon\Cli\Router | -| Extends | \Exception | +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Cli\Router will use this class -

Class Phalcon\Cli\Router\Route

+## Cli\Router\Route + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Router/Route.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Router/Route.zep) + - `Phalcon\Cli\Router` -| Namespace | Phalcon\Cli\Router | -| Implements | RouteInterface | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `RouteInterface` This class represents every route added to the router -## Constants +### Constants ```php const DEFAULT_DELIMITER = ; ``` -## Properties +### Properties ```php /** * @var mixed|null */ -protected beforeMatch; +protected $beforeMatch; /** - * @var string|null + * @var string */ -protected compiledPattern; +protected $compiledPattern = ; /** * @var array */ -protected converters; +protected $converters; /** * @var string */ -protected delimiter; +protected $delimiter; /** * @var string */ -protected static delimiterPath; +protected static $delimiterPath; /** - * @var string|null + * @var string */ -protected description; +protected $description = ; /** * @var string */ -protected routeId; +protected $routeId; /** * @var string */ -protected name; +protected $name = ; /** * @var array */ -protected paths; +protected $paths; /** * @var string */ -protected pattern; +protected $pattern = ; /** - * @var int|string + * @var int */ -protected static uniqueId = 0; +protected static $uniqueId = ; ``` -## Methods +### Methods ```php public function __construct( string $pattern, mixed $paths = null ); @@ -728,16 +836,28 @@ $router->add( -

Interface Phalcon\Cli\Router\RouteInterface

+## Cli\Router\RouteInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Router/RouteInterface.zep) + + +- __Namespace__ + + - `Phalcon\Cli\Router` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Router/RouteInterface.zep) +- __Extends__ + -| Namespace | Phalcon\Cli\Router | +- __Implements__ + Interface for Phalcon\Cli\Router\Route -## Methods +### Methods ```php public function compilePattern( string $pattern ): string; @@ -826,17 +946,29 @@ Sets the route's name -

Interface Phalcon\Cli\RouterInterface

+## Cli\RouterInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/RouterInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/RouterInterface.zep) -| Namespace | Phalcon\Cli | -| Uses | Phalcon\Cli\Router\RouteInterface | + +- __Namespace__ + + - `Phalcon\Cli` + +- __Uses__ + + - `Phalcon\Cli\Router\RouteInterface` + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Cli\Router -## Methods +### Methods ```php public function add( string $pattern, mixed $paths = null ): RouteInterface; @@ -882,13 +1014,13 @@ Returns processed extra params ```php -public function getRouteById( mixed $id ): RouteInterface; +public function getRouteById( mixed $id ): RouteInterface | bool; ``` Returns a route object by its id ```php -public function getRouteByName( string $name ): RouteInterface; +public function getRouteByName( string $name ): RouteInterface | bool; ``` Returns a route object by its name @@ -912,13 +1044,13 @@ Handles routing information received from the rewrite engine ```php -public function setDefaultAction( string $actionName ): void; +public function setDefaultAction( string $actionName ): RouterInterface; ``` Sets the default action name ```php -public function setDefaultModule( string $moduleName ): void; +public function setDefaultModule( string $moduleName ): RouterInterface; ``` Sets the name of the default module @@ -930,7 +1062,7 @@ Sets the default task name ```php -public function setDefaults( array $defaults ): void; +public function setDefaults( array $defaults ): RouterInterface; ``` Sets an array of default paths @@ -943,14 +1075,29 @@ Check if the router matches any of the defined routes -

Class Phalcon\Cli\Task

+## Cli\Task + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/Task.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/Task.zep) +- __Namespace__ -| Namespace | Phalcon\Cli | -| Uses | Phalcon\Di\Injectable, Phalcon\Events\EventsAwareInterface, Phalcon\Events\ManagerInterface | -| Extends | Injectable | -| Implements | TaskInterface, EventsAwareInterface | + - `Phalcon\Cli` + +- __Uses__ + + - `Phalcon\Di\Injectable` + - `Phalcon\Events\EventsAwareInterface` + - `Phalcon\Events\ManagerInterface` + +- __Extends__ + + `Injectable` + +- __Implements__ + + - `EventsAwareInterface` + - `TaskInterface` Every command-line task should extend this class that encapsulates all the task functionality @@ -976,16 +1123,16 @@ class HelloTask extends \Phalcon\Cli\Task ``` -## Properties +### Properties ```php /** * @var ManagerInterface */ -protected eventsManager; +protected $eventsManager; ``` -## Methods +### Methods ```php final public function __construct(); @@ -1007,10 +1154,23 @@ Sets the events manager -

Interface Phalcon\Cli\TaskInterface

+## Cli\TaskInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Cli/TaskInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Cli/TaskInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Cli | + - `Phalcon\Cli` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for task handlers + diff --git a/docs/api/phalcon_config.md b/docs/api/phalcon_config.md index b2e84368c..6d2a67cb4 100644 --- a/docs/api/phalcon_config.md +++ b/docs/api/phalcon_config.md @@ -1,21 +1,37 @@ +--- +hide: + - navigation +--- -* [Phalcon\Config\Adapter\Grouped](#config-adapter-grouped) -* [Phalcon\Config\Adapter\Ini](#config-adapter-ini) -* [Phalcon\Config\Adapter\Json](#config-adapter-json) -* [Phalcon\Config\Adapter\Php](#config-adapter-php) -* [Phalcon\Config\Adapter\Yaml](#config-adapter-yaml) -* [Phalcon\Config\Config](#config-config) -* [Phalcon\Config\ConfigFactory](#config-configfactory) -* [Phalcon\Config\ConfigInterface](#config-configinterface) -* [Phalcon\Config\Exception](#config-exception) +!!! info "NOTE" -

Class Phalcon\Config\Adapter\Grouped

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Adapter/Grouped.zep) -| Namespace | Phalcon\Config\Adapter | -| Uses | Phalcon\Config\Config, Phalcon\Config\ConfigFactory, Phalcon\Config\ConfigInterface, Phalcon\Config\Exception, Phalcon\Factory\Exception | -| Extends | Config | + +## Config\Adapter\Grouped + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Adapter/Grouped.zep) + + +- __Namespace__ + + - `Phalcon\Config\Adapter` + +- __Uses__ + + - `Phalcon\Config\Config` + - `Phalcon\Config\ConfigFactory` + - `Phalcon\Config\ConfigInterface` + - `Phalcon\Config\Exception` + - `Phalcon\Factory\Exception` + +- __Extends__ + + `Config` + +- __Implements__ + Reads multiple files (or arrays) and merges them all together. @@ -68,7 +84,7 @@ $config = new Grouped( ``` -## Methods +### Methods ```php public function __construct( array $arrayConfig, string $defaultAdapter = string ); @@ -78,13 +94,27 @@ Phalcon\Config\Adapter\Grouped constructor -

Class Phalcon\Config\Adapter\Ini

+## Config\Adapter\Ini + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Adapter/Ini.zep) + + +- __Namespace__ + + - `Phalcon\Config\Adapter` + +- __Uses__ + + - `Phalcon\Config\Config` + - `Phalcon\Config\Exception` + - `Phalcon\Support\Traits\PhpFileTrait` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Adapter/Ini.zep) +- __Extends__ + + `Config` -| Namespace | Phalcon\Config\Adapter | -| Uses | Phalcon\Config\Config, Phalcon\Config\Exception, Phalcon\Support\Traits\PhpFileTrait | -| Extends | Config | +- __Implements__ + Reads ini files and converts them to Phalcon\Config\Config objects. @@ -128,7 +158,7 @@ $config = new \Phalcon\Config\Adapter\Ini( ``` -## Methods +### Methods ```php public function __construct( string $filePath, int $mode = int ); @@ -137,7 +167,7 @@ Ini constructor. ```php -protected function cast( mixed $ini ): bool | null | double | int | string; +protected function cast( mixed $ini ): mixed; ``` We have to cast values manually because parse_ini_file() has a poor implementation. @@ -163,13 +193,26 @@ protected function phpParseIniFile( string $filename, bool $processSections = bo -

Class Phalcon\Config\Adapter\Json

+## Config\Adapter\Json -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Adapter/Json.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Adapter/Json.zep) -| Namespace | Phalcon\Config\Adapter | -| Uses | Phalcon\Config\Config, Phalcon\Support\Helper\Json\Decode | -| Extends | Config | + +- __Namespace__ + + - `Phalcon\Config\Adapter` + +- __Uses__ + + - `Phalcon\Config\Config` + - `Phalcon\Support\Helper\Json\Decode` + +- __Extends__ + + `Config` + +- __Implements__ + Reads JSON files and converts them to Phalcon\Config\Config objects. @@ -191,7 +234,7 @@ echo $config->models->metadata; ``` -## Methods +### Methods ```php public function __construct( string $filePath ); @@ -201,13 +244,25 @@ Phalcon\Config\Adapter\Json constructor -

Class Phalcon\Config\Adapter\Php

+## Config\Adapter\Php + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Adapter/Php.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Adapter/Php.zep) -| Namespace | Phalcon\Config\Adapter | -| Uses | Phalcon\Config\Config | -| Extends | Config | +- __Namespace__ + + - `Phalcon\Config\Adapter` + +- __Uses__ + + - `Phalcon\Config\Config` + +- __Extends__ + + `Config` + +- __Implements__ + Reads php files and converts them to Phalcon\Config\Config objects. @@ -244,7 +299,7 @@ echo $config->database->username; ``` -## Methods +### Methods ```php public function __construct( string $filePath ); @@ -254,13 +309,26 @@ Phalcon\Config\Adapter\Php constructor -

Class Phalcon\Config\Adapter\Yaml

+## Config\Adapter\Yaml + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Adapter/Yaml.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Adapter/Yaml.zep) +- __Namespace__ -| Namespace | Phalcon\Config\Adapter | -| Uses | Phalcon\Config\Config, Phalcon\Config\Exception | -| Extends | Config | + - `Phalcon\Config\Adapter` + +- __Uses__ + + - `Phalcon\Config\Config` + - `Phalcon\Config\Exception` + +- __Extends__ + + `Config` + +- __Implements__ + Reads YAML files and converts them to Phalcon\Config\Config objects. @@ -299,7 +367,7 @@ echo $config->models->metadata; ``` -## Methods +### Methods ```php public function __construct( string $filePath, array $callbacks = null ); @@ -321,14 +389,26 @@ protected function phpYamlParseFile( mixed $filename, mixed $pos = int, mixed $n -

Class Phalcon\Config\Config

+## Config\Config + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Config.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Config.zep) + - `Phalcon\Config` -| Namespace | Phalcon\Config | -| Uses | Phalcon\Support\Collection | -| Extends | Collection | -| Implements | ConfigInterface | +- __Uses__ + + - `Phalcon\Support\Collection` + +- __Extends__ + + `Collection` + +- __Implements__ + + - `ConfigInterface` `Phalcon\Config` is designed to simplify the access to, and the use of, configuration data within applications. It provides a nested object property @@ -355,21 +435,21 @@ $config = new \Phalcon\Config\Config( ``` -## Constants +### Constants ```php const DEFAULT_PATH_DELIMITER = .; ``` -## Properties +### Properties ```php /** * @var string */ -protected pathDelimiter; +protected $pathDelimiter; ``` -## Methods +### Methods ```php public function getPathDelimiter(): string; @@ -437,13 +517,27 @@ Sets the collection data -

Class Phalcon\Config\ConfigFactory

+## Config\ConfigFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/ConfigFactory.zep) + + +- __Namespace__ + + - `Phalcon\Config` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/ConfigFactory.zep) +- __Uses__ + + - `Phalcon\Config\Config` + - `Phalcon\Config\ConfigInterface` + - `Phalcon\Factory\AbstractFactory` -| Namespace | Phalcon\Config | -| Uses | Phalcon\Config\Config, Phalcon\Config\ConfigInterface, Phalcon\Factory\AbstractFactory | -| Extends | AbstractFactory | +- __Extends__ + + `AbstractFactory` + +- __Implements__ + Loads Config Adapter class using 'adapter' option, if no extension is provided it will be added to filePath @@ -460,7 +554,7 @@ $config = (new ConfigFactory())->load($options); ``` -## Methods +### Methods ```php public function __construct( array $services = [] ); @@ -500,20 +594,32 @@ protected function parseConfig( mixed $config ): array; -

Interface Phalcon\Config\ConfigInterface

+## Config\ConfigInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/ConfigInterface.zep) + + +- __Namespace__ + + - `Phalcon\Config` + +- __Uses__ + + - `Phalcon\Support\Collection\CollectionInterface` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/ConfigInterface.zep) +- __Extends__ + + `CollectionInterface` -| Namespace | Phalcon\Config | -| Uses | Phalcon\Support\Collection\CollectionInterface | -| Extends | CollectionInterface | +- __Implements__ + Phalcon\Config\ConfigInterface Interface for Phalcon\Config\Config class -## Methods +### Methods ```php public function getPathDelimiter(): string; @@ -541,11 +647,24 @@ public function setPathDelimiter( string $delimiter = null ): ConfigInterface; -

Class Phalcon\Config\Exception

+## Config\Exception -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Config/Exception.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Config/Exception.zep) -| Namespace | Phalcon\Config | -| Extends | \Exception | + +- __Namespace__ + + - `Phalcon\Config` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Config will use this class + diff --git a/docs/api/phalcon_datamapper.md b/docs/api/phalcon_datamapper.md index 6651895f3..dc26c6b18 100644 --- a/docs/api/phalcon_datamapper.md +++ b/docs/api/phalcon_datamapper.md @@ -1,48 +1,51 @@ +--- +hide: + - navigation +--- -* [Phalcon\DataMapper\Pdo\Connection](#datamapper-pdo-connection) -* [Phalcon\DataMapper\Pdo\Connection\AbstractConnection](#datamapper-pdo-connection-abstractconnection) -* [Phalcon\DataMapper\Pdo\Connection\ConnectionInterface](#datamapper-pdo-connection-connectioninterface) -* [Phalcon\DataMapper\Pdo\Connection\Decorated](#datamapper-pdo-connection-decorated) -* [Phalcon\DataMapper\Pdo\Connection\PdoInterface](#datamapper-pdo-connection-pdointerface) -* [Phalcon\DataMapper\Pdo\ConnectionLocator](#datamapper-pdo-connectionlocator) -* [Phalcon\DataMapper\Pdo\ConnectionLocatorInterface](#datamapper-pdo-connectionlocatorinterface) -* [Phalcon\DataMapper\Pdo\Exception\CannotDisconnect](#datamapper-pdo-exception-cannotdisconnect) -* [Phalcon\DataMapper\Pdo\Exception\ConnectionNotFound](#datamapper-pdo-exception-connectionnotfound) -* [Phalcon\DataMapper\Pdo\Exception\Exception](#datamapper-pdo-exception-exception) -* [Phalcon\DataMapper\Pdo\Profiler\MemoryLogger](#datamapper-pdo-profiler-memorylogger) -* [Phalcon\DataMapper\Pdo\Profiler\Profiler](#datamapper-pdo-profiler-profiler) -* [Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface](#datamapper-pdo-profiler-profilerinterface) -* [Phalcon\DataMapper\Query\AbstractConditions](#datamapper-query-abstractconditions) -* [Phalcon\DataMapper\Query\AbstractQuery](#datamapper-query-abstractquery) -* [Phalcon\DataMapper\Query\Bind](#datamapper-query-bind) -* [Phalcon\DataMapper\Query\Delete](#datamapper-query-delete) -* [Phalcon\DataMapper\Query\Insert](#datamapper-query-insert) -* [Phalcon\DataMapper\Query\QueryFactory](#datamapper-query-queryfactory) -* [Phalcon\DataMapper\Query\Select](#datamapper-query-select) -* [Phalcon\DataMapper\Query\Update](#datamapper-query-update) - -

Class Phalcon\DataMapper\Pdo\Connection

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Connection.zep) - -| Namespace | Phalcon\DataMapper\Pdo | -| Uses | InvalidArgumentException, Phalcon\DataMapper\Pdo\Connection\AbstractConnection, Phalcon\DataMapper\Pdo\Profiler\Profiler, Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface | -| Extends | AbstractConnection | +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## DataMapper\Pdo\Connection + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Connection.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Pdo` + +- __Uses__ + + - `InvalidArgumentException` + - `Phalcon\DataMapper\Pdo\Connection\AbstractConnection` + - `Phalcon\DataMapper\Pdo\Profiler\Profiler` + - `Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface` + +- __Extends__ + + `AbstractConnection` + +- __Implements__ + Provides array quoting, profiling, a new `perform()` method, new `fetch*()` methods -## Properties +### Properties ```php /** * @var array */ -protected arguments; +protected $arguments; ``` -## Methods +### Methods ```php public function __construct( string $dsn, string $username = null, string $password = null, array $options = [], array $queries = [], ProfilerInterface $profiler = null ); @@ -73,33 +76,47 @@ Disconnects from the database. -

Abstract Class Phalcon\DataMapper\Pdo\Connection\AbstractConnection

+## DataMapper\Pdo\Connection\AbstractConnection ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Connection/AbstractConnection.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Connection` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Connection/AbstractConnection.zep) +- __Uses__ + + - `BadMethodCallException` + - `Phalcon\DataMapper\Pdo\Exception\CannotBindValue` + - `Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface` -| Namespace | Phalcon\DataMapper\Pdo\Connection | -| Uses | BadMethodCallException, Phalcon\DataMapper\Pdo\Exception\CannotBindValue, Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface | -| Implements | ConnectionInterface | +- __Extends__ + + +- __Implements__ + + - `ConnectionInterface` Provides array quoting, profiling, a new `perform()` method, new `fetch*()` methods -## Properties +### Properties ```php /** * @var \PDO */ -protected pdo; +protected $pdo; /** * @var ProfilerInterface */ -protected profiler; +protected $profiler; ``` -## Methods +### Methods ```php public function __call( mixed $name, array $arguments ); @@ -356,19 +373,33 @@ Bind a value using the proper PDO::PARAM_* type. -

Interface Phalcon\DataMapper\Pdo\Connection\ConnectionInterface

+## DataMapper\Pdo\Connection\ConnectionInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Connection/ConnectionInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Connection/ConnectionInterface.zep) + - `Phalcon\DataMapper\Pdo\Connection` -| Namespace | Phalcon\DataMapper\Pdo\Connection | -| Uses | Phalcon\DataMapper\Pdo\Exception\CannotBindValue, Phalcon\DataMapper\Pdo\Parser\ParserInterface, Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface | -| Extends | PdoInterface | +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Exception\CannotBindValue` + - `Phalcon\DataMapper\Pdo\Parser\ParserInterface` + - `Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface` + +- __Extends__ + + `PdoInterface` + +- __Implements__ + Provides array quoting, profiling, a new `perform()` method, new `fetch*()` methods -## Methods +### Methods ```php public function connect(): void; @@ -500,18 +531,32 @@ Sets the Profiler instance. -

Class Phalcon\DataMapper\Pdo\Connection\Decorated

+## DataMapper\Pdo\Connection\Decorated + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Connection/Decorated.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Connection/Decorated.zep) + - `Phalcon\DataMapper\Pdo\Connection` -| Namespace | Phalcon\DataMapper\Pdo\Connection | -| Uses | Phalcon\DataMapper\Pdo\Exception\CannotDisconnect, Phalcon\DataMapper\Pdo\Profiler\Profiler, Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface | -| Extends | AbstractConnection | +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Exception\CannotDisconnect` + - `Phalcon\DataMapper\Pdo\Profiler\Profiler` + - `Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface` + +- __Extends__ + + `AbstractConnection` + +- __Implements__ + Decorates an existing PDO instance with the extended methods. -## Methods +### Methods ```php public function __construct( \PDO $pdo, ProfilerInterface $profiler = null ); @@ -538,16 +583,28 @@ Disconnects from the database; disallowed with decorated PDO connections. -

Interface Phalcon\DataMapper\Pdo\Connection\PdoInterface

+## DataMapper\Pdo\Connection\PdoInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Connection/PdoInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Connection/PdoInterface.zep) +- __Namespace__ -| Namespace | Phalcon\DataMapper\Pdo\Connection | + - `Phalcon\DataMapper\Pdo\Connection` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + An interface to the native PDO object. -## Methods +### Methods ```php public function beginTransaction(): bool; @@ -645,50 +702,63 @@ Set a database connection attribute -

Class Phalcon\DataMapper\Pdo\ConnectionLocator

+## DataMapper\Pdo\ConnectionLocator + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/ConnectionLocator.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/ConnectionLocator.zep) +- __Namespace__ -| Namespace | Phalcon\DataMapper\Pdo | -| Uses | Phalcon\DataMapper\Pdo\Connection\ConnectionInterface, Phalcon\DataMapper\Pdo\Exception\ConnectionNotFound | -| Implements | ConnectionLocatorInterface | + - `Phalcon\DataMapper\Pdo` + +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection\ConnectionInterface` + - `Phalcon\DataMapper\Pdo\Exception\ConnectionNotFound` + +- __Extends__ + + +- __Implements__ + + - `ConnectionLocatorInterface` Manages Connection instances for default, read, and write connections. -## Properties +### Properties ```php /** * A default Connection connection factory/instance. * * @var ConnectionInterface */ -protected master; +protected $master; /** * A registry of Connection "read" factories/instances. * * @var array */ -protected read; +protected $read; /** * A registry of Connection "write" factories/instances. * * @var array */ -protected write; +protected $write; /** * A collection of resolved instances * * @var array */ -private instances; +private $instances; ``` -## Methods +### Methods ```php public function __construct( ConnectionInterface $master, array $read = [], array $write = [] ); @@ -744,17 +814,29 @@ Returns a connection by name. -

Interface Phalcon\DataMapper\Pdo\ConnectionLocatorInterface

+## DataMapper\Pdo\ConnectionLocatorInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/ConnectionLocatorInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/ConnectionLocatorInterface.zep) -| Namespace | Phalcon\DataMapper\Pdo | -| Uses | Phalcon\DataMapper\Pdo\Connection\ConnectionInterface | +- __Namespace__ + + - `Phalcon\DataMapper\Pdo` + +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection\ConnectionInterface` + +- __Extends__ + + +- __Implements__ + Locates PDO connections for default, read, and write databases. -## Methods +### Methods ```php public function getMaster(): ConnectionInterface; @@ -798,61 +880,112 @@ Sets a write connection registry entry by name. -

Class Phalcon\DataMapper\Pdo\Exception\CannotDisconnect

+## DataMapper\Pdo\Exception\CannotDisconnect + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Exception/CannotDisconnect.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Exception/CannotDisconnect.zep) -| Namespace | Phalcon\DataMapper\Pdo\Exception | -| Extends | Exception | +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Exception` + +- __Uses__ + + +- __Extends__ + + `Exception` + +- __Implements__ + ExtendedPdo could not disconnect; e.g., because its PDO connection was created externally and then injected. -

Class Phalcon\DataMapper\Pdo\Exception\ConnectionNotFound

+## DataMapper\Pdo\Exception\ConnectionNotFound + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Exception/ConnectionNotFound.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Exception/ConnectionNotFound.zep) -| Namespace | Phalcon\DataMapper\Pdo\Exception | -| Extends | Exception | +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Exception` + +- __Uses__ + + +- __Extends__ + + `Exception` + +- __Implements__ + Locator could not find a named connection. -

Class Phalcon\DataMapper\Pdo\Exception\Exception

+## DataMapper\Pdo\Exception\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Exception/Exception.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Exception` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Exception/Exception.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\DataMapper\Pdo\Exception | -| Extends | \Exception | +- __Implements__ + Base Exception class -

Class Phalcon\DataMapper\Pdo\Profiler\MemoryLogger

+## DataMapper\Pdo\Profiler\MemoryLogger -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep) -| Namespace | Phalcon\DataMapper\Pdo\Profiler | -| Uses | Phalcon\Logger\Enum, Phalcon\Logger\Adapter\AdapterInterface, Phalcon\Logger\Adapter\Noop, Phalcon\Logger\LoggerInterface | -| Implements | LoggerInterface | + +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Profiler` + +- __Uses__ + + - `Phalcon\Logger\Adapter\AdapterInterface` + - `Phalcon\Logger\Adapter\Noop` + - `Phalcon\Logger\Enum` + - `Phalcon\Logger\LoggerInterface` + +- __Extends__ + + +- __Implements__ + + - `LoggerInterface` A memory-based logger. -## Properties +### Properties ```php /** * @var array */ -protected messages; +protected $messages; ``` -## Methods +### Methods ```php public function alert( string $message, array $context = [] ): void; @@ -940,52 +1073,67 @@ public function warning( string $message, array $context = [] ): void; -

Class Phalcon\DataMapper\Pdo\Profiler\Profiler

+## DataMapper\Pdo\Profiler\Profiler + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Profiler/Profiler.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Profiler` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Profiler/Profiler.zep) +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Exception\Exception` + - `Phalcon\Logger\Enum` + - `Phalcon\Logger\LoggerInterface` + - `Phalcon\Support\Helper\Json\Encode` -| Namespace | Phalcon\DataMapper\Pdo\Profiler | -| Uses | Phalcon\DataMapper\Pdo\Exception\Exception, Phalcon\Logger\Enum, Phalcon\Logger\LoggerInterface, Phalcon\Support\Helper\Json\Encode | -| Implements | ProfilerInterface | +- __Extends__ + + +- __Implements__ + + - `ProfilerInterface` Sends query profiles to a logger. -## Properties +### Properties ```php /** * @var bool */ -protected active = false; +protected $active = false; /** * @var array */ -protected context; +protected $context; /** * @var string */ -protected logFormat = ; +protected $logFormat = ; /** * @var int */ -protected logLevel = 0; +protected $logLevel = ; /** * @var LoggerInterface */ -protected logger; +protected $logger; /** * @var Encode */ -private encode; +private $encode; ``` -## Methods +### Methods ```php public function __construct( LoggerInterface $logger = null ); @@ -1049,17 +1197,29 @@ Starts a profile entry. -

Interface Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface

+## DataMapper\Pdo\Profiler\ProfilerInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Pdo/Profiler/ProfilerInterface.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Pdo\Profiler` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Pdo/Profiler/ProfilerInterface.zep) +- __Uses__ + + - `Phalcon\Logger\LoggerInterface` -| Namespace | Phalcon\DataMapper\Pdo\Profiler | -| Uses | Phalcon\Logger\LoggerInterface | +- __Extends__ + + +- __Implements__ + Interface to send query profiles to a logger. -## Methods +### Methods ```php public function finish( string $statement = null, array $values = [] ): void; @@ -1117,17 +1277,29 @@ Starts a profile entry. -

Abstract Class Phalcon\DataMapper\Query\AbstractConditions

+## DataMapper\Query\AbstractConditions ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/AbstractConditions.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/AbstractConditions.zep) + - `Phalcon\DataMapper\Query` -| Namespace | Phalcon\DataMapper\Query | -| Extends | AbstractQuery | +- __Uses__ + + +- __Extends__ + + `AbstractQuery` + +- __Implements__ + Class AbstractConditions -## Methods +### Methods ```php public function andWhere( string $condition, mixed $value = null, int $type = int ): AbstractConditions; @@ -1233,36 +1405,48 @@ Processes a value (array or string) and merges it with the store -

Abstract Class Phalcon\DataMapper\Query\AbstractQuery

+## DataMapper\Query\AbstractQuery ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/AbstractQuery.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/AbstractQuery.zep) + - `Phalcon\DataMapper\Query` -| Namespace | Phalcon\DataMapper\Query | -| Uses | Phalcon\DataMapper\Pdo\Connection | +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection` + +- __Extends__ + + +- __Implements__ + Class AbstractQuery -## Properties +### Properties ```php /** * @var Bind */ -protected bind; +protected $bind; /** * @var Connection */ -protected connection; +protected $connection; /** * @var array */ -protected store; +protected $store; ``` -## Methods +### Methods ```php public function __construct( Connection $connection, Bind $bind ); @@ -1313,11 +1497,59 @@ Quotes the identifier ```php -public function reset(); +public function reset(): void; ``` Resets the internal array +```php +public function resetColumns(): void; +``` +Resets the columns + + +```php +public function resetFlags(): void; +``` +Resets the flags + + +```php +public function resetFrom(): void; +``` +Resets the from + + +```php +public function resetGroupBy(): void; +``` +Resets the group by + + +```php +public function resetHaving(): void; +``` +Resets the having + + +```php +public function resetLimit(): void; +``` +Resets the limit and offset + + +```php +public function resetOrderBy(): void; +``` +Resets the order by + + +```php +public function resetWhere(): void; +``` +Resets the where + + ```php public function setFlag( string $flag, bool $enable = bool ): void; ``` @@ -1344,30 +1576,42 @@ Indents a collection -

Class Phalcon\DataMapper\Query\Bind

+## DataMapper\Query\Bind + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/Bind.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/Bind.zep) +- __Namespace__ -| Namespace | Phalcon\DataMapper\Query | + - `Phalcon\DataMapper\Query` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Class Bind -## Properties +### Properties ```php /** * @var int */ -protected inlineCount = 0; +protected $inlineCount = ; /** * @var array */ -protected store; +protected $store; ``` -## Methods +### Methods ```php public function bindInline( mixed $value, int $type = int ): string; @@ -1413,18 +1657,30 @@ Processes an array - if passed as an `inline` parameter -

Class Phalcon\DataMapper\Query\Delete

+## DataMapper\Query\Delete + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/Delete.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/Delete.zep) -| Namespace | Phalcon\DataMapper\Query | -| Uses | Phalcon\DataMapper\Pdo\Connection | -| Extends | AbstractConditions | +- __Namespace__ + + - `Phalcon\DataMapper\Query` + +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection` + +- __Extends__ + + `AbstractConditions` + +- __Implements__ + Delete Query -## Methods +### Methods ```php public function __construct( Connection $connection, Bind $bind ); @@ -1458,18 +1714,30 @@ Adds the `RETURNING` clause -

Class Phalcon\DataMapper\Query\Insert

+## DataMapper\Query\Insert + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/Insert.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Query` + +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/Insert.zep) +- __Extends__ + + `AbstractQuery` -| Namespace | Phalcon\DataMapper\Query | -| Uses | Phalcon\DataMapper\Pdo\Connection | -| Extends | AbstractQuery | +- __Implements__ + Insert Query -## Methods +### Methods ```php public function __construct( Connection $connection, Bind $bind ); @@ -1527,26 +1795,38 @@ Sets a column = value condition -

Class Phalcon\DataMapper\Query\QueryFactory

+## DataMapper\Query\QueryFactory -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/QueryFactory.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/QueryFactory.zep) -| Namespace | Phalcon\DataMapper\Query | -| Uses | Phalcon\DataMapper\Pdo\Connection | + +- __Namespace__ + + - `Phalcon\DataMapper\Query` + +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection` + +- __Extends__ + + +- __Implements__ + QueryFactory -## Properties +### Properties ```php /** * @var string */ -protected selectClass = ; +protected $selectClass = ; ``` -## Methods +### Methods ```php public function __construct( string $selectClass = string ); @@ -1586,18 +1866,30 @@ Create a new Update object -

Class Phalcon\DataMapper\Query\Select

+## DataMapper\Query\Select + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/Select.zep) + + +- __Namespace__ + + - `Phalcon\DataMapper\Query` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/Select.zep) +- __Uses__ + + - `BadMethodCallException` -| Namespace | Phalcon\DataMapper\Query | -| Uses | BadMethodCallException | -| Extends | AbstractConditions | +- __Extends__ + + `AbstractConditions` + +- __Implements__ + Select Query -## Constants +### Constants ```php const JOIN_INNER = INNER; const JOIN_LEFT = LEFT; @@ -1605,21 +1897,21 @@ const JOIN_NATURAL = NATURAL; const JOIN_RIGHT = RIGHT; ``` -## Properties +### Properties ```php /** * @var string */ -protected asAlias = ; +protected $asAlias = ; /** * @var bool */ -protected forUpdate = false; +protected $forUpdate = false; ``` -## Methods +### Methods ```php public function __call( string $method, array $params ); @@ -1652,9 +1944,9 @@ The `AS` statement for the query - useful in sub-queries ```php -public function columns(): Select; +public function columns( array $columns ): Select; ``` -The columns to select from. If a key is set in an array element, the +The columns to select from. If a key is set in the array element, the key will be used as the alias @@ -1713,7 +2005,7 @@ Sets a `OR` for a `HAVING` condition ```php -public function reset(): Select; +public function reset(): void; ``` Resets the internal collections @@ -1744,18 +2036,30 @@ Statement builder -

Class Phalcon\DataMapper\Query\Update

+## DataMapper\Query\Update + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/DataMapper/Query/Update.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/DataMapper/Query/Update.zep) + - `Phalcon\DataMapper\Query` -| Namespace | Phalcon\DataMapper\Query | -| Uses | Phalcon\DataMapper\Pdo\Connection | -| Extends | AbstractConditions | +- __Uses__ + + - `Phalcon\DataMapper\Pdo\Connection` + +- __Extends__ + + `AbstractConditions` + +- __Implements__ + Update Query -## Methods +### Methods ```php public function __construct( Connection $connection, Bind $bind ); @@ -1809,3 +2113,5 @@ Adds the `RETURNING` clause public function set( string $column, mixed $value = null ): Update; ``` Sets a column = value condition + + diff --git a/docs/api/phalcon_db.md b/docs/api/phalcon_db.md index badaf8b5a..b707a56a0 100644 --- a/docs/api/phalcon_db.md +++ b/docs/api/phalcon_db.md @@ -1,39 +1,48 @@ +--- +hide: + - navigation +--- -* [Phalcon\Db\AbstractDb](#db-abstractdb) -* [Phalcon\Db\Adapter\AbstractAdapter](#db-adapter-abstractadapter) -* [Phalcon\Db\Adapter\AdapterInterface](#db-adapter-adapterinterface) -* [Phalcon\Db\Adapter\Pdo\AbstractPdo](#db-adapter-pdo-abstractpdo) -* [Phalcon\Db\Adapter\Pdo\Mysql](#db-adapter-pdo-mysql) -* [Phalcon\Db\Adapter\Pdo\Postgresql](#db-adapter-pdo-postgresql) -* [Phalcon\Db\Adapter\Pdo\Sqlite](#db-adapter-pdo-sqlite) -* [Phalcon\Db\Adapter\PdoFactory](#db-adapter-pdofactory) -* [Phalcon\Db\Column](#db-column) -* [Phalcon\Db\ColumnInterface](#db-columninterface) -* [Phalcon\Db\Dialect](#db-dialect) -* [Phalcon\Db\Dialect\Mysql](#db-dialect-mysql) -* [Phalcon\Db\Dialect\Postgresql](#db-dialect-postgresql) -* [Phalcon\Db\Dialect\Sqlite](#db-dialect-sqlite) -* [Phalcon\Db\DialectInterface](#db-dialectinterface) -* [Phalcon\Db\Enum](#db-enum) -* [Phalcon\Db\Exception](#db-exception) -* [Phalcon\Db\Index](#db-index) -* [Phalcon\Db\IndexInterface](#db-indexinterface) -* [Phalcon\Db\Profiler](#db-profiler) -* [Phalcon\Db\Profiler\Item](#db-profiler-item) -* [Phalcon\Db\RawValue](#db-rawvalue) -* [Phalcon\Db\Reference](#db-reference) -* [Phalcon\Db\ReferenceInterface](#db-referenceinterface) -* [Phalcon\Db\Result\PdoResult](#db-result-pdoresult) -* [Phalcon\Db\ResultInterface](#db-resultinterface) - -

Abstract Class Phalcon\Db\AbstractDb

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/AbstractDb.zep) - -| Namespace | Phalcon\Db | -| Uses | \PDO | - -Phalcon\Db and its related classes provide a simple SQL database interface +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Db\Adapter\AbstractAdapter ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/AbstractAdapter.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter` + +- __Uses__ + + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\DialectInterface` + - `Phalcon\Db\Enum` + - `Phalcon\Db\Exception` + - `Phalcon\Db\Index` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\RawValue` + - `Phalcon\Db\Reference` + - `Phalcon\Db\ReferenceInterface` + - `Phalcon\Events\EventsAwareInterface` + - `Phalcon\Events\ManagerInterface` + +- __Extends__ + + +- __Implements__ + + - `AdapterInterface` + - `EventsAwareInterface` + +Base class for Phalcon\Db\Adapter adapters. + +This class and its related classes provide a simple SQL database interface for Phalcon Framework. The Phalcon\Db is the basic class you use to connect your PHP application to an RDBMS. There is a different adapter class for each brand of RDBMS. @@ -62,13 +71,13 @@ try { ); $result = $connection->query( - "SELECTFROM robots LIMIT 5" + "SELECTFROM co_invoices LIMIT 5" ); $result->setFetchMode(Enum::FETCH_NUM); - while ($robot = $result->fetch()) { - print_r($robot); + while ($invoice = $result->fetch()) { + print_r($invoice); } } catch (Exception $e) { echo $e->getMessage(), PHP_EOL; @@ -76,123 +85,102 @@ try { ``` -## Methods - -```php -public static function setup( array $options ): void; -``` -Enables/disables options in the Database component - - - - -

Abstract Class Phalcon\Db\Adapter\AbstractAdapter

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/AbstractAdapter.zep) - -| Namespace | Phalcon\Db\Adapter | -| Uses | Phalcon\Db\DialectInterface, Phalcon\Db\ColumnInterface, Phalcon\Db\Enum, Phalcon\Db\Exception, Phalcon\Db\Index, Phalcon\Db\IndexInterface, Phalcon\Db\Reference, Phalcon\Db\ReferenceInterface, Phalcon\Db\RawValue, Phalcon\Events\EventsAwareInterface, Phalcon\Events\ManagerInterface | -| Implements | AdapterInterface, EventsAwareInterface | - -Base class for Phalcon\Db\Adapter adapters - - -## Properties +### Properties ```php /** * Connection ID * * @var int */ -protected static connectionConsecutive = 0; +protected static $connectionConsecutive = ; /** * Active connection ID * * @var int */ -protected connectionId; +protected $connectionId; /** * Descriptor used to connect to a database * * @var array */ -protected descriptor; +protected $descriptor; /** * Dialect instance * * @var object */ -protected dialect; +protected $dialect; /** * Name of the dialect used * * @var string */ -protected dialectType; +protected $dialectType; /** * Event Manager * * @var ManagerInterface|null */ -protected eventsManager; +protected $eventsManager; /** * The real SQL statement - what was executed * * @var string */ -protected realSqlStatement; +protected $realSqlStatement; /** * Active SQL Bind Types * * @var array */ -protected sqlBindTypes; +protected $sqlBindTypes; /** * Active SQL Statement * * @var string */ -protected sqlStatement; +protected $sqlStatement; /** * Active SQL bound parameter variables * * @var array */ -protected sqlVariables; +protected $sqlVariables; /** * Current transaction level * * @var int */ -protected transactionLevel = 0; +protected $transactionLevel = ; /** * Whether the database supports transactions with save points * * @var bool */ -protected transactionsWithSavepoints = false; +protected $transactionsWithSavepoints = false; /** * Type of database system the adapter is used for * * @var string */ -protected type; +protected $type; ``` -## Methods +### Methods ```php public function __construct( array $descriptor ); @@ -651,6 +639,12 @@ public function setNestedTransactionsWithSavepoints( bool $nestedTransactionsWit Set if nested transactions should use savepoints +```php +public static function setup( array $options ): void; +``` +Enables/disables options in the Database component + + ```php public function sharedLock( string $sqlQuery ): string; ``` @@ -776,17 +770,34 @@ var_dump( -

Interface Phalcon\Db\Adapter\AdapterInterface

+## Db\Adapter\AdapterInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/AdapterInterface.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/AdapterInterface.zep) +- __Uses__ + + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\DialectInterface` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\RawValue` + - `Phalcon\Db\ReferenceInterface` + - `Phalcon\Db\ResultInterface` -| Namespace | Phalcon\Db\Adapter | -| Uses | Phalcon\Db\DialectInterface, Phalcon\Db\ResultInterface, Phalcon\Db\ColumnInterface, Phalcon\Db\IndexInterface, Phalcon\Db\RawValue, Phalcon\Db\ReferenceInterface | +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Db adapters -## Methods +### Methods ```php public function addColumn( string $tableName, string $schemaName, ColumnInterface $column ): bool; @@ -1264,13 +1275,30 @@ Generates SQL checking for the existence of a schema.view -

Abstract Class Phalcon\Db\Adapter\Pdo\AbstractPdo

+## Db\Adapter\Pdo\AbstractPdo ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/Pdo/AbstractPdo.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter\Pdo` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/Pdo/AbstractPdo.zep) +- __Uses__ + + - `Phalcon\Db\Adapter\AbstractAdapter` + - `Phalcon\Db\Column` + - `Phalcon\Db\Exception` + - `Phalcon\Db\ResultInterface` + - `Phalcon\Db\Result\PdoResult` + - `Phalcon\Events\ManagerInterface` -| Namespace | Phalcon\Db\Adapter\Pdo | -| Uses | Phalcon\Db\Adapter\AbstractAdapter, Phalcon\Db\Column, Phalcon\Db\Exception, Phalcon\Db\Result\PdoResult, Phalcon\Db\ResultInterface, Phalcon\Events\ManagerInterface | -| Extends | AbstractAdapter | +- __Extends__ + + `AbstractAdapter` + +- __Implements__ + Phalcon\Db\Adapter\Pdo is the Phalcon\Db that internally uses PDO to connect to a database @@ -1290,25 +1318,25 @@ $connection = new Mysql($config); ``` -## Properties +### Properties ```php /** * Last affected rows * * @var int */ -protected affectedRows = 0; +protected $affectedRows = ; /** * PDO Handler * * @var \PDO */ -protected pdo; +protected $pdo; ``` -## Methods +### Methods ```php public function __construct( array $descriptor ); @@ -1579,13 +1607,33 @@ Constructs the SQL statement (with parameters) -

Class Phalcon\Db\Adapter\Pdo\Mysql

+## Db\Adapter\Pdo\Mysql + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/Pdo/Mysql.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter\Pdo` + +- __Uses__ + + - `Phalcon\Db\Adapter\Pdo\AbstractPdo` + - `Phalcon\Db\Column` + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\Enum` + - `Phalcon\Db\Exception` + - `Phalcon\Db\Index` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\Reference` + - `Phalcon\Db\ReferenceInterface` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/Pdo/Mysql.zep) +- __Extends__ + + `PdoAdapter` -| Namespace | Phalcon\Db\Adapter\Pdo | -| Uses | Phalcon\Db\Adapter\Pdo\AbstractPdo, Phalcon\Db\Column, Phalcon\Db\ColumnInterface, Phalcon\Db\Enum, Phalcon\Db\Exception, Phalcon\Db\Index, Phalcon\Db\IndexInterface, Phalcon\Db\Reference, Phalcon\Db\ReferenceInterface | -| Extends | PdoAdapter | +- __Implements__ + Specific functions for the MySQL database system @@ -1604,27 +1652,21 @@ $connection = new Mysql($config); ``` -## Properties +### Properties ```php /** * @var string */ -protected dialectType = mysql; +protected $dialectType = mysql; /** * @var string */ -protected type = mysql; +protected $type = mysql; ``` -## Methods - -```php -public function __construct( array $descriptor ); -``` -Constructor for Phalcon\Db\Adapter\Pdo - +### Methods ```php public function addForeignKey( string $tableName, string $schemaName, ReferenceInterface $reference ): bool; @@ -1676,13 +1718,33 @@ Returns PDO adapter DSN defaults as a key-value map. -

Class Phalcon\Db\Adapter\Pdo\Postgresql

+## Db\Adapter\Pdo\Postgresql + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/Pdo/Postgresql.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter\Pdo` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/Pdo/Postgresql.zep) +- __Uses__ + + - `Phalcon\Db\Adapter\Pdo\AbstractPdo` + - `Phalcon\Db\Column` + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\Enum` + - `Phalcon\Db\Exception` + - `Phalcon\Db\RawValue` + - `Phalcon\Db\Reference` + - `Phalcon\Db\ReferenceInterface` + - `Throwable` -| Namespace | Phalcon\Db\Adapter\Pdo | -| Uses | Phalcon\Db\Adapter\Pdo\AbstractPdo, Phalcon\Db\Column, Phalcon\Db\ColumnInterface, Phalcon\Db\Enum, Phalcon\Db\Exception, Phalcon\Db\RawValue, Phalcon\Db\Reference, Phalcon\Db\ReferenceInterface, Throwable | -| Extends | PdoAdapter | +- __Extends__ + + `PdoAdapter` + +- __Implements__ + Specific functions for the PostgreSQL database system @@ -1701,21 +1763,21 @@ $connection = new Postgresql($config); ``` -## Properties +### Properties ```php /** * @var string */ -protected dialectType = postgresql; +protected $dialectType = postgresql; /** * @var string */ -protected type = pgsql; +protected $type = pgsql; ``` -## Methods +### Methods ```php public function __construct( array $descriptor ); @@ -1811,13 +1873,34 @@ Returns PDO adapter DSN defaults as a key-value map. -

Class Phalcon\Db\Adapter\Pdo\Sqlite

+## Db\Adapter\Pdo\Sqlite + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/Pdo/Sqlite.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter\Pdo` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/Pdo/Sqlite.zep) +- __Uses__ + + - `Phalcon\Db\Adapter\Pdo\AbstractPdo` + - `Phalcon\Db\Column` + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\Enum` + - `Phalcon\Db\Exception` + - `Phalcon\Db\Index` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\RawValue` + - `Phalcon\Db\Reference` + - `Phalcon\Db\ReferenceInterface` -| Namespace | Phalcon\Db\Adapter\Pdo | -| Uses | Phalcon\Db\Adapter\Pdo\AbstractPdo, Phalcon\Db\Column, Phalcon\Db\ColumnInterface, Phalcon\Db\Enum, Phalcon\Db\Exception, Phalcon\Db\Index, Phalcon\Db\IndexInterface, Phalcon\Db\RawValue, Phalcon\Db\Reference, Phalcon\Db\ReferenceInterface | -| Extends | PdoAdapter | +- __Extends__ + + `PdoAdapter` + +- __Implements__ + Specific functions for the SQLite database system @@ -1832,21 +1915,21 @@ $connection = new Sqlite( ``` -## Properties +### Properties ```php /** * @var string */ -protected dialectType = sqlite; +protected $dialectType = sqlite; /** * @var string */ -protected type = sqlite; +protected $type = sqlite; ``` -## Methods +### Methods ```php public function __construct( array $descriptor ); @@ -1936,13 +2019,26 @@ Returns PDO adapter DSN defaults as a key-value map. -

Class Phalcon\Db\Adapter\PdoFactory

+## Db\Adapter\PdoFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Adapter/PdoFactory.zep) + + +- __Namespace__ + + - `Phalcon\Db\Adapter` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Adapter/PdoFactory.zep) +- __Uses__ + + - `Phalcon\Factory\AbstractFactory` + - `Phalcon\Support\Helper\Arr\Get` -| Namespace | Phalcon\Db\Adapter | -| Uses | Phalcon\Factory\AbstractFactory, Phalcon\Support\Helper\Arr\Get | -| Extends | AbstractFactory | +- __Extends__ + + `AbstractFactory` + +- __Implements__ + This file is part of the Phalcon Framework. @@ -1952,7 +2048,7 @@ For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code. -## Methods +### Methods ```php public function __construct( array $services = [] ); @@ -1986,12 +2082,24 @@ Returns the available adapters -

Class Phalcon\Db\Column

+## Db\Column + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Column.zep) + + +- __Namespace__ + + - `Phalcon\Db` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Column.zep) +- __Uses__ + -| Namespace | Phalcon\Db | -| Implements | ColumnInterface | +- __Extends__ + + +- __Implements__ + + - `ColumnInterface` Allows to define columns to be used on create or alter table operations @@ -2017,7 +2125,7 @@ $connection->addColumn("robots", null, $column); ``` -## Constants +### Constants ```php const BIND_PARAM_BLOB = 3; const BIND_PARAM_BOOL = 5; @@ -2027,7 +2135,7 @@ const BIND_PARAM_NULL = 0; const BIND_PARAM_STR = 2; const BIND_SKIP = 1024; const TYPE_BIGINTEGER = 14; -const TYPE_BINARY = 26; +const TYPE_BINARY = 27; const TYPE_BIT = 19; const TYPE_BLOB = 11; const TYPE_BOOLEAN = 8; @@ -2053,67 +2161,67 @@ const TYPE_TIMESTAMP = 17; const TYPE_TINYBLOB = 10; const TYPE_TINYINTEGER = 26; const TYPE_TINYTEXT = 25; -const TYPE_VARBINARY = 27; +const TYPE_VARBINARY = 28; const TYPE_VARCHAR = 2; ``` -## Properties +### Properties ```php /** * Column Position * * @var string|null */ -protected after; +protected $after; /** * Column is autoIncrement? * * @var bool */ -protected autoIncrement = false; +protected $autoIncrement = false; /** * Bind Type * * @var int */ -protected bindType = 2; +protected $bindType = 2; /** * Column's comment * * @var string|null */ -protected comment; +protected $comment; /** * Default column value * * @var mixed|null */ -protected defaultValue; +protected $defaultValue; /** * Position is first * * @var bool */ -protected first = false; +protected $first = false; /** * The column have some numeric type? * * @var bool */ -protected isNumeric = false; +protected $isNumeric = false; /** * Column's name * * @var string */ -protected name; +protected $name; /** * Column not nullable? @@ -2122,60 +2230,60 @@ protected name; * * @var bool */ -protected notNull = true; +protected $notNull = true; /** * Column is part of the primary key? * * @var bool */ -protected primary = false; +protected $primary = false; /** * Integer column number scale * * @var int */ -protected scale = 0; +protected $scale = ; /** * Integer column size * * @var int|string */ -protected size = 0; +protected $size = ; /** * Column data type * * @var int */ -protected type; +protected $type; /** * Column data type reference * * @var int */ -protected typeReference = -1; +protected $typeReference = -1; /** * Column data type values * * @var array|string */ -protected typeValues; +protected $typeValues; /** * Integer column unsigned? * * @var bool */ -protected unsigned = false; +protected $unsigned = false; ``` -## Methods +### Methods ```php public function __construct( string $name, array $definition ); @@ -2287,16 +2395,28 @@ Returns true if number column is unsigned -

Interface Phalcon\Db\ColumnInterface

+## Db\ColumnInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/ColumnInterface.zep) + + +- __Namespace__ + + - `Phalcon\Db` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/ColumnInterface.zep) +- __Uses__ + -| Namespace | Phalcon\Db | +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Db\Column -## Methods +### Methods ```php public function getAfterPosition(): string | null; @@ -2396,32 +2516,44 @@ Returns true if number column is unsigned -

Abstract Class Phalcon\Db\Dialect

+## Db\Dialect ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Dialect.zep) + + +- __Namespace__ + + - `Phalcon\Db` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Dialect.zep) +- __Uses__ + -| Namespace | Phalcon\Db | -| Implements | DialectInterface | +- __Extends__ + + +- __Implements__ + + - `DialectInterface` This is the base class to each database dialect. This implements common methods to transform intermediate code into its RDBMS related syntax -## Properties +### Properties ```php /** * @var string */ -protected escapeChar; +protected $escapeChar; /** * @var array */ -protected customFunctions; +protected $customFunctions; ``` -## Methods +### Methods ```php public function createSavepoint( string $name ): string; @@ -2701,27 +2833,45 @@ Prepares table for this RDBMS -

Class Phalcon\Db\Dialect\Mysql

+## Db\Dialect\Mysql + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Dialect/Mysql.zep) + + +- __Namespace__ + + - `Phalcon\Db\Dialect` + +- __Uses__ + + - `Phalcon\Db\Column` + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\Dialect` + - `Phalcon\Db\DialectInterface` + - `Phalcon\Db\Exception` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\ReferenceInterface` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Dialect/Mysql.zep) +- __Extends__ + + `Dialect` -| Namespace | Phalcon\Db\Dialect | -| Uses | Phalcon\Db\Dialect, Phalcon\Db\Column, Phalcon\Db\Exception, Phalcon\Db\IndexInterface, Phalcon\Db\ColumnInterface, Phalcon\Db\ReferenceInterface, Phalcon\Db\DialectInterface | -| Extends | Dialect | +- __Implements__ + Generates database specific SQL for the MySQL RDBMS -## Properties +### Properties ```php /** * @var string */ -protected escapeChar = `; +protected $escapeChar = `; ``` -## Methods +### Methods ```php public function addColumn( string $tableName, string $schemaName, ColumnInterface $column ): string; @@ -2905,27 +3055,45 @@ Generates SQL to add the table creation options -

Class Phalcon\Db\Dialect\Postgresql

+## Db\Dialect\Postgresql + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Dialect/Postgresql.zep) + + +- __Namespace__ + + - `Phalcon\Db\Dialect` + +- __Uses__ + + - `Phalcon\Db\Column` + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\Dialect` + - `Phalcon\Db\DialectInterface` + - `Phalcon\Db\Exception` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\ReferenceInterface` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Dialect/Postgresql.zep) +- __Extends__ + + `Dialect` -| Namespace | Phalcon\Db\Dialect | -| Uses | Phalcon\Db\Dialect, Phalcon\Db\Column, Phalcon\Db\Exception, Phalcon\Db\IndexInterface, Phalcon\Db\ColumnInterface, Phalcon\Db\ReferenceInterface, Phalcon\Db\DialectInterface | -| Extends | Dialect | +- __Implements__ + Generates database specific SQL for the PostgreSQL RDBMS -## Properties +### Properties ```php /** * @var string */ -protected escapeChar = \"; +protected $escapeChar = \"; ``` -## Methods +### Methods ```php public function addColumn( string $tableName, string $schemaName, ColumnInterface $column ): string; @@ -3104,27 +3272,45 @@ protected function getTableOptions( array $definition ): string; -

Class Phalcon\Db\Dialect\Sqlite

+## Db\Dialect\Sqlite -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Dialect/Sqlite.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Dialect/Sqlite.zep) -| Namespace | Phalcon\Db\Dialect | -| Uses | Phalcon\Db\Column, Phalcon\Db\Exception, Phalcon\Db\IndexInterface, Phalcon\Db\Dialect, Phalcon\Db\DialectInterface, Phalcon\Db\ColumnInterface, Phalcon\Db\ReferenceInterface | -| Extends | Dialect | + +- __Namespace__ + + - `Phalcon\Db\Dialect` + +- __Uses__ + + - `Phalcon\Db\Column` + - `Phalcon\Db\ColumnInterface` + - `Phalcon\Db\Dialect` + - `Phalcon\Db\DialectInterface` + - `Phalcon\Db\Exception` + - `Phalcon\Db\IndexInterface` + - `Phalcon\Db\ReferenceInterface` + +- __Extends__ + + `Dialect` + +- __Implements__ + Generates database specific SQL for the SQLite RDBMS -## Properties +### Properties ```php /** * @var string */ -protected escapeChar = \"; +protected $escapeChar = \"; ``` -## Methods +### Methods ```php public function addColumn( string $tableName, string $schemaName, ColumnInterface $column ): string; @@ -3316,16 +3502,28 @@ Generates SQL checking for the existence of a schema.view -

Interface Phalcon\Db\DialectInterface

+## Db\DialectInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/DialectInterface.zep) + + +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/DialectInterface.zep) +- __Extends__ + -| Namespace | Phalcon\Db | +- __Implements__ + Interface for Phalcon\Db dialects -## Methods +### Methods ```php public function addColumn( string $tableName, string $schemaName, ColumnInterface $column ): string; @@ -3534,16 +3732,28 @@ Generates SQL checking for the existence of a schema.view -

Class Phalcon\Db\Enum

+## Db\Enum -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Enum.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Enum.zep) -| Namespace | Phalcon\Db | + +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Constants for Phalcon\Db -## Constants +### Constants ```php const FETCH_ASSOC; const FETCH_BOTH; @@ -3567,23 +3777,47 @@ const FETCH_UNIQUE; ``` -

Class Phalcon\Db\Exception

+## Db\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Exception.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\Db | -| Extends | \Exception | +- __Implements__ + Exceptions thrown in Phalcon\Db will use this class -

Class Phalcon\Db\Index

+## Db\Index -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Index.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Index.zep) -| Namespace | Phalcon\Db | -| Implements | IndexInterface | + +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `IndexInterface` Allows to define indexes to be used on tables. Indexes are a common way to enhance database performance. An index allows the database server to find @@ -3614,32 +3848,32 @@ $connection->addIndex("robots", null, $index_primary); ``` -## Properties +### Properties ```php /** * Index columns * * @var array */ -protected columns; +protected $columns; /** * Index name * * @var string */ -protected name; +protected $name; /** * Index type * * @var string */ -protected type; +protected $type; ``` -## Methods +### Methods ```php public function __construct( string $name, array $columns, string $type = string ); @@ -3667,16 +3901,28 @@ Index type -

Interface Phalcon\Db\IndexInterface

+## Db\IndexInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/IndexInterface.zep) + + +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/IndexInterface.zep) +- __Extends__ + -| Namespace | Phalcon\Db | +- __Implements__ + Interface for Phalcon\Db\Index -## Methods +### Methods ```php public function getColumns(): array; @@ -3698,12 +3944,24 @@ Gets the index type -

Class Phalcon\Db\Profiler

+## Db\Profiler -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Profiler.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Profiler.zep) -| Namespace | Phalcon\Db | -| Uses | Phalcon\Db\Profiler\Item | + +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + + - `Phalcon\Db\Profiler\Item` + +- __Extends__ + + +- __Implements__ + Instances of Phalcon\Db can generate execution profiles on SQL statements sent to the relational database. Profiled @@ -3756,32 +4014,32 @@ echo "Total Elapsed Time: ", $profile->getTotalElapsedSeconds(), "\n"; ``` -## Properties +### Properties ```php /** * Active Item * * @var Item */ -protected activeProfile; +protected $activeProfile; /** * All the Items in the active profile * * @var Item[] */ -protected allProfiles; +protected $allProfiles; /** * Total time spent by all profiles to complete in nanoseconds * * @var float */ -protected totalNanoseconds = 0; +protected $totalNanoseconds = ; ``` -## Methods +### Methods ```php public function getLastProfile(): Item; @@ -3839,55 +4097,67 @@ Stops the active profile -

Class Phalcon\Db\Profiler\Item

+## Db\Profiler\Item + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Profiler/Item.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Profiler/Item.zep) -| Namespace | Phalcon\Db\Profiler | +- __Namespace__ + + - `Phalcon\Db\Profiler` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + This class identifies each profile in a Phalcon\Db\Profiler -## Properties +### Properties ```php /** * Timestamp when the profile ended * * @var double */ -protected finalTime; +protected $finalTime; /** * Timestamp when the profile started * * @var double */ -protected initialTime; +protected $initialTime; /** * SQL bind types related to the profile * * @var array */ -protected sqlBindTypes; +protected $sqlBindTypes; /** * SQL statement related to the profile * * @var string */ -protected sqlStatement; +protected $sqlStatement; /** * SQL variables related to the profile * * @var array */ -protected sqlVariables; +protected $sqlVariables; ``` -## Methods +### Methods ```php public function getFinalTime(): double; @@ -3969,11 +4239,23 @@ Return the SQL variables related to the profile -

Class Phalcon\Db\RawValue

+## Db\RawValue + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/RawValue.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/RawValue.zep) -| Namespace | Phalcon\Db | +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + This class allows to insert/update raw data without quoting or formatting. @@ -3989,18 +4271,18 @@ $subscriber->save(); ``` -## Properties +### Properties ```php /** * Raw value without quoting or formatting * * @var string */ -protected value; +protected $value; ``` -## Methods +### Methods ```php public function __construct( mixed $value ); @@ -4022,12 +4304,24 @@ public function getValue(): string; -

Class Phalcon\Db\Reference

+## Db\Reference + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Reference.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Reference.zep) -| Namespace | Phalcon\Db | -| Implements | ReferenceInterface | +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `ReferenceInterface` Allows to define reference constraints on tables @@ -4050,67 +4344,67 @@ $reference = new \Phalcon\Db\Reference( ``` -## Properties +### Properties ```php /** * Local reference columns * * @var array */ -protected columns; +protected $columns; /** * Constraint name * * @var string */ -protected name; +protected $name; /** * Referenced Columns * * @var array */ -protected referencedColumns; +protected $referencedColumns; /** * Referenced Schema * * @var string */ -protected referencedSchema; +protected $referencedSchema; /** * Referenced Table * * @var string */ -protected referencedTable; +protected $referencedTable; /** * Schema name * * @var string */ -protected schemaName; +protected $schemaName; /** * ON DELETE * * @var string */ -protected onDelete; +protected $onDelete; /** * ON UPDATE * * @var string */ -protected onUpdate; +protected $onUpdate; ``` -## Methods +### Methods ```php public function __construct( string $name, array $definition ); @@ -4168,16 +4462,28 @@ Schema name -

Interface Phalcon\Db\ReferenceInterface

+## Db\ReferenceInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/ReferenceInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/ReferenceInterface.zep) -| Namespace | Phalcon\Db | +- __Namespace__ + + - `Phalcon\Db` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Db\Reference -## Methods +### Methods ```php public function getColumns(): array; @@ -4229,13 +4535,27 @@ Gets the schema where referenced table is -

Class Phalcon\Db\Result\PdoResult

+## Db\Result\PdoResult + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/Result/PdoResult.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/Result/PdoResult.zep) -| Namespace | Phalcon\Db\Result | -| Uses | Phalcon\Db\Enum, Phalcon\Db\ResultInterface, Phalcon\Db\Adapter\AdapterInterface | -| Implements | ResultInterface | +- __Namespace__ + + - `Phalcon\Db\Result` + +- __Uses__ + + - `Phalcon\Db\Adapter\AdapterInterface` + - `Phalcon\Db\Enum` + - `Phalcon\Db\ResultInterface` + +- __Extends__ + + +- __Implements__ + + - `ResultInterface` Encapsulates the resultset internals @@ -4252,56 +4572,56 @@ while ($robot = $result->fetchArray()) { ``` -## Properties +### Properties ```php /** * @var array */ -protected bindParams; +protected $bindParams; /** * @var array */ -protected bindTypes; +protected $bindTypes; /** * @var AdapterInterface */ -protected connection; +protected $connection; /** * Active fetch mode * * @var int */ -protected fetchMode; +protected $fetchMode; /** * Internal resultset * * @var \PDOStatement */ -protected pdoStatement; +protected $pdoStatement; /** * @var mixed * TODO: Check if this property is used */ -protected result; +protected $result; /** * @var bool */ -protected rowCount = false; +protected $rowCount = false; /** * @var string|null */ -protected sqlStatement; +protected $sqlStatement; ``` -## Methods +### Methods ```php public function __construct( AdapterInterface $connection, \PDOStatement $result, mixed $sqlStatement = null, mixed $bindParams = null, mixed $bindTypes = null ); @@ -4344,7 +4664,7 @@ or FALSE if there are no more rows. This method is affected by the active fetch flag set using `Phalcon\Db\Result\Pdo::setFetchMode()` ```php -$result = $connection->query("SELECT * FROM robots ORDER BY name"); +$result = $connection->query("SELECTFROM robots ORDER BY name"); $result->setFetchMode( \Phalcon\Enum::FETCH_OBJ @@ -4357,7 +4677,7 @@ while ($robot = $result->fetch()) { ```php -public function fetchAll( int $mode = Enum::FETCH_DEFAULT, mixed $fetchArgument = Enum::FETCH_ORI_NEXT, mixed $constructorArgs = null ): array; +public function fetchAll( int $mode = static-constant-access, mixed $fetchArgument = static-constant-access, mixed $constructorArgs = null ): array; ``` Returns an array of arrays containing all the records in the result This method is affected by the active fetch flag set using @@ -4365,7 +4685,7 @@ This method is affected by the active fetch flag set using ```php $result = $connection->query( - "SELECT * FROM robots ORDER BY name" + "SELECTFROM robots ORDER BY name" ); $robots = $result->fetchAll(); @@ -4380,7 +4700,7 @@ if there are no more rows. This method is affected by the active fetch flag set using `Phalcon\Db\Result\Pdo::setFetchMode()` ```php -$result = $connection->query("SELECT * FROM robots robots ORDER BY name"); +$result = $connection->query("SELECTFROM robots ORDER BY name"); $result->setFetchMode( \Phalcon\Enum::FETCH_NUM @@ -4405,7 +4725,7 @@ Gets number of rows returned by a resultset ```php $result = $connection->query( - "SELECT * FROM robots robots ORDER BY name" + "SELECTFROM robots ORDER BY name" ); echo "There are ", $result->numRows(), " rows in the resultset"; @@ -4442,16 +4762,28 @@ $result->setFetchMode( -

Interface Phalcon\Db\ResultInterface

+## Db\ResultInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Db/ResultInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Db/ResultInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Db | + - `Phalcon\Db` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Db\Result objects -## Methods +### Methods ```php public function dataSeek( int $number ); @@ -4508,3 +4840,5 @@ Gets number of rows returned by a resultset public function setFetchMode( int $fetchMode ): bool; ``` Changes the fetching mode affecting Phalcon\Db\Result\Pdo::fetch() + + diff --git a/docs/api/phalcon_di.md b/docs/api/phalcon_di.md index 6c478ae23..0380f09d7 100644 --- a/docs/api/phalcon_di.md +++ b/docs/api/phalcon_di.md @@ -1,41 +1,50 @@ +--- +hide: + - navigation +--- -* [Phalcon\Di\AbstractInjectionAware](#di-abstractinjectionaware) -* [Phalcon\Di\Di](#di-di) -* [Phalcon\Di\DiInterface](#di-diinterface) -* [Phalcon\Di\Exception](#di-exception) -* [Phalcon\Di\Exception\ServiceResolutionException](#di-exception-serviceresolutionexception) -* [Phalcon\Di\FactoryDefault](#di-factorydefault) -* [Phalcon\Di\FactoryDefault\Cli](#di-factorydefault-cli) -* [Phalcon\Di\InitializationAwareInterface](#di-initializationawareinterface) -* [Phalcon\Di\Injectable](#di-injectable) -* [Phalcon\Di\InjectionAwareInterface](#di-injectionawareinterface) -* [Phalcon\Di\Service](#di-service) -* [Phalcon\Di\Service\Builder](#di-service-builder) -* [Phalcon\Di\ServiceInterface](#di-serviceinterface) -* [Phalcon\Di\ServiceProviderInterface](#di-serviceproviderinterface) +!!! info "NOTE" -

Abstract Class Phalcon\Di\AbstractInjectionAware

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/AbstractInjectionAware.zep) -| Namespace | Phalcon\Di | -| Implements | InjectionAwareInterface | + +## Di\AbstractInjectionAware ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/AbstractInjectionAware.zep) + + +- __Namespace__ + + - `Phalcon\Di` + +- __Uses__ + + - `stdClass` + +- __Extends__ + + `stdClass` + +- __Implements__ + + - `InjectionAwareInterface` This abstract class offers common access to the DI in a class -## Properties +### Properties ```php /** * Dependency Injector * * @var DiInterface */ -protected container; +protected $container; ``` -## Methods +### Methods ```php public function getDI(): DiInterface; @@ -51,13 +60,36 @@ Sets the dependency injector -

Class Phalcon\Di\Di

+## Di\Di + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/Di.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/Di.zep) +- __Namespace__ -| Namespace | Phalcon\Di | -| Uses | Phalcon\Di\Service, Phalcon\Di\DiInterface, Phalcon\Di\Exception, Phalcon\Di\Exception\ServiceResolutionException, Phalcon\Config\Adapter\Php, Phalcon\Config\Adapter\Yaml, Phalcon\Config\ConfigInterface, Phalcon\Di\ServiceInterface, Phalcon\Events\ManagerInterface, Phalcon\Di\InitializationAwareInterface, Phalcon\Di\InjectionAwareInterface, Phalcon\Di\ServiceProviderInterface | -| Implements | DiInterface | + - `Phalcon\Di` + +- __Uses__ + + - `Phalcon\Config\Adapter\Php` + - `Phalcon\Config\Adapter\Yaml` + - `Phalcon\Config\ConfigInterface` + - `Phalcon\Di\DiInterface` + - `Phalcon\Di\Exception` + - `Phalcon\Di\Exception\ServiceResolutionException` + - `Phalcon\Di\InitializationAwareInterface` + - `Phalcon\Di\InjectionAwareInterface` + - `Phalcon\Di\Service` + - `Phalcon\Di\ServiceInterface` + - `Phalcon\Di\ServiceProviderInterface` + - `Phalcon\Events\ManagerInterface` + +- __Extends__ + + +- __Implements__ + + - `DiInterface` Phalcon\Di\Di is a component that implements Dependency Injection/Service Location of services and it's itself a container for them. @@ -97,39 +129,39 @@ $request = $di->getRequest(); ``` -## Properties +### Properties ```php /** * List of registered services * * @var ServiceInterface[] */ -protected services; +protected $services; /** * List of shared instances * * @var array */ -protected sharedInstances; +protected $sharedInstances; /** * Events Manager * * @var ManagerInterface|null */ -protected eventsManager; +protected $eventsManager; /** * Latest DI build * * @var DiInterface|null */ -protected static defaultDi; +protected static $defaultDi; ``` -## Methods +### Methods ```php public function __call( string $method, array $arguments = [] ): mixed | null; @@ -232,7 +264,7 @@ return [ ]; ``` -@link https://docs.phalcon.io/en/latest/reference/di.html +@link https://docs.phalcon.io/latest/di/ ```php @@ -268,7 +300,7 @@ user: className: \Acme\User ``` -@link https://docs.phalcon.io/en/latest/reference/di.html +@link https://docs.phalcon.io/latest/di/ ```php @@ -288,7 +320,7 @@ var_dump($di["request"]); ```php -public function offsetSet( mixed $name, mixed $definition ): void; +public function offsetSet( mixed $offset, mixed $value ): void; ``` Allows to register a shared service using the array syntax @@ -379,18 +411,30 @@ Loads services from a Config object. -

Interface Phalcon\Di\DiInterface

+## Di\DiInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/DiInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/DiInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Di | -| Uses | ArrayAccess | -| Extends | ArrayAccess | + - `Phalcon\Di` + +- __Uses__ + + - `ArrayAccess` + +- __Extends__ + + `ArrayAccess` + +- __Implements__ + Interface for Phalcon\Di\Di -## Methods +### Methods ```php public function attempt( string $name, mixed $definition, bool $shared = bool ): ServiceInterface | bool; @@ -481,35 +525,71 @@ Registers an "always shared" service in the services container -

Class Phalcon\Di\Exception

+## Di\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/Exception.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/Exception.zep) -| Namespace | Phalcon\Di | -| Extends | \Exception | +- __Namespace__ + + - `Phalcon\Di` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Di will use this class -

Class Phalcon\Di\Exception\ServiceResolutionException

+## Di\Exception\ServiceResolutionException + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/Exception/ServiceResolutionException.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/Exception/ServiceResolutionException.zep) -| Namespace | Phalcon\Di\Exception | -| Extends | \Phalcon\Di\Exception | +- __Namespace__ + + - `Phalcon\Di\Exception` + +- __Uses__ + + +- __Extends__ + + `\Phalcon\Di\Exception` + +- __Implements__ + Phalcon\Di\Exception\ServiceResolutionException -

Class Phalcon\Di\FactoryDefault

+## Di\FactoryDefault + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/FactoryDefault.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/FactoryDefault.zep) -| Namespace | Phalcon\Di | -| Uses | Phalcon\Filter\FilterFactory | -| Extends | \Phalcon\Di\Di | +- __Namespace__ + + - `Phalcon\Di` + +- __Uses__ + + - `Phalcon\Filter\FilterFactory` + +- __Extends__ + + `\Phalcon\Di\Di` + +- __Implements__ + This is a variant of the standard Phalcon\Di\Di. By default it automatically registers all the services provided by the framework. Thanks to this, the @@ -517,7 +597,7 @@ developer does not need to register each service individually providing a full stack framework -## Methods +### Methods ```php public function __construct(); @@ -527,13 +607,27 @@ Phalcon\Di\FactoryDefault constructor -

Class Phalcon\Di\FactoryDefault\Cli

+## Di\FactoryDefault\Cli + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/FactoryDefault/Cli.zep) + + +- __Namespace__ + + - `Phalcon\Di\FactoryDefault` + +- __Uses__ + + - `Phalcon\Di\FactoryDefault` + - `Phalcon\Di\Service` + - `Phalcon\Filter\FilterFactory` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/FactoryDefault/Cli.zep) +- __Extends__ + + `FactoryDefault` -| Namespace | Phalcon\Di\FactoryDefault | -| Uses | Phalcon\Di\FactoryDefault, Phalcon\Di\Service, Phalcon\Filter\FilterFactory | -| Extends | FactoryDefault | +- __Implements__ + Phalcon\Di\FactoryDefault\Cli @@ -543,7 +637,7 @@ Thanks to this, the developer does not need to register each service individuall This class is specially suitable for CLI applications -## Methods +### Methods ```php public function __construct(); @@ -553,16 +647,28 @@ Phalcon\Di\FactoryDefault\Cli constructor -

Interface Phalcon\Di\InitializationAwareInterface

+## Di\InitializationAwareInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/InitializationAwareInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/InitializationAwareInterface.zep) -| Namespace | Phalcon\Di | + +- __Namespace__ + + - `Phalcon\Di` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for components that have `initialize()` -## Methods +### Methods ```php public function initialize(): void; @@ -572,30 +678,70 @@ public function initialize(): void; -

Abstract Class Phalcon\Di\Injectable

+## Di\Injectable ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/Injectable.zep) + + +- __Namespace__ + + - `Phalcon\Di` + +- __Uses__ + + - `Phalcon\Di\Di` + - `Phalcon\Session\BagInterface` + - `stdClass` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/Injectable.zep) +- __Extends__ + + `stdClass` -| Namespace | Phalcon\Di | -| Uses | stdClass, Phalcon\Di\Di, Phalcon\Session\BagInterface | -| Extends | stdClass | -| Implements | InjectionAwareInterface | +- __Implements__ + + - `InjectionAwareInterface` This class allows to access services in the services container by just only accessing a public property with the same name of a registered service -## Properties +@property \Phalcon\Mvc\Dispatcher|\Phalcon\Mvc\DispatcherInterface $dispatcher +@property \Phalcon\Mvc\Router|\Phalcon\Mvc\RouterInterface $router +@property \Phalcon\Mvc\Url|\Phalcon\Mvc\Url\UrlInterface $url +@property \Phalcon\Http\Request|\Phalcon\Http\RequestInterface $request +@property \Phalcon\Http\Response|\Phalcon\Http\ResponseInterface $response +@property \Phalcon\Http\Response\Cookies|\Phalcon\Http\Response\CookiesInterface $cookies +@property \Phalcon\Filter\Filter $filter +@property \Phalcon\Flash\Direct $flash +@property \Phalcon\Flash\Session $flashSession +@property \Phalcon\Session\ManagerInterface $session +@property \Phalcon\Events\Manager|\Phalcon\Events\ManagerInterface $eventsManager +@property \Phalcon\Db\Adapter\AdapterInterface $db +@property \Phalcon\Encryption\Security $security +@property \Phalcon\Encryption\Crypt|\Phalcon\Encryption\Crypt\CryptInterface $crypt +@property \Phalcon\Html\TagFactory $tag +@property \Phalcon\Html\Escaper|\Phalcon\Html\Escaper\EscaperInterface $escaper +@property \Phalcon\Annotations\Adapter\Memory|\Phalcon\Annotations\Adapter $annotations +@property \Phalcon\Mvc\Model\Manager|\Phalcon\Mvc\Model\ManagerInterface $modelsManager +@property \Phalcon\Mvc\Model\MetaData\Memory|\Phalcon\Mvc\Model\MetadataInterface $modelsMetadata +@property \Phalcon\Mvc\Model\Transaction\Manager|\Phalcon\Mvc\Model\Transaction\ManagerInterface $transactionManager +@property \Phalcon\Assets\Manager $assets +@property \Phalcon\Di\Di|\Phalcon\Di\Di\DiInterface $di +@property \Phalcon\Session\Bag|\Phalcon\Session\BagInterface $persistent +@property \Phalcon\Mvc\View|\Phalcon\Mvc\ViewInterface $view + + +### Properties ```php /** * Dependency Injector * * @var DiInterface|null */ -protected container; +protected $container; ``` -## Methods +### Methods ```php public function __get( string $propertyName ): mixed | null; @@ -623,17 +769,29 @@ Sets the dependency injector -

Interface Phalcon\Di\InjectionAwareInterface

+## Di\InjectionAwareInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/InjectionAwareInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/InjectionAwareInterface.zep) -| Namespace | Phalcon\Di | + +- __Namespace__ + + - `Phalcon\Di` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + This interface must be implemented in those classes that uses internally the Phalcon\Di\Di that creates them -## Methods +### Methods ```php public function getDI(): DiInterface; @@ -649,13 +807,27 @@ Sets the dependency injector -

Class Phalcon\Di\Service

+## Di\Service + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/Service.zep) + + +- __Namespace__ + + - `Phalcon\Di` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/Service.zep) +- __Uses__ + + - `Closure` + - `Phalcon\Di\Exception\ServiceResolutionException` + - `Phalcon\Di\Service\Builder` -| Namespace | Phalcon\Di | -| Uses | Closure, Phalcon\Di\Exception\ServiceResolutionException, Phalcon\Di\Service\Builder | -| Implements | ServiceInterface | +- __Extends__ + + +- __Implements__ + + - `ServiceInterface` Represents individually a service in the services container @@ -669,31 +841,31 @@ $request = service->resolve(); ``` -## Properties +### Properties ```php /** * @var mixed */ -protected definition; +protected $definition; /** * @var bool */ -protected resolved = false; +protected $resolved = false; /** * @var bool */ -protected shared = false; +protected $shared = false; /** * @var mixed|null */ -protected sharedInstance; +protected $sharedInstance; ``` -## Methods +### Methods ```php final public function __construct( mixed $definition, bool $shared = bool ); @@ -757,19 +929,32 @@ Sets/Resets the shared instance related to the service -

Class Phalcon\Di\Service\Builder

+## Di\Service\Builder + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/Service/Builder.zep) + + +- __Namespace__ + + - `Phalcon\Di\Service` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/Service/Builder.zep) +- __Uses__ + + - `Phalcon\Di\DiInterface` + - `Phalcon\Di\Exception` -| Namespace | Phalcon\Di\Service | -| Uses | Phalcon\Di\DiInterface, Phalcon\Di\Exception | +- __Extends__ + + +- __Implements__ + Phalcon\Di\Service\Builder This class builds instances based on complex definitions -## Methods +### Methods ```php public function build( DiInterface $container, array $definition, mixed $parameters = null ); @@ -779,16 +964,28 @@ Builds a service using a complex service definition -

Interface Phalcon\Di\ServiceInterface

+## Di\ServiceInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/ServiceInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/ServiceInterface.zep) + - `Phalcon\Di` -| Namespace | Phalcon\Di | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Represents a service in the services container -## Methods +### Methods ```php public function getDefinition(): mixed; @@ -840,11 +1037,23 @@ Sets if the service is shared or not -

Interface Phalcon\Di\ServiceProviderInterface

+## Di\ServiceProviderInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Di/ServiceProviderInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Di/ServiceProviderInterface.zep) + - `Phalcon\Di` -| Namespace | Phalcon\Di | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Should be implemented by service providers, or such components, which register a service in the service container. @@ -870,9 +1079,11 @@ class SomeServiceProvider implements ServiceProviderInterface ``` -## Methods +### Methods ```php public function register( DiInterface $di ): void; ``` Registers a service provider. + + diff --git a/docs/api/phalcon_dispatcher.md b/docs/api/phalcon_dispatcher.md index fa9927ecc..7d3bbd1d7 100644 --- a/docs/api/phalcon_dispatcher.md +++ b/docs/api/phalcon_dispatcher.md @@ -1,152 +1,179 @@ +--- +hide: + - navigation +--- -* [Phalcon\Dispatcher\AbstractDispatcher](#dispatcher-abstractdispatcher) -* [Phalcon\Dispatcher\DispatcherInterface](#dispatcher-dispatcherinterface) -* [Phalcon\Dispatcher\Exception](#dispatcher-exception) +!!! info "NOTE" -

Abstract Class Phalcon\Dispatcher\AbstractDispatcher

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Dispatcher/AbstractDispatcher.zep) -| Namespace | Phalcon\Dispatcher | -| Uses | Exception, Phalcon\Di\DiInterface, Phalcon\Di\AbstractInjectionAware, Phalcon\Dispatcher\Exception, Phalcon\Events\EventsAwareInterface, Phalcon\Events\ManagerInterface, Phalcon\Filter\FilterInterface, Phalcon\Mvc\Model\Binder, Phalcon\Mvc\Model\BinderInterface | -| Extends | AbstractInjectionAware | -| Implements | DispatcherInterface, EventsAwareInterface | + +## Dispatcher\AbstractDispatcher ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Dispatcher/AbstractDispatcher.zep) + + +- __Namespace__ + + - `Phalcon\Dispatcher` + +- __Uses__ + + - `Exception` + - `Phalcon\Di\AbstractInjectionAware` + - `Phalcon\Di\DiInterface` + - `Phalcon\Dispatcher\Exception` + - `Phalcon\Events\EventsAwareInterface` + - `Phalcon\Events\ManagerInterface` + - `Phalcon\Filter\FilterInterface` + - `Phalcon\Mvc\Model\Binder` + - `Phalcon\Mvc\Model\BinderInterface` + +- __Extends__ + + `AbstractInjectionAware` + +- __Implements__ + + - `DispatcherInterface` + - `EventsAwareInterface` This is the base class for Phalcon\Mvc\Dispatcher and Phalcon\Cli\Dispatcher. This class can't be instantiated directly, you can use it to create your own dispatchers. -## Properties +### Properties ```php /** * @var object|null */ -protected activeHandler; +protected $activeHandler; /** * @var array */ -protected activeMethodMap; +protected $activeMethodMap; /** - * @var string|null + * @var string */ -protected actionName; +protected $actionName = ; /** * @var string */ -protected actionSuffix = Action; +protected $actionSuffix = Action; /** * @var array */ -protected camelCaseMap; +protected $camelCaseMap; /** * @var string */ -protected defaultAction = ; +protected $defaultAction = ; /** - * @var string|null + * @var string */ -protected defaultNamespace; +protected $defaultNamespace = ; /** - * @var string|null + * @var string */ -protected defaultHandler; +protected $defaultHandler = ; /** * @var array */ -protected handlerHashes; +protected $handlerHashes; /** - * @var string|null + * @var string */ -protected handlerName; +protected $handlerName = ; /** * @var string */ -protected handlerSuffix = ; +protected $handlerSuffix = ; /** * @var ManagerInterface|null */ -protected eventsManager; +protected $eventsManager; /** * @var bool */ -protected finished = false; +protected $finished = false; /** * @var bool */ -protected forwarded = false; +protected $forwarded = false; /** * @var bool */ -protected isControllerInitialize = false; +protected $isControllerInitialize = false; /** * @var mixed|null */ -protected lastHandler; +protected $lastHandler; /** * @var BinderInterface|null */ -protected modelBinder; +protected $modelBinder; /** * @var bool */ -protected modelBinding = false; +protected $modelBinding = false; /** - * @var string|null + * @var string */ -protected moduleName; +protected $moduleName = ; /** - * @var string|null + * @var string */ -protected namespaceName; +protected $namespaceName = ; /** * @var array */ -protected params; +protected $params; /** * @var string|null */ -protected previousActionName; +protected $previousActionName = ; /** * @var string|null */ -protected previousHandlerName; +protected $previousHandlerName = ; /** * @var string|null */ -protected previousNamespaceName; +protected $previousNamespaceName = ; /** * @var string|null */ -protected returnedValue; +protected $returnedValue; ``` -## Methods +### Methods ```php public function callActionMethod( mixed $handler, string $actionMethod, array $params = [] ); @@ -429,16 +456,28 @@ protected function toCamelCase( string $input ): string; -

Interface Phalcon\Dispatcher\DispatcherInterface

+## Dispatcher\DispatcherInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Dispatcher/DispatcherInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Dispatcher/DispatcherInterface.zep) + - `Phalcon\Dispatcher` -| Namespace | Phalcon\Dispatcher | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Dispatcher\AbstractDispatcher -## Methods +### Methods ```php public function dispatch(): mixed | bool; @@ -569,17 +608,29 @@ Sets action params to be dispatched -

Class Phalcon\Dispatcher\Exception

+## Dispatcher\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Dispatcher/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Dispatcher` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Dispatcher/Exception.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\Dispatcher | -| Extends | \Exception | +- __Implements__ + Exceptions thrown in Phalcon\Dispatcher/* will use this class -## Constants +### Constants ```php const EXCEPTION_ACTION_NOT_FOUND = 5; const EXCEPTION_CYCLIC_ROUTING = 1; diff --git a/docs/api/phalcon_domain.md b/docs/api/phalcon_domain.md index 73a66cf60..7c4881828 100644 --- a/docs/api/phalcon_domain.md +++ b/docs/api/phalcon_domain.md @@ -1,69 +1,84 @@ +--- +hide: + - navigation +--- -* [Phalcon\Domain\Payload\Payload](#domain-payload-payload) -* [Phalcon\Domain\Payload\PayloadFactory](#domain-payload-payloadfactory) -* [Phalcon\Domain\Payload\PayloadInterface](#domain-payload-payloadinterface) -* [Phalcon\Domain\Payload\ReadableInterface](#domain-payload-readableinterface) -* [Phalcon\Domain\Payload\Status](#domain-payload-status) -* [Phalcon\Domain\Payload\WriteableInterface](#domain-payload-writeableinterface) +!!! info "NOTE" -

Class Phalcon\Domain\Payload\Payload

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/Payload.zep) -| Namespace | Phalcon\Domain\Payload | -| Uses | Throwable | -| Implements | PayloadInterface | + +## Domain\Payload\Payload + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Domain/Payload/Payload.zep) + + +- __Namespace__ + + - `Phalcon\Domain\Payload` + +- __Uses__ + + - `Throwable` + +- __Extends__ + + +- __Implements__ + + - `PayloadInterface` Holds the payload -## Properties +### Properties ```php /** * Exception if any * * @var Throwable|null */ -protected exception; +protected $exception; /** * Extra information * * @var mixed */ -protected extras; +protected $extras; /** * Input * * @var mixed */ -protected input; +protected $input; /** * Messages * * @var mixed */ -protected messages; +protected $messages; /** * Status * * @var mixed */ -protected status; +protected $status; /** * Output * * @var mixed */ -protected output; +protected $output; ``` -## Methods +### Methods ```php public function getException(): Throwable | null; @@ -139,16 +154,28 @@ Sets the payload status. -

Class Phalcon\Domain\Payload\PayloadFactory

+## Domain\Payload\PayloadFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Domain/Payload/PayloadFactory.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/PayloadFactory.zep) -| Namespace | Phalcon\Domain\Payload | +- __Namespace__ + + - `Phalcon\Domain\Payload` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Factory to create payload objects -## Methods +### Methods ```php public function newInstance(): PayloadInterface; @@ -158,28 +185,52 @@ Instantiate a new object -

Interface Phalcon\Domain\Payload\PayloadInterface

+## Domain\Payload\PayloadInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Domain/Payload/PayloadInterface.zep) + + +- __Namespace__ + + - `Phalcon\Domain\Payload` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/PayloadInterface.zep) +- __Extends__ + + `ReadableInterface` -| Namespace | Phalcon\Domain\Payload | -| Extends | ReadableInterface | +- __Implements__ + This interface is used for consumers -

Interface Phalcon\Domain\Payload\ReadableInterface

+## Domain\Payload\ReadableInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/ReadableInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Domain/Payload/ReadableInterface.zep) -| Namespace | Phalcon\Domain\Payload | -| Uses | Throwable | + +- __Namespace__ + + - `Phalcon\Domain\Payload` + +- __Uses__ + + - `Throwable` + +- __Extends__ + + +- __Implements__ + This interface is used for consumers (read only) -## Methods +### Methods ```php public function getException(): Throwable | null; @@ -219,16 +270,28 @@ Gets the status of this payload. -

Class Phalcon\Domain\Payload\Status

+## Domain\Payload\Status + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Domain/Payload/Status.zep) + + +- __Namespace__ + + - `Phalcon\Domain\Payload` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/Status.zep) +- __Uses__ + -| Namespace | Phalcon\Domain\Payload | +- __Extends__ + + +- __Implements__ + Holds the status codes for the payload -## Constants +### Constants ```php const ACCEPTED = ACCEPTED; const AUTHENTICATED = AUTHENTICATED; @@ -252,7 +315,7 @@ const UPDATED = UPDATED; const VALID = VALID; ``` -## Methods +### Methods ```php final private function __construct(); @@ -262,17 +325,29 @@ Instantiation not allowed. -

Interface Phalcon\Domain\Payload\WriteableInterface

+## Domain\Payload\WriteableInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Domain/Payload/WriteableInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/WriteableInterface.zep) + - `Phalcon\Domain\Payload` -| Namespace | Phalcon\Domain\Payload | -| Uses | Throwable | +- __Uses__ + + - `Throwable` + +- __Extends__ + + +- __Implements__ + This interface is used for consumers (write) -## Methods +### Methods ```php public function setException( Throwable $exception ): PayloadInterface; @@ -308,3 +383,5 @@ Sets the output produced from the domain layer. public function setStatus( mixed $status ): PayloadInterface; ``` Sets the status of this payload. + + diff --git a/docs/api/phalcon_encryption.md b/docs/api/phalcon_encryption.md index f0b349219..bd83caed6 100644 --- a/docs/api/phalcon_encryption.md +++ b/docs/api/phalcon_encryption.md @@ -1,42 +1,36 @@ +--- +hide: + - navigation +--- -* [Phalcon\Encryption\Crypt](#encryption-crypt) -* [Phalcon\Encryption\Crypt\CryptInterface](#encryption-crypt-cryptinterface) -* [Phalcon\Encryption\Crypt\Exception\Exception](#encryption-crypt-exception-exception) -* [Phalcon\Encryption\Crypt\Exception\Mismatch](#encryption-crypt-exception-mismatch) -* [Phalcon\Encryption\Crypt\PadFactory](#encryption-crypt-padfactory) -* [Phalcon\Encryption\Crypt\Padding\Ansi](#encryption-crypt-padding-ansi) -* [Phalcon\Encryption\Crypt\Padding\Iso10126](#encryption-crypt-padding-iso10126) -* [Phalcon\Encryption\Crypt\Padding\IsoIek](#encryption-crypt-padding-isoiek) -* [Phalcon\Encryption\Crypt\Padding\Noop](#encryption-crypt-padding-noop) -* [Phalcon\Encryption\Crypt\Padding\PadInterface](#encryption-crypt-padding-padinterface) -* [Phalcon\Encryption\Crypt\Padding\Pkcs7](#encryption-crypt-padding-pkcs7) -* [Phalcon\Encryption\Crypt\Padding\Space](#encryption-crypt-padding-space) -* [Phalcon\Encryption\Crypt\Padding\Zero](#encryption-crypt-padding-zero) -* [Phalcon\Encryption\Security](#encryption-security) -* [Phalcon\Encryption\Security\Exception](#encryption-security-exception) -* [Phalcon\Encryption\Security\JWT\Builder](#encryption-security-jwt-builder) -* [Phalcon\Encryption\Security\JWT\Exceptions\UnsupportedAlgorithmException](#encryption-security-jwt-exceptions-unsupportedalgorithmexception) -* [Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException](#encryption-security-jwt-exceptions-validatorexception) -* [Phalcon\Encryption\Security\JWT\Signer\AbstractSigner](#encryption-security-jwt-signer-abstractsigner) -* [Phalcon\Encryption\Security\JWT\Signer\Hmac](#encryption-security-jwt-signer-hmac) -* [Phalcon\Encryption\Security\JWT\Signer\None](#encryption-security-jwt-signer-none) -* [Phalcon\Encryption\Security\JWT\Signer\SignerInterface](#encryption-security-jwt-signer-signerinterface) -* [Phalcon\Encryption\Security\JWT\Token\AbstractItem](#encryption-security-jwt-token-abstractitem) -* [Phalcon\Encryption\Security\JWT\Token\Enum](#encryption-security-jwt-token-enum) -* [Phalcon\Encryption\Security\JWT\Token\Item](#encryption-security-jwt-token-item) -* [Phalcon\Encryption\Security\JWT\Token\Parser](#encryption-security-jwt-token-parser) -* [Phalcon\Encryption\Security\JWT\Token\Signature](#encryption-security-jwt-token-signature) -* [Phalcon\Encryption\Security\JWT\Token\Token](#encryption-security-jwt-token-token) -* [Phalcon\Encryption\Security\JWT\Validator](#encryption-security-jwt-validator) -* [Phalcon\Encryption\Security\Random](#encryption-security-random) - -

Class Phalcon\Encryption\Crypt

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt.zep) - -| Namespace | Phalcon\Encryption | -| Uses | Phalcon\Encryption\Crypt\CryptInterface, Phalcon\Encryption\Crypt\Exception\Exception, Phalcon\Encryption\Crypt\Exception\Mismatch, Phalcon\Encryption\Crypt\PadFactory | -| Implements | CryptInterface | +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Encryption\Crypt + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt.zep) + + +- __Namespace__ + + - `Phalcon\Encryption` + +- __Uses__ + + - `Phalcon\Encryption\Crypt\CryptInterface` + - `Phalcon\Encryption\Crypt\Exception\Exception` + - `Phalcon\Encryption\Crypt\Exception\Mismatch` + - `Phalcon\Encryption\Crypt\PadFactory` + +- __Extends__ + + +- __Implements__ + + - `CryptInterface` Provides encryption capabilities to Phalcon applications. @@ -57,7 +51,7 @@ echo $crypt->decrypt($encrypted, $key); ``` -## Constants +### Constants ```php const DEFAULT_ALGORITHM = sha256; const DEFAULT_CIPHER = aes-256-cfb; @@ -70,74 +64,74 @@ const PADDING_SPACE = 6; const PADDING_ZERO = 5; ``` -## Properties +### Properties ```php /** * @var string */ -protected authData = ; +protected $authData = ; /** * @var string */ -protected authTag = ; +protected $authTag = ; /** * @var int */ -protected authTagLength = 16; +protected $authTagLength = 16; /** * Available cipher methods. * * @var array */ -protected availableCiphers; +protected $availableCiphers; /** * @var string */ -protected cipher; +protected $cipher; /** * The name of hashing algorithm. * * @var string */ -protected hashAlgorithm; +protected $hashAlgorithm; /** * The cipher iv length. * * @var int */ -protected ivLength = 16; +protected $ivLength = 16; /** * @var string */ -protected key = ; +protected $key = ; /** * @var int */ -protected padding = 0; +protected $padding = ; /** * @var PadFactory */ -protected padFactory; +protected $padFactory; /** * Whether calculating message digest enabled or not. * * @var bool */ -protected useSigning = true; +protected $useSigning = true; ``` -## Methods +### Methods ```php public function __construct( string $cipher = static-constant-access, bool $useSigning = bool, PadFactory $padFactory = null ); @@ -370,16 +364,28 @@ protected function phpOpensslRandomPseudoBytes( int $length ); -

Interface Phalcon\Encryption\Crypt\CryptInterface

+## Encryption\Crypt\CryptInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/CryptInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/CryptInterface.zep) -| Namespace | Phalcon\Encryption\Crypt | + +- __Namespace__ + + - `Phalcon\Encryption\Crypt` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Crypt -## Methods +### Methods ```php public function decrypt( string $input, string $key = null ): string; @@ -485,51 +491,90 @@ Sets if the calculating message digest must be used. -

Class Phalcon\Encryption\Crypt\Exception\Exception

+## Encryption\Crypt\Exception\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Exception/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Exception` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Exception/Exception.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\Encryption\Crypt\Exception | -| Extends | \Exception | +- __Implements__ + Exceptions thrown in Phalcon\Crypt use this class -

Class Phalcon\Encryption\Crypt\Exception\Mismatch

+## Encryption\Crypt\Exception\Mismatch -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Exception/Mismatch.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Exception/Mismatch.zep) -| Namespace | Phalcon\Encryption\Crypt\Exception | -| Extends | Exception | + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Exception` + +- __Uses__ + + +- __Extends__ + + `Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Crypt will use this class. -

Class Phalcon\Encryption\Crypt\PadFactory

+## Encryption\Crypt\PadFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/PadFactory.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Crypt` + +- __Uses__ + + - `Phalcon\Encryption\Crypt` + - `Phalcon\Encryption\Crypt\Padding\PadInterface` + - `Phalcon\Factory\AbstractFactory` + - `Phalcon\Support\Helper\Arr\Get` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/PadFactory.zep) +- __Extends__ + + `AbstractFactory` -| Namespace | Phalcon\Encryption\Crypt | -| Uses | Phalcon\Encryption\Crypt, Phalcon\Encryption\Crypt\Padding\PadInterface, Phalcon\Factory\AbstractFactory, Phalcon\Support\Helper\Arr\Get | -| Extends | AbstractFactory | +- __Implements__ + Class PadFactory @package Phalcon\Crypt -## Properties +### Properties ```php /** * @var string */ -protected exception = Phalcon\\Encryption\\Crypt\\Exception\\Exception; +protected $exception = Phalcon\\Encryption\\Crypt\\Exception\\Exception; ``` -## Methods +### Methods ```php public function __construct( array $services = [] ); @@ -558,19 +603,31 @@ protected function getServices(): array; -

Class Phalcon\Encryption\Crypt\Padding\Ansi

+## Encryption\Crypt\Padding\Ansi -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/Ansi.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/Ansi.zep) -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `PadInterface` Class Ansi @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -586,19 +643,31 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Crypt\Padding\Iso10126

+## Encryption\Crypt\Padding\Iso10126 + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/Iso10126.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/Iso10126.zep) +- __Extends__ + -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | +- __Implements__ + + - `PadInterface` Class Iso10126 @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -614,19 +683,31 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Crypt\Padding\IsoIek

+## Encryption\Crypt\Padding\IsoIek -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/IsoIek.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/IsoIek.zep) -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `PadInterface` Class IsoIek @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -642,19 +723,31 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Crypt\Padding\Noop

+## Encryption\Crypt\Padding\Noop + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/Noop.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/Noop.zep) +- __Extends__ + -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | +- __Implements__ + + - `PadInterface` Class Noop @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -670,16 +763,28 @@ public function unpad( string $input, int $blockSize ): int; -

Interface Phalcon\Encryption\Crypt\Padding\PadInterface

+## Encryption\Crypt\Padding\PadInterface ![Interface](../assets/images/interface-blue.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/PadInterface.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/PadInterface.zep) -| Namespace | Phalcon\Encryption\Crypt\Padding | + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -695,19 +800,31 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Crypt\Padding\Pkcs7

+## Encryption\Crypt\Padding\Pkcs7 + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/Pkcs7.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/Pkcs7.zep) +- __Extends__ + -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | +- __Implements__ + + - `PadInterface` Class Pkcs7 @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -723,19 +840,31 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Crypt\Padding\Space

+## Encryption\Crypt\Padding\Space -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/Space.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/Space.zep) -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `PadInterface` Class Space @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -751,19 +880,31 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Crypt\Padding\Zero

+## Encryption\Crypt\Padding\Zero + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Crypt/Padding/Zero.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Crypt\Padding` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Crypt/Padding/Zero.zep) +- __Extends__ + -| Namespace | Phalcon\Encryption\Crypt\Padding | -| Implements | PadInterface | +- __Implements__ + + - `PadInterface` Class Zero @package Phalcon\Encryption\Crypt\Padding -## Methods +### Methods ```php public function pad( int $paddingSize ): string; @@ -779,13 +920,30 @@ public function unpad( string $input, int $blockSize ): int; -

Class Phalcon\Encryption\Security

+## Encryption\Security -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security.zep) -| Namespace | Phalcon\Encryption | -| Uses | Phalcon\Di\DiInterface, Phalcon\Di\AbstractInjectionAware, Phalcon\Http\RequestInterface, Phalcon\Encryption\Security\Random, Phalcon\Encryption\Security\Exception, Phalcon\Session\ManagerInterface | -| Extends | AbstractInjectionAware | + +- __Namespace__ + + - `Phalcon\Encryption` + +- __Uses__ + + - `Phalcon\Di\AbstractInjectionAware` + - `Phalcon\Di\DiInterface` + - `Phalcon\Encryption\Security\Exception` + - `Phalcon\Encryption\Security\Random` + - `Phalcon\Http\RequestInterface` + - `Phalcon\Session\ManagerInterface` + +- __Extends__ + + `AbstractInjectionAware` + +- __Implements__ + This component provides a set of functions to improve the security in Phalcon applications @@ -804,7 +962,7 @@ if ($user) { ``` -## Constants +### Constants ```php const CRYPT_ARGON2I = 10; const CRYPT_ARGON2ID = 11; @@ -821,66 +979,66 @@ const CRYPT_SHA512 = 9; const CRYPT_STD_DES = 1; ``` -## Properties +### Properties ```php /** * @var int */ -protected defaultHash; +protected $defaultHash; /** * @var int */ -protected numberBytes = 16; +protected $numberBytes = 16; /** * @var Random */ -protected random; +protected $random; /** * @var string|null */ -protected requestToken; +protected $requestToken; /** * @var string|null */ -protected token; +protected $token; /** * @var string|null */ -protected tokenKey; +protected $tokenKey; /** * @var string */ -protected tokenKeySessionId = $PHALCON/CSRF/KEY$; +protected $tokenKeySessionId = $PHALCON/CSRF/KEY$; /** * @var string */ -protected tokenValueSessionId = $PHALCON/CSRF$; +protected $tokenValueSessionId = $PHALCON/CSRF$; /** * @var int */ -protected workFactor = 10; +protected $workFactor = 10; /** * @var SessionInterface|null */ -private localSession; +private $localSession; /** * @var RequestInterface|null */ -private localRequest; +private $localRequest; ``` -## Methods +### Methods ```php public function __construct( SessionInterface $session = null, RequestInterface $request = null ); @@ -1017,12 +1175,24 @@ protected function getLocalService( string $name, string $property ); -

Class Phalcon\Encryption\Security\Exception

+## Encryption\Security\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Encryption\Security` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/Exception.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\Encryption\Security | -| Extends | \Exception | +- __Implements__ + Phalcon\Encryption\Security\Exception @@ -1030,48 +1200,75 @@ Exceptions thrown in Phalcon\Security will use this class -

Class Phalcon\Encryption\Security\JWT\Builder

+## Encryption\Security\JWT\Builder -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Builder.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Builder.zep) -| Namespace | Phalcon\Encryption\Security\JWT | -| Uses | Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException, Phalcon\Encryption\Security\JWT\Signer\SignerInterface, Phalcon\Encryption\Security\JWT\Token\Enum, Phalcon\Encryption\Security\JWT\Token\Item, Phalcon\Encryption\Security\JWT\Token\Signature, Phalcon\Encryption\Security\JWT\Token\Token, Phalcon\Support\Collection, Phalcon\Support\Collection\CollectionInterface, Phalcon\Support\Helper\Json\Encode | -JWT Builder +- __Namespace__ + + - `Phalcon\Encryption\Security\JWT` + +- __Uses__ + + - `Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException` + - `Phalcon\Encryption\Security\JWT\Signer\SignerInterface` + - `Phalcon\Encryption\Security\JWT\Token\Enum` + - `Phalcon\Encryption\Security\JWT\Token\Item` + - `Phalcon\Encryption\Security\JWT\Token\Signature` + - `Phalcon\Encryption\Security\JWT\Token\Token` + - `Phalcon\Support\Collection` + - `Phalcon\Support\Collection\CollectionInterface` + - `Phalcon\Support\Helper\Json\Encode` + +- __Extends__ + + +- __Implements__ + + +Builder + +The builder offers + +@property CollectionInterface $claims +@property CollectionInterface $jose +@property string $passphrase +@property SignerInterface $signer @link https://tools.ietf.org/html/rfc7519 -## Properties +### Properties ```php /** * @var CollectionInterface */ -private claims; +private $claims; /** * @var Encode */ -private encode; +private $encode; /** * @var CollectionInterface */ -private jose; +private $jose; /** * @var string */ -private passphrase; +private $passphrase; /** * @var SignerInterface */ -private signer; +private $signer; ``` -## Methods +### Methods ```php public function __construct( SignerInterface $signer ); @@ -1088,7 +1285,7 @@ Adds a custom claim ```php public function addHeader( string $name, mixed $value ): Builder; ``` -Adds a custom header +Adds a custom claim ```php @@ -1272,50 +1469,86 @@ Sets a registered claim -

Class Phalcon\Encryption\Security\JWT\Exceptions\UnsupportedAlgorithmException

+## Encryption\Security\JWT\Exceptions\UnsupportedAlgorithmException + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Exceptions/UnsupportedAlgorithmException.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Exceptions/UnsupportedAlgorithmException.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Exceptions | -| Uses | Exception | -| Extends | Exception | + - `Phalcon\Encryption\Security\JWT\Exceptions` + +- __Uses__ + + - `Exception` + +- __Extends__ + + `Exception` + +- __Implements__ + Exception thrown when the algorithm is not supported for JWT -

Class Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException

+## Encryption\Security\JWT\Exceptions\ValidatorException + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Exceptions/ValidatorException.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Exceptions/ValidatorException.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Exceptions | -| Uses | Exception | -| Extends | Exception | + - `Phalcon\Encryption\Security\JWT\Exceptions` + +- __Uses__ + + - `Exception` + +- __Extends__ + + `Exception` + +- __Implements__ + Exception thrown when the validation does not pass for JWT -

Abstract Class Phalcon\Encryption\Security\JWT\Signer\AbstractSigner

+## Encryption\Security\JWT\Signer\AbstractSigner ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Signer/AbstractSigner.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Signer/AbstractSigner.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Signer | -| Implements | SignerInterface | + - `Phalcon\Encryption\Security\JWT\Signer` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `SignerInterface` Abstract class helping with the signer classes -## Properties +### Properties ```php /** * @var string */ -protected algorithm = ""; +protected $algorithm = ; ``` -## Methods +### Methods ```php public function getAlgorithm(): string; @@ -1325,18 +1558,30 @@ public function getAlgorithm(): string; -

Class Phalcon\Encryption\Security\JWT\Signer\Hmac

+## Encryption\Security\JWT\Signer\Hmac + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Signer/Hmac.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Signer/Hmac.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Signer | -| Uses | Phalcon\Encryption\Security\JWT\Exceptions\UnsupportedAlgorithmException | -| Extends | AbstractSigner | + - `Phalcon\Encryption\Security\JWT\Signer` + +- __Uses__ + + - `Phalcon\Encryption\Security\JWT\Exceptions\UnsupportedAlgorithmException` + +- __Extends__ + + `AbstractSigner` + +- __Implements__ + HMAC signing class -## Methods +### Methods ```php public function __construct( string $algo = string ); @@ -1364,17 +1609,29 @@ Verify a passed source with a payload and passphrase -

Class Phalcon\Encryption\Security\JWT\Signer\None

+## Encryption\Security\JWT\Signer\None + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Signer/None.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Signer/None.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Signer | -| Implements | SignerInterface | + - `Phalcon\Encryption\Security\JWT\Signer` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `SignerInterface` No signing class -## Methods +### Methods ```php public function getAlgHeader(): string; @@ -1402,16 +1659,28 @@ Verify a passed source with a payload and passphrase -

Interface Phalcon\Encryption\Security\JWT\Signer\SignerInterface

+## Encryption\Security\JWT\Signer\SignerInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Signer/SignerInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Signer/SignerInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Signer | + - `Phalcon\Encryption\Security\JWT\Signer` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for JWT Signer classes -## Methods +### Methods ```php public function getAlgHeader(): string; @@ -1439,25 +1708,37 @@ Verify a passed source with a payload and passphrase -

Abstract Class Phalcon\Encryption\Security\JWT\Token\AbstractItem

+## Encryption\Security\JWT\Token\AbstractItem ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Token/AbstractItem.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Token/AbstractItem.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Token | + - `Phalcon\Encryption\Security\JWT\Token` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Abstract helper class for Tokens -## Properties +### Properties ```php /** * @var array */ -protected data; +protected $data; ``` -## Methods +### Methods ```php public function getEncoded(): string; @@ -1467,18 +1748,30 @@ public function getEncoded(): string; -

Class Phalcon\Encryption\Security\JWT\Token\Enum

+## Encryption\Security\JWT\Token\Enum + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Token/Enum.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Token/Enum.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Token | + - `Phalcon\Encryption\Security\JWT\Token` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Constants for Tokens. It offers constants for Headers as well as Claims @link https://tools.ietf.org/html/rfc7519 -## Constants +### Constants ```php const ALGO = alg; const AUDIENCE = aud; @@ -1493,17 +1786,29 @@ const TYPE = typ; ``` -

Class Phalcon\Encryption\Security\JWT\Token\Item

+## Encryption\Security\JWT\Token\Item + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Token/Item.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Token/Item.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Token | -| Extends | AbstractItem | + - `Phalcon\Encryption\Security\JWT\Token` + +- __Uses__ + + +- __Extends__ + + `AbstractItem` + +- __Implements__ + Storage class for a Token Item -## Methods +### Methods ```php public function __construct( array $payload, string $encoded ); @@ -1531,12 +1836,25 @@ public function has( string $name ): bool; -

Class Phalcon\Encryption\Security\JWT\Token\Parser

+## Encryption\Security\JWT\Token\Parser + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Token/Parser.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Token/Parser.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Token | -| Uses | InvalidArgumentException, Phalcon\Support\Helper\Json\Decode | + - `Phalcon\Encryption\Security\JWT\Token` + +- __Uses__ + + - `InvalidArgumentException` + - `Phalcon\Support\Helper\Json\Decode` + +- __Extends__ + + +- __Implements__ + Token Parser class. @@ -1545,16 +1863,16 @@ three parts. The headers are decoded, then the claims and finally the signature. It returns a token object populated with the decoded information. -## Properties +### Properties ```php /** * @var Decode */ -private decode; +private $decode; ``` -## Methods +### Methods ```php public function __construct( Decode $decode = null ); @@ -1570,17 +1888,29 @@ Parse a token and return it -

Class Phalcon\Encryption\Security\JWT\Token\Signature

+## Encryption\Security\JWT\Token\Signature + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Token/Signature.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Token/Signature.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Token | -| Extends | AbstractItem | + - `Phalcon\Encryption\Security\JWT\Token` + +- __Uses__ + + +- __Extends__ + + `AbstractItem` + +- __Implements__ + Signature class containing the encoded data and the hash. -## Methods +### Methods ```php public function __construct( string $hash = string, string $encoded = string ); @@ -1596,12 +1926,25 @@ public function getHash(): string; -

Class Phalcon\Encryption\Security\JWT\Token\Token

+## Encryption\Security\JWT\Token\Token + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Token/Token.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Token/Token.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT\Token | -| Uses | Phalcon\Encryption\Security\JWT\Signer\SignerInterface, Phalcon\Encryption\Security\JWT\Validator | + - `Phalcon\Encryption\Security\JWT\Token` + +- __Uses__ + + - `Phalcon\Encryption\Security\JWT\Signer\SignerInterface` + - `Phalcon\Encryption\Security\JWT\Validator` + +- __Extends__ + + +- __Implements__ + Token Class. @@ -1611,26 +1954,26 @@ and payload. It also calculates and returns the token string. @link https://tools.ietf.org/html/rfc7519 -## Properties +### Properties ```php /** * @var Item */ -private claims; +private $claims; /** * @var Item */ -private headers; +private $headers; /** * @var Signature */ -private signature; +private $signature; ``` -## Methods +### Methods ```php public function __construct( Item $headers, Item $claims, Signature $signature ); @@ -1682,41 +2025,56 @@ Verify the signature -

Class Phalcon\Encryption\Security\JWT\Validator

+## Encryption\Security\JWT\Validator + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/JWT/Validator.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/JWT/Validator.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security\JWT | -| Uses | Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException, Phalcon\Encryption\Security\JWT\Signer\SignerInterface, Phalcon\Encryption\Security\JWT\Token\Enum, Phalcon\Encryption\Security\JWT\Token\Token | + - `Phalcon\Encryption\Security\JWT` + +- __Uses__ + + - `Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException` + - `Phalcon\Encryption\Security\JWT\Signer\SignerInterface` + - `Phalcon\Encryption\Security\JWT\Token\Enum` + - `Phalcon\Encryption\Security\JWT\Token\Token` + +- __Extends__ + + +- __Implements__ + Class Validator -## Properties +### Properties ```php /** * @var array */ -private claims; +private $claims; /** * @var array */ -private errors; +private $errors; /** * @var int */ -private timeShift = 0; +private $timeShift = ; /** * @var Token */ -private token; +private $token; ``` -## Methods +### Methods ```php public function __construct( Token $token, int $timeShift = int ); @@ -1792,11 +2150,23 @@ Validate the signature of the token -

Class Phalcon\Encryption\Security\Random

+## Encryption\Security\Random + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Encryption/Security/Random.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Encryption/Security/Random.zep) +- __Namespace__ -| Namespace | Phalcon\Encryption\Security | + - `Phalcon\Encryption\Security` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Encryption\Security\Random @@ -1863,7 +2233,7 @@ This class partially borrows SecureRandom library from Ruby @link https://ruby-doc.org/stdlib-2.2.2/libdoc/securerandom/rdoc/SecureRandom.html -## Methods +### Methods ```php public function base58( int $len = null ): string; @@ -2040,3 +2410,5 @@ Generates a random string based on the number ($base) of characters If $n is not specified, 16 is assumed. It may be larger in future. @throws Exception If secure random number generator is not available or unexpected partial read + + diff --git a/docs/api/phalcon_events.md b/docs/api/phalcon_events.md index f1908ec42..dddd5bcd3 100644 --- a/docs/api/phalcon_events.md +++ b/docs/api/phalcon_events.md @@ -1,31 +1,46 @@ -* [Phalcon\Events\AbstractEventsAware](#events-abstracteventsaware) -* [Phalcon\Events\Event](#events-event) -* [Phalcon\Events\EventInterface](#events-eventinterface) -* [Phalcon\Events\EventsAwareInterface](#events-eventsawareinterface) -* [Phalcon\Events\Exception](#events-exception) -* [Phalcon\Events\Manager](#events-manager) -* [Phalcon\Events\ManagerInterface](#events-managerinterface) +--- +hide: + - navigation +--- -

Abstract Class Phalcon\Events\AbstractEventsAware

+!!! info "NOTE" -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/AbstractEventsAware.zep) + All classes are prefixed with `Phalcon` -| Namespace | Phalcon\Events | -| Uses | Phalcon\Events\ManagerInterface | + + +## Events\AbstractEventsAware ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/AbstractEventsAware.zep) + + +- __Namespace__ + + - `Phalcon\Events` + +- __Uses__ + + - `Phalcon\Events\ManagerInterface` + +- __Extends__ + + +- __Implements__ + This abstract class offers access to the events manager -## Properties +### Properties ```php /** * @var ManagerInterface|null */ -protected eventsManager; +protected $eventsManager; ``` -## Methods +### Methods ```php public function getEventsManager(): ManagerInterface | null; @@ -47,12 +62,24 @@ Helper method to fire an event -

Class Phalcon\Events\Event

+## Events\Event + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/Event.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/Event.zep) +- __Namespace__ -| Namespace | Phalcon\Events | -| Implements | EventInterface | + - `Phalcon\Events` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `EventInterface` This class offers contextual information of a fired event in the EventsManager @@ -67,46 +94,46 @@ if ($event->isCancelable()) { ``` -## Properties +### Properties ```php /** * Is event cancelable? * * @var bool */ -protected cancelable; +protected $cancelable; /** * Event data * * @var mixed */ -protected data; +protected $data; /** * Event source * * @var object|null */ -protected source; +protected $source; /** * Is event propagation stopped? * * @var bool */ -protected stopped = false; +protected $stopped = false; /** * Event type * * @var string */ -protected type; +protected $type; ``` -## Methods +### Methods ```php public function __construct( string $type, mixed $source = null, mixed $data = null, bool $cancelable = bool ); @@ -176,16 +203,28 @@ if ($event->isCancelable()) { -

Interface Phalcon\Events\EventInterface

+## Events\EventInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/EventInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/EventInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Events | + - `Phalcon\Events` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Events\Event class -## Methods +### Methods ```php public function getData(): mixed; @@ -231,17 +270,29 @@ Stops the event preventing propagation -

Interface Phalcon\Events\EventsAwareInterface

+## Events\EventsAwareInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/EventsAwareInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/EventsAwareInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Events | + - `Phalcon\Events` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + This interface must for those classes that accept an EventsManager and dispatch events -## Methods +### Methods ```php public function getEventsManager(): ManagerInterface | null; @@ -257,24 +308,49 @@ Sets the events manager -

Class Phalcon\Events\Exception

+## Events\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/Exception.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/Exception.zep) +- __Namespace__ -| Namespace | Phalcon\Events | -| Extends | \Exception | + - `Phalcon\Events` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Events will use this class -

Class Phalcon\Events\Manager

+## Events\Manager + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/Manager.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/Manager.zep) +- __Namespace__ -| Namespace | Phalcon\Events | -| Uses | Closure, SplPriorityQueue | -| Implements | ManagerInterface | + - `Phalcon\Events` + +- __Uses__ + + - `Closure` + - `SplPriorityQueue` + +- __Extends__ + + +- __Implements__ + + - `ManagerInterface` Phalcon Events Manager, offers an easy way to intercept and manipulate, if needed, the normal flow of operation. With the EventsManager the developer @@ -282,36 +358,36 @@ can create hooks or plugins that will offer monitoring of data, manipulation, conditional execution and much more. -## Constants +### Constants ```php const DEFAULT_PRIORITY = 100; ``` -## Properties +### Properties ```php /** * @var bool */ -protected collect = false; +protected $collect = false; /** * @var bool */ -protected enablePriorities = false; +protected $enablePriorities = false; /** * @var array */ -protected events; +protected $events; /** * @var array */ -protected responses; +protected $responses; ``` -## Methods +### Methods ```php public function arePrioritiesEnabled(): bool; @@ -409,16 +485,28 @@ public function isValidHandler( mixed $handler ): bool; -

Interface Phalcon\Events\ManagerInterface

+## Events\ManagerInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Events/ManagerInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Events/ManagerInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Events | + - `Phalcon\Events` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Events managers. -## Methods +### Methods ```php public function attach( string $eventType, mixed $handler ): void; @@ -455,3 +543,5 @@ Returns all the attached listeners of a certain type public function hasListeners( string $type ): bool; ``` Check whether certain type of event has listeners + + diff --git a/docs/api/phalcon_factory.md b/docs/api/phalcon_factory.md index 61c7dad12..268d48a52 100644 --- a/docs/api/phalcon_factory.md +++ b/docs/api/phalcon_factory.md @@ -1,14 +1,32 @@ +--- +hide: + - navigation +--- -* [Phalcon\Factory\AbstractConfigFactory](#factory-abstractconfigfactory) -* [Phalcon\Factory\AbstractFactory](#factory-abstractfactory) -* [Phalcon\Factory\Exception](#factory-exception) +!!! info "NOTE" -

Abstract Class Phalcon\Factory\AbstractConfigFactory

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Factory/AbstractConfigFactory.zep) -| Namespace | Phalcon\Factory | -| Uses | Phalcon\Config\ConfigInterface | + +## Factory\AbstractConfigFactory ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Factory/AbstractConfigFactory.zep) + + +- __Namespace__ + + - `Phalcon\Factory` + +- __Uses__ + + - `Phalcon\Config\ConfigInterface` + +- __Extends__ + + +- __Implements__ + This file is part of the Phalcon Framework. @@ -18,7 +36,7 @@ For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code. -## Methods +### Methods ```php protected function checkConfig( mixed $config ): array; @@ -46,13 +64,25 @@ protected function getExceptionClass(): string; -

Abstract Class Phalcon\Factory\AbstractFactory

+## Factory\AbstractFactory ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Factory/AbstractFactory.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Factory/AbstractFactory.zep) +- __Namespace__ -| Namespace | Phalcon\Factory | -| Uses | Phalcon\Config\ConfigInterface | -| Extends | AbstractConfigFactory | + - `Phalcon\Factory` + +- __Uses__ + + - `Phalcon\Config\ConfigInterface` + +- __Extends__ + + `AbstractConfigFactory` + +- __Implements__ + This file is part of the Phalcon Framework. @@ -62,21 +92,21 @@ For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code. -## Properties +### Properties ```php /** * @var array */ -protected mapper; +protected $mapper; /** * @var array */ -protected services; +protected $services; ``` -## Methods +### Methods ```php protected function getService( string $name ): mixed; @@ -98,12 +128,24 @@ Initialize services/add new services -

Class Phalcon\Factory\Exception

+## Factory\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Factory/Exception.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Factory/Exception.zep) +- __Namespace__ -| Namespace | Phalcon\Factory | -| Extends | \Exception | + - `Phalcon\Factory` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + This file is part of the Phalcon Framework. @@ -111,3 +153,4 @@ This file is part of the Phalcon Framework. For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code. + diff --git a/docs/api/phalcon_filter.md b/docs/api/phalcon_filter.md index a425b48d7..c82b1bcdf 100644 --- a/docs/api/phalcon_filter.md +++ b/docs/api/phalcon_filter.md @@ -1,77 +1,32 @@ +--- +hide: + - navigation +--- -* [Phalcon\Filter\Exception](#filter-exception) -* [Phalcon\Filter\Filter](#filter-filter) -* [Phalcon\Filter\FilterFactory](#filter-filterfactory) -* [Phalcon\Filter\FilterInterface](#filter-filterinterface) -* [Phalcon\Filter\Sanitize\AbsInt](#filter-sanitize-absint) -* [Phalcon\Filter\Sanitize\Alnum](#filter-sanitize-alnum) -* [Phalcon\Filter\Sanitize\Alpha](#filter-sanitize-alpha) -* [Phalcon\Filter\Sanitize\BoolVal](#filter-sanitize-boolval) -* [Phalcon\Filter\Sanitize\Email](#filter-sanitize-email) -* [Phalcon\Filter\Sanitize\FloatVal](#filter-sanitize-floatval) -* [Phalcon\Filter\Sanitize\IntVal](#filter-sanitize-intval) -* [Phalcon\Filter\Sanitize\Lower](#filter-sanitize-lower) -* [Phalcon\Filter\Sanitize\LowerFirst](#filter-sanitize-lowerfirst) -* [Phalcon\Filter\Sanitize\Regex](#filter-sanitize-regex) -* [Phalcon\Filter\Sanitize\Remove](#filter-sanitize-remove) -* [Phalcon\Filter\Sanitize\Replace](#filter-sanitize-replace) -* [Phalcon\Filter\Sanitize\Special](#filter-sanitize-special) -* [Phalcon\Filter\Sanitize\SpecialFull](#filter-sanitize-specialfull) -* [Phalcon\Filter\Sanitize\StringVal](#filter-sanitize-stringval) -* [Phalcon\Filter\Sanitize\StringValLegacy](#filter-sanitize-stringvallegacy) -* [Phalcon\Filter\Sanitize\Striptags](#filter-sanitize-striptags) -* [Phalcon\Filter\Sanitize\Trim](#filter-sanitize-trim) -* [Phalcon\Filter\Sanitize\Upper](#filter-sanitize-upper) -* [Phalcon\Filter\Sanitize\UpperFirst](#filter-sanitize-upperfirst) -* [Phalcon\Filter\Sanitize\UpperWords](#filter-sanitize-upperwords) -* [Phalcon\Filter\Sanitize\Url](#filter-sanitize-url) -* [Phalcon\Filter\Validation](#filter-validation) -* [Phalcon\Filter\Validation\AbstractCombinedFieldsValidator](#filter-validation-abstractcombinedfieldsvalidator) -* [Phalcon\Filter\Validation\AbstractValidator](#filter-validation-abstractvalidator) -* [Phalcon\Filter\Validation\AbstractValidatorComposite](#filter-validation-abstractvalidatorcomposite) -* [Phalcon\Filter\Validation\Exception](#filter-validation-exception) -* [Phalcon\Filter\Validation\ValidationInterface](#filter-validation-validationinterface) -* [Phalcon\Filter\Validation\Validator\Alnum](#filter-validation-validator-alnum) -* [Phalcon\Filter\Validation\Validator\Alpha](#filter-validation-validator-alpha) -* [Phalcon\Filter\Validation\Validator\Between](#filter-validation-validator-between) -* [Phalcon\Filter\Validation\Validator\Callback](#filter-validation-validator-callback) -* [Phalcon\Filter\Validation\Validator\Confirmation](#filter-validation-validator-confirmation) -* [Phalcon\Filter\Validation\Validator\CreditCard](#filter-validation-validator-creditcard) -* [Phalcon\Filter\Validation\Validator\Date](#filter-validation-validator-date) -* [Phalcon\Filter\Validation\Validator\Digit](#filter-validation-validator-digit) -* [Phalcon\Filter\Validation\Validator\Email](#filter-validation-validator-email) -* [Phalcon\Filter\Validation\Validator\Exception](#filter-validation-validator-exception) -* [Phalcon\Filter\Validation\Validator\ExclusionIn](#filter-validation-validator-exclusionin) -* [Phalcon\Filter\Validation\Validator\File](#filter-validation-validator-file) -* [Phalcon\Filter\Validation\Validator\File\AbstractFile](#filter-validation-validator-file-abstractfile) -* [Phalcon\Filter\Validation\Validator\File\MimeType](#filter-validation-validator-file-mimetype) -* [Phalcon\Filter\Validation\Validator\File\Resolution\Equal](#filter-validation-validator-file-resolution-equal) -* [Phalcon\Filter\Validation\Validator\File\Resolution\Max](#filter-validation-validator-file-resolution-max) -* [Phalcon\Filter\Validation\Validator\File\Resolution\Min](#filter-validation-validator-file-resolution-min) -* [Phalcon\Filter\Validation\Validator\File\Size\Equal](#filter-validation-validator-file-size-equal) -* [Phalcon\Filter\Validation\Validator\File\Size\Max](#filter-validation-validator-file-size-max) -* [Phalcon\Filter\Validation\Validator\File\Size\Min](#filter-validation-validator-file-size-min) -* [Phalcon\Filter\Validation\Validator\Identical](#filter-validation-validator-identical) -* [Phalcon\Filter\Validation\Validator\InclusionIn](#filter-validation-validator-inclusionin) -* [Phalcon\Filter\Validation\Validator\Ip](#filter-validation-validator-ip) -* [Phalcon\Filter\Validation\Validator\Numericality](#filter-validation-validator-numericality) -* [Phalcon\Filter\Validation\Validator\PresenceOf](#filter-validation-validator-presenceof) -* [Phalcon\Filter\Validation\Validator\Regex](#filter-validation-validator-regex) -* [Phalcon\Filter\Validation\Validator\StringLength](#filter-validation-validator-stringlength) -* [Phalcon\Filter\Validation\Validator\StringLength\Max](#filter-validation-validator-stringlength-max) -* [Phalcon\Filter\Validation\Validator\StringLength\Min](#filter-validation-validator-stringlength-min) -* [Phalcon\Filter\Validation\Validator\Uniqueness](#filter-validation-validator-uniqueness) -* [Phalcon\Filter\Validation\Validator\Url](#filter-validation-validator-url) -* [Phalcon\Filter\Validation\ValidatorCompositeInterface](#filter-validation-validatorcompositeinterface) -* [Phalcon\Filter\Validation\ValidatorFactory](#filter-validation-validatorfactory) -* [Phalcon\Filter\Validation\ValidatorInterface](#filter-validation-validatorinterface) - -

Class Phalcon\Filter\Exception

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Exception.zep) - -| Namespace | Phalcon\Filter | -| Extends | \Exception | +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Filter\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Filter` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Phalcon\Filter\Exception @@ -79,16 +34,30 @@ Exceptions thrown in Phalcon\Filter will use this class -

Class Phalcon\Filter\Filter

+## Filter\Filter + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Filter.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Filter.zep) -| Namespace | Phalcon\Filter | -| Implements | FilterInterface | +- __Namespace__ + + - `Phalcon\Filter` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + + - `FilterInterface` Lazy loads, stores and exposes sanitizer objects -## Constants + + +### Constants ```php const FILTER_ABSINT = absint; const FILTER_ALNUM = alnum; @@ -114,21 +83,21 @@ const FILTER_UPPERWORDS = upperwords; const FILTER_URL = url; ``` -## Properties +### Properties ```php /** * @var array */ -protected mapper; +protected $mapper; /** * @var array */ -protected services; +protected $services; ``` -## Methods +### Methods ```php public function __call( string $name, array $args ); @@ -175,19 +144,31 @@ Loads the objects in the internal mapper array -

Class Phalcon\Filter\FilterFactory

+## Filter\FilterFactory -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/FilterFactory.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/FilterFactory.zep) -| Namespace | Phalcon\Filter | -| Uses | Phalcon\Filter\Filter | + +- __Namespace__ + + - `Phalcon\Filter` + +- __Uses__ + + - `Phalcon\Filter\Filter` + +- __Extends__ + + +- __Implements__ + Class FilterFactory @package Phalcon\Filter -## Methods +### Methods ```php public function newInstance(): FilterInterface; @@ -204,16 +185,28 @@ Returns the available adapters -

Interface Phalcon\Filter\FilterInterface

+## Filter\FilterInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/FilterInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/FilterInterface.zep) -| Namespace | Phalcon\Filter | +- __Namespace__ + + - `Phalcon\Filter` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Lazy loads, stores and exposes sanitizer objects -## Methods +### Methods ```php public function sanitize( mixed $value, mixed $sanitizers, bool $noRecursive = bool ): mixed; @@ -223,18 +216,30 @@ Sanitizes a value with a specified single or set of sanitizers -

Class Phalcon\Filter\Sanitize\AbsInt

+## Filter\Sanitize\AbsInt + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/AbsInt.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/AbsInt.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Sanitize | + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\AbsInt Sanitizes a value to absolute integer -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -244,18 +249,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\Alnum

+## Filter\Sanitize\Alnum + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Alnum.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Alnum.zep) + - `Phalcon\Filter\Sanitize` -| Namespace | Phalcon\Filter\Sanitize | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Alnum Sanitizes a value to an alphanumeric value -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -265,18 +282,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\Alpha

+## Filter\Sanitize\Alpha + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Alpha.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Alpha.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Alpha Sanitizes a value to an alpha value -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -286,18 +315,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\BoolVal

+## Filter\Sanitize\BoolVal + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/BoolVal.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/BoolVal.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\BoolVal Sanitizes a value to boolean -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -307,18 +348,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\Email

+## Filter\Sanitize\Email + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Email.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Email.zep) +- __Extends__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Implements__ + Phalcon\Filter\Sanitize\Email Sanitizes an email string -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -328,18 +381,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\FloatVal

+## Filter\Sanitize\FloatVal -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/FloatVal.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/FloatVal.zep) -| Namespace | Phalcon\Filter\Sanitize | + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\FloatVal Sanitizes a value to float -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -349,18 +414,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\IntVal

+## Filter\Sanitize\IntVal + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/IntVal.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/IntVal.zep) -| Namespace | Phalcon\Filter\Sanitize | +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\IntVal Sanitizes a value to integer -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -370,18 +447,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\Lower

+## Filter\Sanitize\Lower + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Lower.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Lower.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Sanitize | + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Lower Sanitizes a value to lowercase -## Methods +### Methods ```php public function __invoke( string $input ); @@ -391,18 +480,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\LowerFirst

+## Filter\Sanitize\LowerFirst + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/LowerFirst.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/LowerFirst.zep) + - `Phalcon\Filter\Sanitize` -| Namespace | Phalcon\Filter\Sanitize | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\LowerFirst Sanitizes a value to lcfirst -## Methods +### Methods ```php public function __invoke( string $input ); @@ -412,18 +513,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\Regex

+## Filter\Sanitize\Regex + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Regex.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Regex.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Regex Sanitizes a value performing preg_replace -## Methods +### Methods ```php public function __invoke( mixed $input, mixed $pattern, mixed $replace ); @@ -433,18 +546,30 @@ public function __invoke( mixed $input, mixed $pattern, mixed $replace ); -

Class Phalcon\Filter\Sanitize\Remove

+## Filter\Sanitize\Remove + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Remove.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Remove.zep) +- __Extends__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Implements__ + Phalcon\Filter\Sanitize\Remove Sanitizes a value removing parts of a string -## Methods +### Methods ```php public function __invoke( mixed $input, mixed $replace ); @@ -454,18 +579,30 @@ public function __invoke( mixed $input, mixed $replace ); -

Class Phalcon\Filter\Sanitize\Replace

+## Filter\Sanitize\Replace -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Replace.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Replace.zep) -| Namespace | Phalcon\Filter\Sanitize | + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Replace Sanitizes a value replacing parts of a string -## Methods +### Methods ```php public function __invoke( mixed $input, mixed $from, mixed $to ); @@ -475,18 +612,30 @@ public function __invoke( mixed $input, mixed $from, mixed $to ); -

Class Phalcon\Filter\Sanitize\Special

+## Filter\Sanitize\Special + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Special.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Special.zep) -| Namespace | Phalcon\Filter\Sanitize | +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Special Sanitizes a value special characters -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -496,18 +645,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\SpecialFull

+## Filter\Sanitize\SpecialFull + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/SpecialFull.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/SpecialFull.zep) -| Namespace | Phalcon\Filter\Sanitize | +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\SpecialFull Sanitizes a value special characters (htmlspecialchars() and ENT_QUOTES) -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -517,16 +678,28 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\StringVal

+## Filter\Sanitize\StringVal + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/StringVal.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/StringVal.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Sanitize | + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Sanitizes a value to string -## Methods +### Methods ```php public function __invoke( string $input, int $flags = int ): string; @@ -536,11 +709,23 @@ public function __invoke( string $input, int $flags = int ): string; -

Class Phalcon\Filter\Sanitize\StringValLegacy

+## Filter\Sanitize\StringValLegacy + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/StringValLegacy.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/StringValLegacy.zep) + - `Phalcon\Filter\Sanitize` -| Namespace | Phalcon\Filter\Sanitize | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Sanitizes a value to string using `filter_var()`. The filter provides backwards compatibility with versions prior to v5. For PHP higher or equal to @@ -548,7 +733,7 @@ backwards compatibility with versions prior to v5. For PHP higher or equal to string is passed, the method will return false -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -558,18 +743,30 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Sanitize\Striptags

+## Filter\Sanitize\Striptags + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Striptags.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Striptags.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Striptags Sanitizes a value striptags -## Methods +### Methods ```php public function __invoke( string $input ); @@ -579,18 +776,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\Trim

+## Filter\Sanitize\Trim + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Trim.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Trim.zep) +- __Extends__ + -| Namespace | Phalcon\Filter\Sanitize | +- __Implements__ + Phalcon\Filter\Sanitize\Trim Sanitizes a value removing leading and trailing spaces -## Methods +### Methods ```php public function __invoke( string $input ); @@ -600,18 +809,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\Upper

+## Filter\Sanitize\Upper -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Upper.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Upper.zep) -| Namespace | Phalcon\Filter\Sanitize | + +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Upper Sanitizes a value to uppercase -## Methods +### Methods ```php public function __invoke( string $input ); @@ -621,18 +842,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\UpperFirst

+## Filter\Sanitize\UpperFirst + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/UpperFirst.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/UpperFirst.zep) -| Namespace | Phalcon\Filter\Sanitize | +- __Namespace__ + + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\UpperFirst Sanitizes a value to ucfirst -## Methods +### Methods ```php public function __invoke( string $input ); @@ -642,18 +875,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\UpperWords

+## Filter\Sanitize\UpperWords + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/UpperWords.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/UpperWords.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Sanitize | + - `Phalcon\Filter\Sanitize` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\UpperWords Sanitizes a value to uppercase the first character of each word -## Methods +### Methods ```php public function __invoke( string $input ); @@ -663,18 +908,30 @@ public function __invoke( string $input ); -

Class Phalcon\Filter\Sanitize\Url

+## Filter\Sanitize\Url + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Url.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Sanitize/Url.zep) + - `Phalcon\Filter\Sanitize` -| Namespace | Phalcon\Filter\Sanitize | +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Phalcon\Filter\Sanitize\Url Sanitizes a value url -## Methods +### Methods ```php public function __invoke( mixed $input ); @@ -684,67 +941,88 @@ public function __invoke( mixed $input ); -

Class Phalcon\Filter\Validation

+## Filter\Validation + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation.zep) + - `Phalcon\Filter` -| Namespace | Phalcon\Filter | -| Uses | Phalcon\Di\Di, Phalcon\Di\DiInterface, Phalcon\Di\Injectable, Phalcon\Filter\FilterInterface, Phalcon\Messages\MessageInterface, Phalcon\Messages\Messages, Phalcon\Filter\Validation\ValidationInterface, Phalcon\Filter\Validation\Exception, Phalcon\Filter\Validation\ValidatorInterface, Phalcon\Filter\Validation\AbstractCombinedFieldsValidator | -| Extends | Injectable | -| Implements | ValidationInterface | +- __Uses__ + + - `Phalcon\Di\Di` + - `Phalcon\Di\DiInterface` + - `Phalcon\Di\Injectable` + - `Phalcon\Filter\FilterInterface` + - `Phalcon\Filter\Validation\AbstractCombinedFieldsValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Filter\Validation\ValidationInterface` + - `Phalcon\Filter\Validation\ValidatorInterface` + - `Phalcon\Messages\MessageInterface` + - `Phalcon\Messages\Messages` + +- __Extends__ + + `Injectable` + +- __Implements__ + + - `ValidationInterface` Allows to validate data using custom or built-in validators -## Properties +### Properties ```php /** * @var array */ -protected combinedFieldsValidators; +protected $combinedFieldsValidators; /** * @var mixed */ -protected data; +protected $data; /** * @var object|null */ -protected entity; +protected $entity; /** * @var array */ -protected filters; +protected $filters; /** * @var array */ -protected labels; +protected $labels; /** * @var Messages|null */ -protected messages; +protected $messages; /** * List of validators * * @var array */ -protected validators; +protected $validators; /** * Calculated values * * @var array */ -protected values; +protected $values; ``` -## Methods +### Methods ```php public function __construct( array $validators = [] ); @@ -862,7 +1140,7 @@ public function setValidators( array $validators ): Validation; ```php -public function validate( mixed $data = null, mixed $entity = null ): Messages; +public function validate( mixed $data = null, mixed $entity = null ): Messages | bool; ``` Validate a set of data according to a set of rules @@ -875,52 +1153,78 @@ Internal validations, if it returns true, then skip the current validator -

Abstract Class Phalcon\Filter\Validation\AbstractCombinedFieldsValidator

+## Filter\Validation\AbstractCombinedFieldsValidator ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/AbstractCombinedFieldsValidator.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/AbstractCombinedFieldsValidator.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Validation | -| Extends | AbstractValidator | +- __Extends__ + + `AbstractValidator` + +- __Implements__ + This is a base class for combined fields validators -

Abstract Class Phalcon\Filter\Validation\AbstractValidator

+## Filter\Validation\AbstractValidator ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/AbstractValidator.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Messages\Message` + - `Phalcon\Support\Helper\Arr\Whitelist` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/AbstractValidator.zep) +- __Extends__ + -| Namespace | Phalcon\Filter\Validation | -| Uses | Phalcon\Support\Helper\Arr\Whitelist, Phalcon\Messages\Message, Phalcon\Filter\Validation | -| Implements | ValidatorInterface | +- __Implements__ + + - `ValidatorInterface` This is a base class for validators -## Properties +### Properties ```php /** - * Message template - * - * @var string|null - */ -protected template; + * Message template + * + * @var string|null + */ +protected $template; /** - * Message templates - * - * @var array - */ -protected templates; + * Message templates + * + * @var array + */ +protected $templates; /** * @var array */ -protected options; +protected $options; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -968,17 +1272,13 @@ Sets an option in the validator ```php public function setTemplate( string $template ): ValidatorInterface; ``` - Set a new template message - - +Set a new template message ```php public function setTemplates( array $templates ): ValidatorInterface; ``` - Clear current templates and set new from an array, - - +Clear current templates and set new from an array, ```php @@ -993,6 +1293,13 @@ protected function allowEmpty( mixed $field, mixed $value ): bool; Checks if field can be empty. +```php +protected function checkArray( mixed $value, string $field ): mixed; +``` +Checks if a value is an array and returns the element based on the +passed field name + + ```php protected function prepareCode( string $field ): int; ``` @@ -1007,28 +1314,40 @@ Prepares a label for the field. -

Abstract Class Phalcon\Filter\Validation\AbstractValidatorComposite

+## Filter\Validation\AbstractValidatorComposite ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/AbstractValidatorComposite.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/AbstractValidatorComposite.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation | -| Uses | Phalcon\Filter\Validation | -| Extends | AbstractValidator | -| Implements | ValidatorCompositeInterface | + - `Phalcon\Filter\Validation` + +- __Uses__ + + - `Phalcon\Filter\Validation` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + + - `ValidatorCompositeInterface` This is a base class for combined fields validators -## Properties +### Properties ```php /** * @var array */ -protected validators; +protected $validators; ``` -## Methods +### Methods ```php public function getValidators(): array; @@ -1044,28 +1363,54 @@ Executes the validation -

Class Phalcon\Filter\Validation\Exception

+## Filter\Validation\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Exception.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Exception.zep) + - `Phalcon\Filter\Validation` -| Namespace | Phalcon\Filter\Validation | -| Extends | \Exception | +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Filter\Validation\* classes will use this class -

Interface Phalcon\Filter\Validation\ValidationInterface

+## Filter\Validation\ValidationInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/ValidationInterface.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/ValidationInterface.zep) +- __Uses__ + + - `Phalcon\Di\Injectable` + - `Phalcon\Messages\MessageInterface` + - `Phalcon\Messages\Messages` -| Namespace | Phalcon\Filter\Validation | -| Uses | Phalcon\Di\Injectable, Phalcon\Messages\MessageInterface, Phalcon\Messages\Messages | +- __Extends__ + + +- __Implements__ + Interface for the Phalcon\Filter\Validation component -## Methods +### Methods ```php public function add( mixed $field, ValidatorInterface $validator ): ValidationInterface; @@ -1147,20 +1492,33 @@ Adds labels for fields ```php -public function validate( mixed $data = null, mixed $entity = null ): Messages; +public function validate( mixed $data = null, mixed $entity = null ): Messages | bool; ``` Validate a set of data according to a set of rules -

Class Phalcon\Filter\Validation\Validator\Alnum

+## Filter\Validation\Validator\Alnum + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Alnum.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Alnum.zep) +- __Extends__ + + `AbstractValidator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Implements__ + Check for alphanumeric character(s) @@ -1196,14 +1554,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must contain only letters and numbers; +protected $template = Field :field must contain only letters and numbers; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1219,13 +1577,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Alpha

+## Filter\Validation\Validator\Alpha + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Alpha.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Alpha.zep) +- __Extends__ + + `AbstractValidator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Implements__ + Check for alphabetic character(s) @@ -1261,14 +1633,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must contain only letters; +protected $template = Field :field must contain only letters; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1284,13 +1656,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Between

+## Filter\Validation\Validator\Between -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Between.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Between.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Validates that a value is between an inclusive range of two values. For a value x, the test is passed if minimum<=x<=maximum. @@ -1337,14 +1723,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be within the range of :min to :max; +protected $template = Field :field must be within the range of :min to :max; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1360,13 +1746,28 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Callback

+## Filter\Validation\Validator\Callback + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Callback.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Callback.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\ValidatorInterface, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\ValidatorInterface` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Calls user function for validation @@ -1412,14 +1813,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must match the callback function; +protected $template = Field :field must match the callback function; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1435,13 +1836,28 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Confirmation

+## Filter\Validation\Validator\Confirmation + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Confirmation.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Confirmation.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Exception, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks that two values have the same value @@ -1482,14 +1898,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be the same as :with; +protected $template = Field :field must be the same as :with; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1511,13 +1927,27 @@ Compare strings -

Class Phalcon\Filter\Validation\Validator\CreditCard

+## Filter\Validation\Validator\CreditCard + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/CreditCard.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/CreditCard.zep) + - `Phalcon\Filter\Validation\Validator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks if a value has a valid credit card number @@ -1553,14 +1983,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field is not valid for a credit card number; +protected $template = Field :field is not valid for a credit card number; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1576,13 +2006,28 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Date

+## Filter\Validation\Validator\Date + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Date.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Date.zep) +- __Uses__ + + - `DateTime` + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | DateTime, Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks if a value is a valid date @@ -1623,14 +2068,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field is not a valid date; +protected $template = Field :field is not a valid date; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1646,13 +2091,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Digit

+## Filter\Validation\Validator\Digit + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Digit.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Digit.zep) +- __Extends__ + + `AbstractValidator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Implements__ + Check for numeric character(s) @@ -1688,14 +2147,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be numeric; +protected $template = Field :field must be numeric; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1711,13 +2170,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Email

+## Filter\Validation\Validator\Email -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Email.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Email.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks if a value has a correct e-mail format @@ -1753,14 +2226,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be an email address; +protected $template = Field :field must be an email address; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1776,25 +2249,52 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Exception

+## Filter\Validation\Validator\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Exception.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Exception.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Extends | \Exception | +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Filter\Validation\Validator\* classes will use this class -

Class Phalcon\Filter\Validation\Validator\ExclusionIn

+## Filter\Validation\Validator\ExclusionIn + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/ExclusionIn.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/ExclusionIn.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator, Phalcon\Filter\Validation\Exception | -| Extends | AbstractValidator | + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Check if a value is not included into a list of values @@ -1841,14 +2341,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must not be a part of list: :domain; +protected $template = Field :field must not be a part of list: :domain; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1864,13 +2364,35 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\File

+## Filter\Validation\Validator\File + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Support\Helper\Arr\Get, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidatorComposite, Phalcon\Filter\Validation\Validator\File\MimeType, Phalcon\Filter\Validation\Validator\File\Resolution\Equal, Phalcon\Filter\Validation\Validator\File\Resolution\Max, Phalcon\Filter\Validation\Validator\File\Resolution\Min, Phalcon\Filter\Validation\Validator\File\Size\Equal, Phalcon\Filter\Validation\Validator\File\Size\Max, Phalcon\Filter\Validation\Validator\File\Size\Min | -| Extends | AbstractValidatorComposite | + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidatorComposite` + - `Phalcon\Filter\Validation\Validator\File\MimeType` + - `Phalcon\Filter\Validation\Validator\File\Resolution\Equal` + - `Phalcon\Filter\Validation\Validator\File\Resolution\Max` + - `Phalcon\Filter\Validation\Validator\File\Resolution\Min` + - `Phalcon\Filter\Validation\Validator\File\Size\Equal` + - `Phalcon\Filter\Validation\Validator\File\Size\Max` + - `Phalcon\Filter\Validation\Validator\File\Size\Min` + - `Phalcon\Messages\Message` + - `Phalcon\Support\Helper\Arr\Get` + +- __Extends__ + + `AbstractValidatorComposite` + +- __Implements__ + Checks if a value has a correct file @@ -1942,7 +2464,7 @@ $validator->add( ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -1952,13 +2474,27 @@ Constructor -

Abstract Class Phalcon\Filter\Validation\Validator\File\AbstractFile

+## Filter\Validation\Validator\File\AbstractFile ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/AbstractFile.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/AbstractFile.zep) + - `Phalcon\Filter\Validation\Validator\File` -| Namespace | Phalcon\Filter\Validation\Validator\File | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks if a value has a correct file @@ -1999,71 +2535,61 @@ $validator->add( ``` -## Properties +### Properties ```php /** * Empty is empty * * @var string */ -protected messageFileEmpty = Field :field must not be empty; +protected $messageFileEmpty = Field :field must not be empty; /** * File exceeds the file size set in PHP configuration * * @var string */ -protected messageIniSize = File :field exceeds the maximum file size; +protected $messageIniSize = File :field exceeds the maximum file size; /** * File is not valid * * @var string */ -protected messageValid = Field :field is not valid; +protected $messageValid = Field :field is not valid; ``` -## Methods +### Methods ```php -public function checkUpload( Validation $validation, mixed $field ): bool; +public function checkUpload( Validation $validation, string $field ): bool; ``` - Check upload - - +Check upload ```php -public function checkUploadIsEmpty( Validation $validation, mixed $field ): bool; +public function checkUploadIsEmpty( Validation $validation, string $field ): bool; ``` - Check if upload is empty - - +Check if upload is empty ```php -public function checkUploadIsValid( Validation $validation, mixed $field ): bool; +public function checkUploadIsValid( Validation $validation, string $field ): bool; ``` - Check if upload is valid - - +Check if upload is valid ```php -public function checkUploadMaxSize( Validation $validation, mixed $field ): bool; +public function checkUploadMaxSize( Validation $validation, string $field ): bool; ``` - Check if uploaded file is larger than PHP allowed size - - +Check if uploaded file is larger than PHP allowed size ```php public function getFileSizeInBytes( string $size ): double; ``` - Convert a string like "2.5MB" in bytes - - +Convert a string like "2.5MB" in bytes ```php @@ -2112,18 +2638,32 @@ File is not valid protected function checkIsUploadedFile( string $name ): bool; ``` Checks if a file has been uploaded; Internal check that can be -overriden in a subclass if you do not want to check uploaded files +overridden in a subclass if you do not want to check uploaded files + + + + +## Filter\Validation\Validator\File\MimeType +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/MimeType.zep) +- __Namespace__ -

Class Phalcon\Filter\Validation\Validator\File\MimeType

+ - `Phalcon\Filter\Validation\Validator\File` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/MimeType.zep) +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` -| Namespace | Phalcon\Filter\Validation\Validator\File | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Exception | -| Extends | AbstractFile | +- __Extends__ + + `AbstractFile` + +- __Implements__ + Checks if a value has a correct file mime type @@ -2173,14 +2713,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = File :field must be of type: :types; +protected $template = File :field must be of type: :types; ``` -## Methods +### Methods ```php public function validate( Validation $validation, mixed $field ): bool; @@ -2190,13 +2730,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\File\Resolution\Equal

+## Filter\Validation\Validator\File\Resolution\Equal + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/Resolution/Equal.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator\File\Resolution` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\Validator\File\AbstractFile` + - `Phalcon\Messages\Message` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/Resolution/Equal.zep) +- __Extends__ + + `AbstractFile` -| Namespace | Phalcon\Filter\Validation\Validator\File\Resolution | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Validator\File\AbstractFile | -| Extends | AbstractFile | +- __Implements__ + Checks if a file has the right resolution @@ -2237,14 +2791,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = The resolution of the field :field has to be equal :resolution; +protected $template = The resolution of the field :field has to be equal :resolution; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2260,13 +2814,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\File\Resolution\Max

+## Filter\Validation\Validator\File\Resolution\Max + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/Resolution/Max.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator\File\Resolution` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\Validator\File\AbstractFile` + - `Phalcon\Messages\Message` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/Resolution/Max.zep) +- __Extends__ + + `AbstractFile` -| Namespace | Phalcon\Filter\Validation\Validator\File\Resolution | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Validator\File\AbstractFile | -| Extends | AbstractFile | +- __Implements__ + Checks if a file has the right resolution @@ -2312,14 +2880,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = File :field exceeds the maximum resolution of :resolution; +protected $template = File :field exceeds the maximum resolution of :resolution; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2335,13 +2903,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\File\Resolution\Min

+## Filter\Validation\Validator\File\Resolution\Min -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/Resolution/Min.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/Resolution/Min.zep) -| Namespace | Phalcon\Filter\Validation\Validator\File\Resolution | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Validator\File\AbstractFile | -| Extends | AbstractFile | + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator\File\Resolution` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\Validator\File\AbstractFile` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractFile` + +- __Implements__ + Checks if a file has the right resolution @@ -2387,14 +2969,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = File :field can not have the minimum resolution of :resolution; +protected $template = File :field can not have the minimum resolution of :resolution; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2410,13 +2992,26 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\File\Size\Equal

+## Filter\Validation\Validator\File\Size\Equal + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/Size/Equal.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/Size/Equal.zep) -| Namespace | Phalcon\Filter\Validation\Validator\File\Size | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Validator\File\AbstractFile | -| Extends | AbstractFile | +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator\File\Size` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\Validator\File\AbstractFile` + +- __Extends__ + + `AbstractFile` + +- __Implements__ + Checks if a value has a correct file @@ -2462,36 +3057,49 @@ $validator->add( ``` -## Properties +### Properties ```php -// -protected template = File :field does not have the exact :size file size; +/** + * @var string|null + */ +protected $template = File :field does not have the exact :size file size; ``` -## Methods +### Methods ```php -public function __construct( array $options = [] ); +public function validate( Validation $validation, mixed $field ): bool; ``` -Constructor +Executes the validation ```php -public function validate( Validation $validation, mixed $field ): bool; +protected function getConditional( double $source, double $target, bool $included = bool ); ``` -Executes the validation +Executes the conditional + + + + +## Filter\Validation\Validator\File\Size\Max +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/Size/Max.zep) +- __Namespace__ -

Class Phalcon\Filter\Validation\Validator\File\Size\Max

+ - `Phalcon\Filter\Validation\Validator\File\Size` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/Size/Max.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Validation\Validator\File\Size | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Validator\File\AbstractFile | -| Extends | AbstractFile | +- __Extends__ + + `Equal` + +- __Implements__ + Checks if a value has a correct file @@ -2537,36 +3145,43 @@ $validator->add( ``` -## Properties +### Properties ```php -// -protected template = File :field exceeds the size of :size; +/** + * @var string|null + */ +protected $template = File :field exceeds the size of :size; ``` -## Methods +### Methods ```php -public function __construct( array $options = [] ); +protected function getConditional( double $source, double $target, bool $included = bool ); ``` -Constructor +Executes the conditional -```php -public function validate( Validation $validation, mixed $field ): bool; -``` -Executes the validation +## Filter\Validation\Validator\File\Size\Min + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/File/Size/Min.zep) + +- __Namespace__ -

Class Phalcon\Filter\Validation\Validator\File\Size\Min

+ - `Phalcon\Filter\Validation\Validator\File\Size` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/File/Size/Min.zep) +- __Uses__ + -| Namespace | Phalcon\Filter\Validation\Validator\File\Size | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\Validator\File\AbstractFile | -| Extends | AbstractFile | +- __Extends__ + + `Equal` + +- __Implements__ + Checks if a value has a correct file @@ -2612,36 +3227,46 @@ $validator->add( ``` -## Properties +### Properties ```php -// -protected template = File :field can not have the minimum size of :size; +/** + * @var string|null + */ +protected $template = File :field can not have the minimum size of :size; ``` -## Methods +### Methods ```php -public function __construct( array $options = [] ); +protected function getConditional( double $source, double $target, bool $included = bool ); ``` -Constructor +Executes the conditional -```php -public function validate( Validation $validation, mixed $field ): bool; -``` -Executes the validation +## Filter\Validation\Validator\Identical + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Identical.zep) + +- __Namespace__ -

Class Phalcon\Filter\Validation\Validator\Identical

+ - `Phalcon\Filter\Validation\Validator` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Identical.zep) +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks if a value is identical to other @@ -2682,14 +3307,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field does not have the expected value; +protected $template = Field :field does not have the expected value; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2705,13 +3330,28 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\InclusionIn

+## Filter\Validation\Validator\InclusionIn + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/InclusionIn.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/InclusionIn.zep) +- __Extends__ + + `AbstractValidator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator, Phalcon\Filter\Validation\Exception | -| Extends | AbstractValidator | +- __Implements__ + Check if a value is included into a list of values @@ -2752,14 +3392,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be a part of list: :domain; +protected $template = Field :field must be a part of list: :domain; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2775,13 +3415,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Ip

+## Filter\Validation\Validator\Ip -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Ip.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Ip.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator, Phalcon\Messages\Message | -| Extends | AbstractValidator | + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Check for IP addresses @@ -2834,20 +3488,20 @@ $validator->add( ``` -## Constants +### Constants ```php const VERSION_4 = FILTER_FLAG_IPV4; const VERSION_6 = FILTER_FLAG_IPV6; ``` -## Properties +### Properties ```php // -protected template = Field :field must be a valid IP address; +protected $template = Field :field must be a valid IP address; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2863,13 +3517,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Numericality

+## Filter\Validation\Validator\Numericality + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Numericality.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Numericality.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Check for a valid numeric value @@ -2905,14 +3573,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field does not have a valid numeric format; +protected $template = Field :field does not have a valid numeric format; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2928,13 +3596,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\PresenceOf

+## Filter\Validation\Validator\PresenceOf + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/PresenceOf.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/PresenceOf.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Validates that a value is not null or empty string @@ -2970,14 +3652,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field is required; +protected $template = Field :field is required; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -2993,13 +3675,27 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Regex

+## Filter\Validation\Validator\Regex + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Regex.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Regex.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Allows validate if the value of a field matches a regular expression @@ -3040,14 +3736,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field does not match the required format; +protected $template = Field :field does not match the required format; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -3063,13 +3759,30 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\StringLength

+## Filter\Validation\Validator\StringLength + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/StringLength.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/StringLength.zep) + - `Phalcon\Filter\Validation\Validator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation\AbstractValidator, Phalcon\Filter\Validation\AbstractValidatorComposite, Phalcon\Filter\Validation\Validator\StringLength\Max, Phalcon\Filter\Validation\Validator\StringLength\Min, Phalcon\Filter\Validation\Exception | -| Extends | AbstractValidatorComposite | +- __Uses__ + + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\AbstractValidatorComposite` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Filter\Validation\Validator\StringLength\Max` + - `Phalcon\Filter\Validation\Validator\StringLength\Min` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidatorComposite` + +- __Implements__ + Validates that a string has the specified maximum and minimum constraints The test is passed if for a string's length L, min<=L<=max, i.e. L must @@ -3133,7 +3846,7 @@ $validation->add( ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -3143,13 +3856,28 @@ Constructor -

Class Phalcon\Filter\Validation\Validator\StringLength\Max

+## Filter\Validation\Validator\StringLength\Max + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/StringLength/Max.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator\StringLength` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/StringLength/Max.zep) +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` -| Namespace | Phalcon\Filter\Validation\Validator\StringLength | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator, Phalcon\Filter\Validation\Exception | -| Extends | AbstractValidator | +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Validates that a string has the specified maximum constraints The test is passed if for a string's length L, L<=max, i.e. L must @@ -3197,14 +3925,14 @@ $validation->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must not exceed :max characters long; +protected $template = Field :field must not exceed :max characters long; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -3220,13 +3948,28 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\StringLength\Min

+## Filter\Validation\Validator\StringLength\Min + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/StringLength/Min.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator\StringLength` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/StringLength/Min.zep) +- __Extends__ + + `AbstractValidator` -| Namespace | Phalcon\Filter\Validation\Validator\StringLength | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator, Phalcon\Filter\Validation\Exception | -| Extends | AbstractValidator | +- __Implements__ + Validates that a string has the specified minimum constraints The test is passed if for a string's length L, min<=L, i.e. L must @@ -3274,14 +4017,14 @@ $validation->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be at least :min characters long; +protected $template = Field :field must be at least :min characters long; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -3297,13 +4040,30 @@ Executes the validation -

Class Phalcon\Filter\Validation\Validator\Uniqueness

+## Filter\Validation\Validator\Uniqueness + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Uniqueness.zep) + + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractCombinedFieldsValidator` + - `Phalcon\Filter\Validation\Exception` + - `Phalcon\Messages\Message` + - `Phalcon\Mvc\Model` + - `Phalcon\Mvc\ModelInterface` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Uniqueness.zep) +- __Extends__ + + `AbstractCombinedFieldsValidator` -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Mvc\Model, Phalcon\Mvc\ModelInterface, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractCombinedFieldsValidator, Phalcon\Filter\Validation\Exception | -| Extends | AbstractCombinedFieldsValidator | +- __Implements__ + Check that a field is unique in the related table @@ -3375,19 +4135,19 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be unique; +protected $template = Field :field must be unique; /** * @var array|null */ -private columnMap; +private $columnMap; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -3421,13 +4181,27 @@ Uniqueness method used for model -

Class Phalcon\Filter\Validation\Validator\Url

+## Filter\Validation\Validator\Url -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/Validator/Url.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/Validator/Url.zep) -| Namespace | Phalcon\Filter\Validation\Validator | -| Uses | Phalcon\Messages\Message, Phalcon\Filter\Validation, Phalcon\Filter\Validation\AbstractValidator | -| Extends | AbstractValidator | + +- __Namespace__ + + - `Phalcon\Filter\Validation\Validator` + +- __Uses__ + + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\AbstractValidator` + - `Phalcon\Messages\Message` + +- __Extends__ + + `AbstractValidator` + +- __Implements__ + Checks if a value has a url format @@ -3463,14 +4237,14 @@ $validator->add( ``` -## Properties +### Properties ```php // -protected template = Field :field must be a url; +protected $template = Field :field must be a url; ``` -## Methods +### Methods ```php public function __construct( array $options = [] ); @@ -3486,17 +4260,29 @@ Executes the validation -

Interface Phalcon\Filter\Validation\ValidatorCompositeInterface

+## Filter\Validation\ValidatorCompositeInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/ValidatorCompositeInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/ValidatorCompositeInterface.zep) -| Namespace | Phalcon\Filter\Validation | -| Uses | Phalcon\Filter\Validation | +- __Namespace__ + + - `Phalcon\Filter\Validation` + +- __Uses__ + + - `Phalcon\Filter\Validation` + +- __Extends__ + + +- __Implements__ + This is a base class for combined fields validators -## Methods +### Methods ```php public function getValidators(): array; @@ -3512,13 +4298,25 @@ Executes the validation -

Class Phalcon\Filter\Validation\ValidatorFactory

+## Filter\Validation\ValidatorFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/ValidatorFactory.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/ValidatorFactory.zep) +- __Namespace__ -| Namespace | Phalcon\Filter\Validation | -| Uses | Phalcon\Factory\AbstractFactory | -| Extends | AbstractFactory | + - `Phalcon\Filter\Validation` + +- __Uses__ + + - `Phalcon\Factory\AbstractFactory` + +- __Extends__ + + `AbstractFactory` + +- __Implements__ + This file is part of the Phalcon Framework. @@ -3528,7 +4326,7 @@ For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code. -## Methods +### Methods ```php public function __construct( array $services = [] ); @@ -3556,17 +4354,29 @@ Returns the available adapters -

Interface Phalcon\Filter\Validation\ValidatorInterface

+## Filter\Validation\ValidatorInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Validation/ValidatorInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Filter/Validation/ValidatorInterface.zep) + - `Phalcon\Filter\Validation` -| Namespace | Phalcon\Filter\Validation | -| Uses | Phalcon\Filter\Validation | +- __Uses__ + + - `Phalcon\Filter\Validation` + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Filter\Validation\AbstractValidator -## Methods +### Methods ```php public function getOption( string $key, mixed $defaultValue = null ): mixed; @@ -3578,17 +4388,13 @@ Returns null if the option hasn't set ```php public function getTemplate( string $field ): string; ``` - Get the template message - - +Get the template message ```php public function getTemplates(): array; ``` - Get message templates - - +Get message templates ```php @@ -3600,20 +4406,18 @@ Checks if an option is defined ```php public function setTemplate( string $template ): ValidatorInterface; ``` - Set a new template message - - +Set a new template message ```php public function setTemplates( array $templates ): ValidatorInterface; ``` - Clear current template and set new from an array, - - +Clear current template and set new from an array, ```php public function validate( Validation $validation, mixed $field ): bool; ``` Executes the validation + + diff --git a/docs/api/phalcon_flash.md b/docs/api/phalcon_flash.md index ad88fa36d..f928888f5 100644 --- a/docs/api/phalcon_flash.md +++ b/docs/api/phalcon_flash.md @@ -1,18 +1,39 @@ +--- +hide: + - navigation +--- -* [Phalcon\Flash\AbstractFlash](#flash-abstractflash) -* [Phalcon\Flash\Direct](#flash-direct) -* [Phalcon\Flash\Exception](#flash-exception) -* [Phalcon\Flash\FlashInterface](#flash-flashinterface) -* [Phalcon\Flash\Session](#flash-session) +!!! info "NOTE" -

Abstract Class Phalcon\Flash\AbstractFlash

+ All classes are prefixed with `Phalcon` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/AbstractFlash.zep) -| Namespace | Phalcon\Flash | -| Uses | Phalcon\Di\Di, Phalcon\Di\DiInterface, Phalcon\Di\AbstractInjectionAware, Phalcon\Html\Escaper\EscaperInterface, Phalcon\Session\ManagerInterface, Phalcon\Support\Helper\Str\Interpolate | -| Extends | AbstractInjectionAware | -| Implements | FlashInterface | + +## Flash\AbstractFlash ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Flash/AbstractFlash.zep) + + +- __Namespace__ + + - `Phalcon\Flash` + +- __Uses__ + + - `Phalcon\Di\AbstractInjectionAware` + - `Phalcon\Di\Di` + - `Phalcon\Di\DiInterface` + - `Phalcon\Html\Escaper\EscaperInterface` + - `Phalcon\Session\ManagerInterface` + - `Phalcon\Support\Helper\Str\Interpolate` + +- __Extends__ + + `AbstractInjectionAware` + +- __Implements__ + + - `FlashInterface` Shows HTML notifications related to different circumstances. Classes can be stylized using CSS @@ -27,61 +48,61 @@ Class AbstractFlash @package Phalcon\Flash -## Properties +### Properties ```php /** * @var bool */ -protected autoescape = true; +protected $autoescape = true; /** * @var bool */ -protected automaticHtml = true; +protected $automaticHtml = true; /** * @var array */ -protected cssClasses; +protected $cssClasses; /** * @var array */ -protected cssIconClasses; +protected $cssIconClasses; /** * @var string */ -protected customTemplate = ; +protected $customTemplate = ; /** * @var EscaperInterface | null */ -protected escaperService; +protected $escaperService; /** * @var bool */ -protected implicitFlush = true; +protected $implicitFlush = true; /** * @var Interpolate */ -protected interpolator; +protected $interpolator; /** * @var array */ -protected messages; +protected $messages; /** * @var SessionInterface|null */ -protected sessionService; +protected $sessionService; ``` -## Methods +### Methods ```php public function __construct( EscaperInterface $escaper = null, SessionInterface $session = null ); @@ -226,19 +247,31 @@ $flash->warning("Hey, this is important"); -

Class Phalcon\Flash\Direct

+## Flash\Direct -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/Direct.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Flash/Direct.zep) -| Namespace | Phalcon\Flash | -| Extends | AbstractFlash | + +- __Namespace__ + + - `Phalcon\Flash` + +- __Uses__ + + +- __Extends__ + + `AbstractFlash` + +- __Implements__ + Class Direct @package Phalcon\Flash -## Methods +### Methods ```php public function message( string $type, mixed $message ): string | null; @@ -254,29 +287,53 @@ Prints the messages accumulated in the flasher -

Class Phalcon\Flash\Exception

+## Flash\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Flash/Exception.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/Exception.zep) +- __Namespace__ -| Namespace | Phalcon\Flash | -| Extends | \Exception | + - `Phalcon\Flash` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Flash classes will use this class -

Interface Phalcon\Flash\FlashInterface

+## Flash\FlashInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Flash/FlashInterface.zep) + + +- __Namespace__ + + - `Phalcon\Flash` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/FlashInterface.zep) +- __Extends__ + -| Namespace | Phalcon\Flash | +- __Implements__ + Interface FlashInterface @package Phalcon\Flash -## Methods +### Methods ```php public function error( string $message ): string | null; @@ -310,13 +367,25 @@ Shows a HTML warning message -

Class Phalcon\Flash\Session

+## Flash\Session -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/Session.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Flash/Session.zep) -| Namespace | Phalcon\Flash | -| Uses | Phalcon\Session\ManagerInterface | -| Extends | AbstractFlash | + +- __Namespace__ + + - `Phalcon\Flash` + +- __Uses__ + + - `Phalcon\Session\ManagerInterface` + +- __Extends__ + + `AbstractFlash` + +- __Implements__ + This is an implementation of the Phalcon\Flash\FlashInterface that temporarily stores the messages in session, then messages can be printed in @@ -327,12 +396,12 @@ Class Session @package Phalcon\Flash -## Constants +### Constants ```php const SESSION_KEY = _flashMessages; ``` -## Methods +### Methods ```php public function clear(): void; @@ -382,3 +451,5 @@ Returns the messages stored in session protected function setSessionMessages( array $messages ): array; ``` Stores the messages in session + + diff --git a/docs/api/phalcon_forms.md b/docs/api/phalcon_forms.md index b34245a35..c2fb5d43d 100644 --- a/docs/api/phalcon_forms.md +++ b/docs/api/phalcon_forms.md @@ -1,93 +1,106 @@ +--- +hide: + - navigation +--- -* [Phalcon\Forms\Element\AbstractElement](#forms-element-abstractelement) -* [Phalcon\Forms\Element\Check](#forms-element-check) -* [Phalcon\Forms\Element\Date](#forms-element-date) -* [Phalcon\Forms\Element\ElementInterface](#forms-element-elementinterface) -* [Phalcon\Forms\Element\Email](#forms-element-email) -* [Phalcon\Forms\Element\File](#forms-element-file) -* [Phalcon\Forms\Element\Hidden](#forms-element-hidden) -* [Phalcon\Forms\Element\Numeric](#forms-element-numeric) -* [Phalcon\Forms\Element\Password](#forms-element-password) -* [Phalcon\Forms\Element\Radio](#forms-element-radio) -* [Phalcon\Forms\Element\Select](#forms-element-select) -* [Phalcon\Forms\Element\Submit](#forms-element-submit) -* [Phalcon\Forms\Element\Text](#forms-element-text) -* [Phalcon\Forms\Element\TextArea](#forms-element-textarea) -* [Phalcon\Forms\Exception](#forms-exception) -* [Phalcon\Forms\Form](#forms-form) -* [Phalcon\Forms\Manager](#forms-manager) - -

Abstract Class Phalcon\Forms\Element\AbstractElement

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/AbstractElement.zep) - -| Namespace | Phalcon\Forms\Element | -| Uses | InvalidArgumentException, Phalcon\Di\DiInterface, Phalcon\Di\Di, Phalcon\Filter\Validation\ValidatorInterface, Phalcon\Forms\Form, Phalcon\Forms\Exception, Phalcon\Html\Escaper, Phalcon\Html\TagFactory, Phalcon\Messages\MessageInterface, Phalcon\Messages\Messages | -| Implements | ElementInterface | +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Forms\Element\AbstractElement ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/AbstractElement.zep) + + +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + - `InvalidArgumentException` + - `Phalcon\Di\Di` + - `Phalcon\Di\DiInterface` + - `Phalcon\Filter\Validation\ValidatorInterface` + - `Phalcon\Forms\Exception` + - `Phalcon\Forms\Form` + - `Phalcon\Html\Escaper` + - `Phalcon\Html\TagFactory` + - `Phalcon\Messages\MessageInterface` + - `Phalcon\Messages\Messages` + +- __Extends__ + + +- __Implements__ + + - `ElementInterface` This is a base class for form elements -## Properties +### Properties ```php /** * @var array */ -protected attributes; +protected $attributes; /** * @var array */ -protected filters; +protected $filters; /** * @var Form|null */ -protected form; +protected $form; /** * @var string|null */ -protected label; +protected $label; /** * @var string */ -protected method = inputText; +protected $method = inputText; /** * @var Messages */ -protected messages; +protected $messages; /** * @var string */ -protected name; +protected $name; /** * @var array */ -protected options; +protected $options; /** * @var TagFactory|null */ -protected tagFactory; +protected $tagFactory; /** * @var array */ -protected validators; +protected $validators; /** * @var mixed|null */ -protected value; +protected $value; ``` -## Methods +### Methods ```php public function __construct( string $name, array $attributes = [] ); @@ -303,58 +316,97 @@ Returns the tagFactory; throws exception if not present -

Class Phalcon\Forms\Element\Check

+## Forms\Element\Check + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Check.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Check.zep) -| Namespace | Phalcon\Forms\Element | -| Extends | AbstractElement | +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=check] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputCheckbox; +protected $method = inputCheckbox; ``` -

Class Phalcon\Forms\Element\Date

+## Forms\Element\Date + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Date.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Date.zep) +- __Namespace__ -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=date] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputDate; +protected $method = inputDate; ``` -

Interface Phalcon\Forms\Element\ElementInterface

+## Forms\Element\ElementInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/ElementInterface.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/ElementInterface.zep) + - `Phalcon\Forms\Element` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Forms\Form, Phalcon\Messages\MessageInterface, Phalcon\Messages\Messages, Phalcon\Filter\Validation\ValidatorInterface | +- __Uses__ + + - `Phalcon\Filter\Validation\ValidatorInterface` + - `Phalcon\Forms\Form` + - `Phalcon\Messages\MessageInterface` + - `Phalcon\Messages\Messages` + +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Forms\Element classes -## Methods +### Methods ```php public function addFilter( string $filter ): ElementInterface; @@ -540,153 +592,237 @@ Sets options for the element -

Class Phalcon\Forms\Element\Email

+## Forms\Element\Email + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Email.zep) + + +- __Namespace__ + + - `Phalcon\Forms\Element` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Email.zep) +- __Uses__ + + - `Phalcon\Tag` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=email] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputEmail; +protected $method = inputEmail; ``` -

Class Phalcon\Forms\Element\File

+## Forms\Element\File + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/File.zep) + + +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/File.zep) +- __Extends__ + + `AbstractElement` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | +- __Implements__ + Component INPUT[type=file] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputFile; +protected $method = inputFile; ``` -

Class Phalcon\Forms\Element\Hidden

+## Forms\Element\Hidden -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Hidden.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Hidden.zep) -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | + +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=hidden] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputHidden; +protected $method = inputHidden; ``` -

Class Phalcon\Forms\Element\Numeric

+## Forms\Element\Numeric + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Numeric.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Numeric.zep) -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=number] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputNumeric; +protected $method = inputNumeric; ``` -

Class Phalcon\Forms\Element\Password

+## Forms\Element\Password + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Password.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Password.zep) -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=password] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputPassword; +protected $method = inputPassword; ``` -

Class Phalcon\Forms\Element\Radio

+## Forms\Element\Radio + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Radio.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Radio.zep) +- __Namespace__ -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=radio] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputRadio; +protected $method = inputRadio; ``` -

Class Phalcon\Forms\Element\Select

+## Forms\Element\Select + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Select.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Select.zep) + - `Phalcon\Forms\Element` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag\Select | -| Extends | AbstractElement | +- __Uses__ + + - `Phalcon\Tag\Select` + +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component SELECT (choice) for forms -## Properties +### Properties ```php /** * @var object|array|null */ -protected optionsValues; +protected $optionsValues; ``` -## Methods +### Methods ```php public function __construct( string $name, mixed $options = null, array $attributes = [] ); @@ -727,148 +863,222 @@ helpers according to the element parameters -

Class Phalcon\Forms\Element\Submit

+## Forms\Element\Submit + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Submit.zep) + + +- __Namespace__ + + - `Phalcon\Forms\Element` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Submit.zep) +- __Uses__ + + - `Phalcon\Tag` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=submit] for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputSubmit; +protected $method = inputSubmit; ``` -

Class Phalcon\Forms\Element\Text

+## Forms\Element\Text + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/Text.zep) + + +- __Namespace__ + + - `Phalcon\Forms\Element` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/Text.zep) +- __Uses__ + + - `Phalcon\Forms\Exception` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Forms\Exception | -| Extends | AbstractElement | +- __Extends__ + + `AbstractElement` + +- __Implements__ + Component INPUT[type=text] for forms -

Class Phalcon\Forms\Element\TextArea

+## Forms\Element\TextArea + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Element/TextArea.zep) + + +- __Namespace__ + + - `Phalcon\Forms\Element` + +- __Uses__ + + - `Phalcon\Tag` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Element/TextArea.zep) +- __Extends__ + + `AbstractElement` -| Namespace | Phalcon\Forms\Element | -| Uses | Phalcon\Tag | -| Extends | AbstractElement | +- __Implements__ + Component TEXTAREA for forms -## Properties +### Properties ```php /** * @var string */ -protected method = inputTextarea; +protected $method = inputTextarea; ``` -

Class Phalcon\Forms\Exception

+## Forms\Exception -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Exception.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Exception.zep) -| Namespace | Phalcon\Forms | -| Extends | \Exception | + +- __Namespace__ + + - `Phalcon\Forms` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Exceptions thrown in Phalcon\Forms will use this class -

Class Phalcon\Forms\Form

+## Forms\Form + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Form.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Form.zep) -| Namespace | Phalcon\Forms | -| Uses | Countable, Iterator, Phalcon\Di\Injectable, Phalcon\Di\DiInterface, Phalcon\Filter\FilterInterface, Phalcon\Forms\Element\ElementInterface, Phalcon\Html\Attributes, Phalcon\Html\Attributes\AttributesInterface, Phalcon\Html\TagFactory, Phalcon\Messages\Messages, Phalcon\Tag, Phalcon\Filter\Validation, Phalcon\Filter\Validation\ValidationInterface | -| Extends | Injectable | -| Implements | Countable, Iterator, AttributesInterface | +- __Namespace__ + + - `Phalcon\Forms` + +- __Uses__ + + - `Countable` + - `Iterator` + - `Phalcon\Di\DiInterface` + - `Phalcon\Di\Injectable` + - `Phalcon\Filter\FilterInterface` + - `Phalcon\Filter\Validation` + - `Phalcon\Filter\Validation\ValidationInterface` + - `Phalcon\Forms\Element\ElementInterface` + - `Phalcon\Html\Attributes` + - `Phalcon\Html\Attributes\AttributesInterface` + - `Phalcon\Html\TagFactory` + - `Phalcon\Messages\Messages` + - `Phalcon\Tag` + +- __Extends__ + + `Injectable` + +- __Implements__ + + - `AttributesInterface` + - `Countable` + - `Iterator` This component allows to build forms using an object-oriented interface -## Properties +### Properties ```php /** * @var AttributesInterface|null */ -protected attributes; +protected $attributes; /** * @var array */ -protected data; +protected $data; /** * @var array */ -protected filteredData; +protected $filteredData; /** * @var array */ -protected elements; +protected $elements; /** * @var array */ -protected elementsIndexed; +protected $elementsIndexed; /** * @var object|null */ -protected entity; +protected $entity; /** * @var Messages|array|null */ -protected messages; +protected $messages; /** * @var int */ -protected position = 0; +protected $position = ; /** * @var array */ -protected options; +protected $options; /** * @var TagFactory|null */ -protected tagFactory; +protected $tagFactory; /** * @var ValidationInterface|null */ -protected validation; +protected $validation; /** * @var array */ -protected whitelist; +protected $whitelist; ``` -## Methods +### Methods ```php public function __construct( mixed $entity = null, array $userOptions = [] ); @@ -1118,25 +1328,37 @@ Check if the current element in the iterator is valid -

Class Phalcon\Forms\Manager

+## Forms\Manager + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Forms/Manager.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Forms/Manager.zep) +- __Namespace__ -| Namespace | Phalcon\Forms | + - `Phalcon\Forms` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + Forms Manager -## Properties +### Properties ```php /** * @var array */ -protected forms; +protected $forms; ``` -## Methods +### Methods ```php public function create( string $name, mixed $entity = null ): Form; @@ -1160,3 +1382,5 @@ Checks if a form is registered in the forms manager public function set( string $name, Form $form ): Manager; ``` Registers a form in the Forms Manager + + diff --git a/docs/api/phalcon_html.md b/docs/api/phalcon_html.md index e3553e4d7..e47e98351 100644 --- a/docs/api/phalcon_html.md +++ b/docs/api/phalcon_html.md @@ -1,85 +1,40 @@ +--- +hide: + - navigation +--- -* [Phalcon\Html\Attributes](#html-attributes) -* [Phalcon\Html\Attributes\AttributesInterface](#html-attributes-attributesinterface) -* [Phalcon\Html\Attributes\RenderInterface](#html-attributes-renderinterface) -* [Phalcon\Html\Breadcrumbs](#html-breadcrumbs) -* [Phalcon\Html\Escaper](#html-escaper) -* [Phalcon\Html\Escaper\EscaperInterface](#html-escaper-escaperinterface) -* [Phalcon\Html\Escaper\Exception](#html-escaper-exception) -* [Phalcon\Html\EscaperFactory](#html-escaperfactory) -* [Phalcon\Html\Exception](#html-exception) -* [Phalcon\Html\Helper\AbstractHelper](#html-helper-abstracthelper) -* [Phalcon\Html\Helper\AbstractList](#html-helper-abstractlist) -* [Phalcon\Html\Helper\AbstractSeries](#html-helper-abstractseries) -* [Phalcon\Html\Helper\Anchor](#html-helper-anchor) -* [Phalcon\Html\Helper\Base](#html-helper-base) -* [Phalcon\Html\Helper\Body](#html-helper-body) -* [Phalcon\Html\Helper\Button](#html-helper-button) -* [Phalcon\Html\Helper\Close](#html-helper-close) -* [Phalcon\Html\Helper\Doctype](#html-helper-doctype) -* [Phalcon\Html\Helper\Element](#html-helper-element) -* [Phalcon\Html\Helper\Form](#html-helper-form) -* [Phalcon\Html\Helper\Img](#html-helper-img) -* [Phalcon\Html\Helper\Input\AbstractInput](#html-helper-input-abstractinput) -* [Phalcon\Html\Helper\Input\Checkbox](#html-helper-input-checkbox) -* [Phalcon\Html\Helper\Input\Color](#html-helper-input-color) -* [Phalcon\Html\Helper\Input\Date](#html-helper-input-date) -* [Phalcon\Html\Helper\Input\DateTime](#html-helper-input-datetime) -* [Phalcon\Html\Helper\Input\DateTimeLocal](#html-helper-input-datetimelocal) -* [Phalcon\Html\Helper\Input\Email](#html-helper-input-email) -* [Phalcon\Html\Helper\Input\File](#html-helper-input-file) -* [Phalcon\Html\Helper\Input\Hidden](#html-helper-input-hidden) -* [Phalcon\Html\Helper\Input\Image](#html-helper-input-image) -* [Phalcon\Html\Helper\Input\Input](#html-helper-input-input) -* [Phalcon\Html\Helper\Input\Month](#html-helper-input-month) -* [Phalcon\Html\Helper\Input\Numeric](#html-helper-input-numeric) -* [Phalcon\Html\Helper\Input\Password](#html-helper-input-password) -* [Phalcon\Html\Helper\Input\Radio](#html-helper-input-radio) -* [Phalcon\Html\Helper\Input\Range](#html-helper-input-range) -* [Phalcon\Html\Helper\Input\Search](#html-helper-input-search) -* [Phalcon\Html\Helper\Input\Select](#html-helper-input-select) -* [Phalcon\Html\Helper\Input\Submit](#html-helper-input-submit) -* [Phalcon\Html\Helper\Input\Tel](#html-helper-input-tel) -* [Phalcon\Html\Helper\Input\Text](#html-helper-input-text) -* [Phalcon\Html\Helper\Input\Textarea](#html-helper-input-textarea) -* [Phalcon\Html\Helper\Input\Time](#html-helper-input-time) -* [Phalcon\Html\Helper\Input\Url](#html-helper-input-url) -* [Phalcon\Html\Helper\Input\Week](#html-helper-input-week) -* [Phalcon\Html\Helper\Label](#html-helper-label) -* [Phalcon\Html\Helper\Link](#html-helper-link) -* [Phalcon\Html\Helper\Meta](#html-helper-meta) -* [Phalcon\Html\Helper\Ol](#html-helper-ol) -* [Phalcon\Html\Helper\Script](#html-helper-script) -* [Phalcon\Html\Helper\Style](#html-helper-style) -* [Phalcon\Html\Helper\Title](#html-helper-title) -* [Phalcon\Html\Helper\Ul](#html-helper-ul) -* [Phalcon\Html\Link\AbstractLink](#html-link-abstractlink) -* [Phalcon\Html\Link\AbstractLinkProvider](#html-link-abstractlinkprovider) -* [Phalcon\Html\Link\EvolvableLink](#html-link-evolvablelink) -* [Phalcon\Html\Link\EvolvableLinkProvider](#html-link-evolvablelinkprovider) -* [Phalcon\Html\Link\Interfaces\EvolvableLinkInterface](#html-link-interfaces-evolvablelinkinterface) -* [Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface](#html-link-interfaces-evolvablelinkproviderinterface) -* [Phalcon\Html\Link\Interfaces\LinkInterface](#html-link-interfaces-linkinterface) -* [Phalcon\Html\Link\Interfaces\LinkProviderInterface](#html-link-interfaces-linkproviderinterface) -* [Phalcon\Html\Link\Link](#html-link-link) -* [Phalcon\Html\Link\LinkProvider](#html-link-linkprovider) -* [Phalcon\Html\Link\Serializer\Header](#html-link-serializer-header) -* [Phalcon\Html\Link\Serializer\SerializerInterface](#html-link-serializer-serializerinterface) -* [Phalcon\Html\TagFactory](#html-tagfactory) - -

Class Phalcon\Html\Attributes

- -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Attributes.zep) - -| Namespace | Phalcon\Html | -| Uses | Phalcon\Support\Collection, Phalcon\Html\Attributes\RenderInterface | -| Extends | Collection | -| Implements | RenderInterface | +!!! info "NOTE" + + All classes are prefixed with `Phalcon` + + + +## Html\Attributes + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Attributes.zep) + + +- __Namespace__ + + - `Phalcon\Html` + +- __Uses__ + + - `Phalcon\Html\Attributes\RenderInterface` + - `Phalcon\Support\Collection` + +- __Extends__ + + `Collection` + +- __Implements__ + + - `RenderInterface` This class helps to work with HTML Attributes -## Methods +### Methods ```php public function __toString(): string; @@ -101,19 +56,31 @@ protected function renderAttributes( array $attributes ): string; -

Interface Phalcon\Html\Attributes\AttributesInterface

+## Html\Attributes\AttributesInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Attributes/AttributesInterface.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Attributes/AttributesInterface.zep) -| Namespace | Phalcon\Html\Attributes | -| Uses | Phalcon\Html\Attributes | +- __Namespace__ + + - `Phalcon\Html\Attributes` + +- __Uses__ + + - `Phalcon\Html\Attributes` + +- __Extends__ + + +- __Implements__ + * Phalcon\Html\Attributes\AttributesInterface * * Interface Phalcon\Html\Attributes\AttributesInterface */ -## Methods +### Methods ```php public function getAttributes(): Attributes; @@ -129,18 +96,30 @@ Set Attributes -

Interface Phalcon\Html\Attributes\RenderInterface

+## Html\Attributes\RenderInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Attributes/RenderInterface.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Attributes/RenderInterface.zep) +- __Namespace__ -| Namespace | Phalcon\Html\Attributes | + - `Phalcon\Html\Attributes` + +- __Uses__ + + +- __Extends__ + + +- __Implements__ + * Phalcon\Html\Attributes\RenderInterface * * Interface Phalcon\Html\Attributes\RenderInterface */ -## Methods +### Methods ```php public function render(): string; @@ -150,12 +129,24 @@ Generate a string represetation -

Class Phalcon\Html\Breadcrumbs

+## Html\Breadcrumbs + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Breadcrumbs.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Breadcrumbs.zep) +- __Namespace__ -| Namespace | Phalcon\Html | -| Uses | Phalcon\Di\DiInterface | + - `Phalcon\Html` + +- __Uses__ + + - `Phalcon\Di\DiInterface` + +- __Extends__ + + +- __Implements__ + Phalcon\Html\Breadcrumbs @@ -164,32 +155,32 @@ The resulting HTML when calling `render()` will have each breadcrumb enclosed in `
` tags, while the whole string is enclosed in `
` tags. -## Properties +### Properties ```php /** * Keeps all the breadcrumbs * * @var array */ -private elements; +private $elements; /** * Crumb separator * * @var string */ -private separator = / ; +private $separator = / ; /** * The HTML template to use to render the breadcrumbs. * * @var string */ -private template =
%label%
; +private $template =
%label%
; ``` -## Methods +### Methods ```php public function add( string $label, string $link = string ): Breadcrumbs; @@ -258,13 +249,25 @@ Returns the internal breadcrumbs array -

Class Phalcon\Html\Escaper

+## Html\Escaper + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Escaper.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Escaper.zep) + - `Phalcon\Html` -| Namespace | Phalcon\Html | -| Uses | Phalcon\Html\Escaper\EscaperInterface | -| Implements | EscaperInterface | +- __Uses__ + + - `Phalcon\Html\Escaper\EscaperInterface` + +- __Extends__ + + +- __Implements__ + + - `EscaperInterface` Phalcon\Html\Escaper @@ -283,28 +286,28 @@ echo $escaped; // font\2D family\3A \20 \3C Verdana\3E ``` -## Properties +### Properties ```php /** * @var bool */ -protected doubleEncode = true; +protected $doubleEncode = true; /** * @var string */ -protected encoding = utf-8; +protected $encoding = utf-8; /** * ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 * * @var int */ -protected flags = 11; +protected $flags = 11; ``` -## Methods +### Methods ```php public function attributes( mixed $input ): string; @@ -451,16 +454,28 @@ Proxy method for testing -

Interface Phalcon\Html\Escaper\EscaperInterface

+## Html\Escaper\EscaperInterface ![Interface](../assets/images/interface-blue.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Escaper/EscaperInterface.zep) + + +- __Namespace__ + + - `Phalcon\Html\Escaper` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Escaper/EscaperInterface.zep) +- __Uses__ + -| Namespace | Phalcon\Html\Escaper | +- __Extends__ + + +- __Implements__ + Interface for Phalcon\Html\Escaper -## Methods +### Methods ```php public function attributes( string $input ): string; @@ -514,27 +529,51 @@ Escapes a URL. Internally uses rawurlencode -

Class Phalcon\Html\Escaper\Exception

+## Html\Escaper\Exception + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Escaper/Exception.zep) + + +- __Namespace__ + + - `Phalcon\Html\Escaper` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Escaper/Exception.zep) +- __Extends__ + + `\Exception` -| Namespace | Phalcon\Html\Escaper | -| Extends | \Exception | +- __Implements__ + Exceptions thrown in Phalcon\Html\Escaper will use this class -

Class Phalcon\Html\EscaperFactory

+## Html\EscaperFactory + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/EscaperFactory.zep) + + +- __Namespace__ + + - `Phalcon\Html` + +- __Uses__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/EscaperFactory.zep) +- __Extends__ + -| Namespace | Phalcon\Html | +- __Implements__ + Class EscaperFactory -## Methods +### Methods ```php public function newInstance(): Escaper; @@ -544,12 +583,24 @@ Create a new instance of the object -

Class Phalcon\Html\Exception

+## Html\Exception -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Exception.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Exception.zep) -| Namespace | Phalcon\Html | -| Extends | \Exception | + +- __Namespace__ + + - `Phalcon\Html` + +- __Uses__ + + +- __Extends__ + + `\Exception` + +- __Implements__ + Phalcon\Html\Tag\Exception @@ -557,38 +608,57 @@ Exceptions thrown in Phalcon\Html\Tag will use this class -

Abstract Class Phalcon\Html\Helper\AbstractHelper

+## Html\Helper\AbstractHelper ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/AbstractHelper.zep) + + +- __Namespace__ + + - `Phalcon\Html\Helper` + +- __Uses__ + + - `Phalcon\Html\Escaper\EscaperInterface` + - `Phalcon\Html\Exception` + +- __Extends__ + + +- __Implements__ + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/AbstractHelper.zep) +@property string $delimiter +@property EscaperInterface $escaper +@property string $indent +@property int $indentLevel -| Namespace | Phalcon\Html\Helper | -| Uses | Phalcon\Html\Escaper\EscaperInterface, Phalcon\Html\Exception | -## Properties +### Properties ```php /** * @var string */ -protected delimiter = ; +protected $delimiter = ; /** * @var EscaperInterface */ -protected escaper; +protected $escaper; /** * @var string */ -protected indent = ; +protected $indent = ; /** * @var int */ -protected indentLevel = 1; +protected $indentLevel = 1; ``` -## Methods +### Methods ```php public function __construct( EscaperInterface $escaper ); @@ -653,37 +723,49 @@ Produces a self close tag i.e. -

Abstract Class Phalcon\Html\Helper\AbstractList

+## Html\Helper\AbstractList ![Abstract](../assets/images/abstract-green.svg) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/AbstractList.zep) +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/AbstractList.zep) -| Namespace | Phalcon\Html\Helper | -| Uses | Phalcon\Html\Exception | -| Extends | AbstractHelper | + +- __Namespace__ + + - `Phalcon\Html\Helper` + +- __Uses__ + + - `Phalcon\Html\Exception` + +- __Extends__ + + `AbstractHelper` + +- __Implements__ + Class AbstractList -## Properties +### Properties ```php /** * @var array */ -protected attributes; +protected $attributes; /** * @var string */ -protected elementTag = li; +protected $elementTag = li; /** * @var array */ -protected store; +protected $store; ``` -## Methods +### Methods ```php public function __invoke( string $indent = string, string $delimiter = null, array $attributes = [] ): AbstractList; @@ -705,28 +787,44 @@ Returns the tag name. -

Abstract Class Phalcon\Html\Helper\AbstractSeries

+## Html\Helper\AbstractSeries ![Abstract](../assets/images/abstract-green.svg) + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/AbstractSeries.zep) + + +- __Namespace__ + + - `Phalcon\Html\Helper` + +- __Uses__ + + +- __Extends__ + + `AbstractHelper` -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/AbstractSeries.zep) +- __Implements__ + -| Namespace | Phalcon\Html\Helper | -| Extends | AbstractHelper | +@property array $attributes +@property array $store -## Properties + +### Properties ```php /** * @var array */ -protected attributes; +protected $attributes; /** * @var array */ -protected store; +protected $store; ``` -## Methods +### Methods ```php public function __invoke( string $indent = string, string $delimiter = null ): AbstractSeries; @@ -740,6 +838,12 @@ public function __toString(); Generates and returns the HTML for the list. +```php +public function reset(): AbstractSeries; +``` +Resets the internal store. + + ```php abstract protected function getTag(): string; ``` @@ -748,18 +852,30 @@ Returns the tag name. -

Class Phalcon\Html\Helper\Anchor

+## Html\Helper\Anchor + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/Anchor.zep) -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/Anchor.zep) -| Namespace | Phalcon\Html\Helper | -| Uses | Phalcon\Html\Exception | -| Extends | AbstractHelper | +- __Namespace__ + + - `Phalcon\Html\Helper` + +- __Uses__ + + - `Phalcon\Html\Exception` + +- __Extends__ + + `AbstractHelper` + +- __Implements__ + Class Anchor -## Methods +### Methods ```php public function __invoke( string $href, string $text, array $attributes = [], bool $raw = bool ): string; @@ -775,18 +891,30 @@ protected function processAttributes( string $href, array $attributes ): array; -

Class Phalcon\Html\Helper\Base

+## Html\Helper\Base + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/Base.zep) + -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/Base.zep) +- __Namespace__ -| Namespace | Phalcon\Html\Helper | -| Uses | Phalcon\Html\Exception | -| Extends | AbstractHelper | + - `Phalcon\Html\Helper` + +- __Uses__ + + - `Phalcon\Html\Exception` + +- __Extends__ + + `AbstractHelper` + +- __Implements__ + Class Base -## Methods +### Methods ```php public function __invoke( string $href = null, array $attributes = [] ): string; @@ -796,18 +924,30 @@ Produce a `` tag. -

Class Phalcon\Html\Helper\Body

+## Html\Helper\Body + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/Body.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/Body.zep) + - `Phalcon\Html\Helper` -| Namespace | Phalcon\Html\Helper | -| Uses | Phalcon\Html\Exception | -| Extends | AbstractHelper | +- __Uses__ + + - `Phalcon\Html\Exception` + +- __Extends__ + + `AbstractHelper` + +- __Implements__ + Class Body -## Methods +### Methods ```php public function __invoke( array $attributes = [] ): string; @@ -817,18 +957,30 @@ Produce a `` tag. -

Class Phalcon\Html\Helper\Button

+## Html\Helper\Button + +[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/Button.zep) + + +- __Namespace__ -[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Html/Helper/Button.zep) + - `Phalcon\Html\Helper` -| Namespace | Phalcon\Html\Helper | -| Uses | Phalcon\Html\Exception | -| Extends | AbstractHelper | +- __Uses__ + + - `Phalcon\Html\Exception` + +- __Extends__ + + `AbstractHelper` + +- __Implements__ + Class Button -## Methods +### Methods ```php public function __invoke( string $text, array $attributes = [], bool $raw = bool ): string; @@ -838,17 +990,29 @@ Produce a `