Skip to content

Commit

Permalink
docs: Andrij's Jul 3 changes [20]
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp authored and gitbook-bot committed Jul 3, 2024
1 parent 9dbb0f7 commit b52b819
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 6 deletions.
Binary file added docs/.gitbook/assets/screenshot (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [Introduction](README.md)
* [Installation](general/installation.md)
* [Contributing](general/contributing.md)

## 💾 Active Entities

Expand Down
20 changes: 18 additions & 2 deletions docs/active-entities/defining-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ These approaches will be used as main examples across documentation to demonstra
{% tab title="Strict" %}
**Strict Approach:**

In the strict approach, you define your entity with private properties and provide public getter and setter methods to access and modify the properties. This approach encapsulates the entity's internal state and provides better control over how the properties are accessed and modified.
In the strict approach, you define your entity with private properties and provide public getter and setter methods to access and modify the properties.

This approach encapsulates the entity's internal state and provides better control over how the properties are accessed and modified.

```php
<?php
Expand Down Expand Up @@ -70,7 +72,9 @@ class User extends ActiveRecord
{% tab title="Fluent " %}
**Fluent Approach:**

In the fluent approach, you define your entity with public properties, allowing direct access to the properties without the need for explicit getter and setter methods. This approach leads to more concise and readable code, especially when dealing with simple entities.
In the fluent approach, you define your entity with public properties, allowing direct access to the properties without the need for explicit getter and setter methods.

This approach leads to more concise and readable code, especially when dealing with simple entities.

```php
<?php
Expand Down Expand Up @@ -105,3 +109,15 @@ class User extends ActiveRecord
{% endtab %}
{% endtabs %}



### 📚 Entity Annotations

Cycle Active Record uses PHP 8 attributes for entity mapping. These annotations allow you to define the structure of your entities, including table mappings, column definitions, and relationships.

For a full and detailed guide on using annotations in Cycle ORM, please refer to the official Cycle ORM documentation:

[Cycle ORM Annotated Entities](https://cycle-orm.dev/docs/annotated-entity/current/en)



22 changes: 18 additions & 4 deletions docs/active-entities/retrieving-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,25 @@ For advanced usage of the query builder, this package provides a way to group yo

### 🗂️ Collections

When working with Active Record entities, methods like `findAll()` retrieve multiple records from the database. However, instead of returning a plain PHP array, an instance of a collection class is returned. The specific type of collection class depends on the adapter package being used, such as:
The Cycle Active Record team is constantly working on improving the library. Keep an eye on the [official repository](https://github.com/cycle/active-record) for updates and new features, such as the potential introduction of Collection support for query results.

There is currently a Proof of Concept (PoC) Pull Request for introducing Collection support for query results:

* [PR #20: Implement basic collections](https://github.com/cycle/active-record/pull/20)

If you're interested in using Collections with Cycle Active Record, you can:

1. Follow the progress of this PR
2. Contribute to the discussion by providing feedback or use cases
3. Help with the implementation if you have experience with Collections in ORMs

Contributions from the community are welcome and can significantly impact the direction and features of the library. If Collections are a feature you're particularly interested in, consider getting involved in the development process.

Remember to check the contribution guidelines before submitting any code or opening issues.




* `spiral/cycle-bridge`,
* `yiisoft/yii-cycle`
* `wayofdev/laravel-cycle-orm-adapter`



Loading

0 comments on commit b52b819

Please sign in to comment.