Skip to content

Releases: cycle/annotated

v4.2.0

03 Sep 15:05
d882fe4
Compare
Choose a tag to compare

What's Changed

  • Support more types as value of SingleTable attribute by @vjik in #103

New Contributors

  • @vjik made their first contribution in #103

Full Changelog: v4.1.0...v4.2.0

v4.1.0

08 Feb 21:47
7dad356
Compare
Choose a tag to compare

What's Changed

  • Add support for generated fields by @msmakouz in #95
  • Add additional tests to cover unsigned and zerofill attributes by @msmakouz in #94

Full Changelog: v4.0.0...v4.1.0

v3.5.0

08 Feb 21:33
4024d2e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.4.0...v3.5.0

v4.0.0

08 Jan 09:20
af04e98
Compare
Choose a tag to compare

What's Changed

  • Logic for entity detection has been rewritten using Tokenizer Listeners by @msmakouz in #60
  • doctrine/annotations has been moved to the require-dev section by @msmakouz in #73
  • The minimum PHP version has been raised to 8.1 by @msmakouz in #81
  • Removed deprecated code by @msmakouz in #83
  • AttributeReader was set as the default reader by @msmakouz in #93

Full Changelog: v3.4.0...v4.0.0

v3.4.0

23 Nov 14:51
bb376d2
Compare
Choose a tag to compare

What's Changed

  • Removing unused import by @msmakouz in #90
  • Expose a Foreign Key definition via the new ForeignKey attribute by @msmakouz in #91

Foreign Key declaration via attributes

Now, you can easily define foreign keys in your entity classes using attributes, without needing any relation definitions.

How It Works:

  1. Define Entities using the #[Entity] attribute. For example, a User entity can be created with an ID as the primary key.

    use Cycle\Annotated\Annotation\Entity;
    use Cycle\Annotated\Annotation\Column;
    
    #[Entity]
    class User
    {
        #[Column(type: 'primary')]
        public int $id;
    }
  2. Set up Foreign Keys in two ways:

  • Directly on Properties: You can annotate a property in your class to indicate it's a foreign key related to another entity.

    use Cycle\Annotated\Annotation\Entity;
    use Cycle\Annotated\Annotation\ForeignKey;
    
    #[Entity]
    class Post
    {
        // ...
        #[Column(type: 'integer')]
        #[ForeignKey(target: User::class, action: 'CASCADE')]
        private int $userId;
    }
  • Or, on the Class Itself: Alternatively, you can place the foreign key annotation at the class level, specifying details like which property in your class is the foreign key (innerKey), and which property in the related class it corresponds to (outerKey).

    use Cycle\Annotated\Annotation\Entity;
    use Cycle\Annotated\Annotation\ForeignKey;
    
    #[Entity]
    #[ForeignKey(target: User::class, innerKey: 'userId', outerKey: 'id', action: 'CASCADE')]
    class Post
    {
        // ...
        #[Column(type: 'integer')]
        private int $userId;
    }

Full Changelog: v3.3.1...v3.4.0

v3.3.1

15 Sep 13:14
abd3c24
Compare
Choose a tag to compare

What's Changed

  • Fix table name searching when using table inheritance. It no longer depends on the order of class scanning using the Tokenizer by @msmakouz in #88

Full Changelog: v3.3.0...v3.3.1

v3.3.0

16 May 07:55
d4d4c94
Compare
Choose a tag to compare

What's Changed

  • Describe new column types in #[Column] expected values by @msmakouz in #70
  • Add ability to define any column attributes by @roxblnfk and @gam6itko in #53
  • Add ability to parse parent class attributes in the MergeColumns generator by @msmakouz in #72
  • Add readonlySchema to the Column annotation by @msmakouz in #75

Full Changelog: v3.2.1...v3.3.0

v3.2.1

01 Feb 17:24
v3.2.1
0e0afb4
Compare
Choose a tag to compare

What's Changed

  • Fix that the JTI parent has fields from children by @msmakouz in #65 thx @kastahov for tests in #64
  • Add smallInteger type hint to the Column attribute by @gam6itko in #52
  • Extend supporting for doctrine/annotations to version 2.0 by @msmakouz in #66
  • Fix bug #54 when children were not added on using attributes without dockblock by @makedo in #55

New Contributors

  • @kastahov made their first contribution in #64
  • @makedo made their first contribution in #55

Full Changelog: v3.2.0...v3.2.1

3.2.0

05 Jul 19:32
78c8f0e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.1.0...v3.2.0

3.1.0

20 Jan 12:41
6826b61
Compare
Choose a tag to compare

What's Changed

  • Add test cases related to different relation field definitions by @roxblnfk (#44)
  • Add prefix parameter to Embedded by @msmakouz (#46)
  • Add Foreign Keys for JTI by @msmakouz in (#43)
  • Fix comment to the Column field 'typecast' by @roquie (#49)
  • Fix error related with morphKey default value by @roxblnfk in (#50)

New Contributors

Full Changelog: v3.0.0...v3.1.0