You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/php_api/php_api.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ page_type: reference
5
5
6
6
# PHP API
7
7
8
-
The [public PHP API](../php_api_reference/) enables you to interact with [[= product_name =]]'s Repository and content model from your PHP code.
8
+
The [public PHP API](/api/php_api/php_api_reference/index.html) enables you to interact with [[= product_name =]]'s Repository and content model from your PHP code.
9
9
10
10
You can use it to create, read, update, manage, and delete all objects available in [[= product_name =]], namely content and related objects such as sections, locations, content types, or languages.
11
11
@@ -18,37 +18,37 @@ The API provides access to content, user, content types, and other features thro
-[CorporateAccountService](php_api_reference/classes/Ibexa-Contracts-CorporateAccount-Service-CorporateAccountService.html) (recommended for company creation)
-[CorporateAccountService](/api/php_api/php_api_reference/classes/Ibexa-Contracts-CorporateAccount-Service-CorporateAccountService.html) (recommended for company creation)
You can access the PHP API by injecting relevant services into your code:
48
48
49
49
- By using [auto-wiring]([[= symfony_doc =]]/service_container/autowiring.html), and the service classname in the `Ibexa\Contracts` namespace (see `bin/console debug:autowiring | grep Ibexa.Contracts`).
50
50
- By using [service parameters]([[= symfony_doc =]]/service_container.html#service-parameters), and service aliases (see `bin/console debug:autowiring | grep ibexa.api`).
51
-
- By using the repository's `get[ServiceName]()` methods, for example, [`Repository::getContentService()`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Repository.html#method_getContentService), or [`getUserService()`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Repository.html#method_getUserService).
51
+
- By using the repository's `get[ServiceName]()` methods, for example, [`Repository::getContentService()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Repository.html#method_getContentService), or [`getUserService()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Repository.html#method_getUserService).
52
52
(Prefer injecting several Repository's dedicated services instead of the whole Repository if the Repository itself isn't needed.)
53
53
54
54
!!! caution
@@ -57,12 +57,12 @@ You can access the PHP API by injecting relevant services into your code:
57
57
58
58
## Value objects
59
59
60
-
The services provide interaction with read-only value objects from the [`Ibexa\Contracts\Core\Repository\Values`](php_api_reference/namespaces/ibexa-contracts-core-repository-values.html) namespace.
61
-
Those objects are divided into sub-namespaces, such as [`Content`](php_api_reference/namespaces/ibexa-contracts-core-repository-values-content.html), [`User`](php_api_reference/namespaces/ibexa-contracts-core-repository-values-user.html) or [`ObjectState`](php_api_reference/namespaces/ibexa-contracts-core-repository-values-objectstate.html).
60
+
The services provide interaction with read-only value objects from the [`Ibexa\Contracts\Core\Repository\Values`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-core-repository-values.html) namespace.
61
+
Those objects are divided into sub-namespaces, such as [`Content`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-core-repository-values-content.html), [`User`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-core-repository-values-user.html) or [`ObjectState`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-core-repository-values-objectstate.html).
62
62
Each sub-namespace contains a set of value objects,
63
-
such as [`Content\Content`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) or [`User\Role`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-User-Role.html).
63
+
such as [`Content\Content`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Content.html) or [`User\Role`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-User-Role.html).
64
64
65
-
Value objects come with their own properties, such as `$content->id` or `$location->hidden`, and with methods that provide access to more related information, such as [`Content\Relation::getSourceContentInfo()`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Relation.html#method_getSourceContentInfo) or [`User\Role::getPolicies()`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-User-Role.html#method_getPolicies).
65
+
Value objects come with their own properties, such as `$content->id` or `$location->hidden`, and with methods that provide access to more related information, such as [`Content\Relation::getSourceContentInfo()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Relation.html#method_getSourceContentInfo) or [`User\Role::getPolicies()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-User-Role.html#method_getPolicies).
66
66
67
67
### Creating and updating objects
68
68
@@ -131,7 +131,7 @@ To identify as a different user, you need to use the `UserService` together with
131
131
132
132
!!! tip
133
133
134
-
[`Ibexa\Contracts\Core\Repository\PermissionService`](php_api_reference/classes/Ibexa-Contracts-Core-Repository-PermissionService.html) can be injected to have a Service which provides both `PermissionResolver` and `PermissionCriterionResolver`.
134
+
[`Ibexa\Contracts\Core\Repository\PermissionService`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-PermissionService.html) can be injected to have a Service which provides both `PermissionResolver` and `PermissionCriterionResolver`.
135
135
It supports auto-wiring.
136
136
137
137
This isn't required in template functions or controller code, as the HTTP layer takes care of identifying the user, and automatically sets it in the repository.
0 commit comments