Skip to content

Commit

Permalink
Update doc block comments and inline examples on marker interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker authored and franmomu committed Feb 19, 2024
1 parent 0287e8d commit 8d658b4
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 76 deletions.
16 changes: 7 additions & 9 deletions src/Blameable/Blameable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\Blameable;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified as
* Blameable
* Marker interface for objects which can be identified as blamable.
*
* @author Gediminas Morkevicius <[email protected]>
*/
Expand All @@ -21,35 +19,35 @@ interface Blameable
// blameable expects annotations on properties

/*
* @gedmo:Blameable(on="create")
* @Gedmo\Blameable(on="create")
* fields which should be updated on insert only
*/

/*
* @gedmo:Blameable(on="update")
* @Gedmo\Blameable(on="update")
* fields which should be updated on update and insert
*/

/*
* @gedmo:Blameable(on="change", field="field", value="value")
* @Gedmo\Blameable(on="change", field="field", value="value")
* fields which should be updated on changed "property"
* value and become equal to given "value"
*/

/*
* @gedmo:Blameable(on="change", field="field")
* @Gedmo\Blameable(on="change", field="field")
* fields which should be updated on changed "property"
*/

/*
* @gedmo:Blameable(on="change", fields={"field1", "field2"})
* @Gedmo\Blameable(on="change", fields={"field1", "field2"})
* fields which should be updated if at least one of the given fields changed
*/

/*
* example
*
* @gedmo:Blameable(on="create")
* @Gedmo\Blameable(on="create")
* @Column(type="string")
* $created
*/
Expand Down
16 changes: 7 additions & 9 deletions src/IpTraceable/IpTraceable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\IpTraceable;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified as
* IpTraceable
* Marker interface for objects which can be identified as IP traceable.
*
* @author Pierre-Charles Bertineau <[email protected]>
*/
Expand All @@ -21,35 +19,35 @@ interface IpTraceable
// ipTraceable expects annotations on properties

/*
* @gedmo:IpTraceable(on="create")
* @Gedmo\IpTraceable(on="create")
* strings which should be updated on insert only
*/

/*
* @gedmo:IpTraceable(on="update")
* @Gedmo\IpTraceable(on="update")
* strings which should be updated on update and insert
*/

/*
* @gedmo:IpTraceable(on="change", field="field", value="value")
* @Gedmo\IpTraceable(on="change", field="field", value="value")
* strings which should be updated on changed "property"
* value and become equal to given "value"
*/

/*
* @gedmo:IpTraceable(on="change", field="field")
* @Gedmo\IpTraceable(on="change", field="field")
* strings which should be updated on changed "property"
*/

/*
* @gedmo:IpTraceable(on="change", fields={"field1", "field2"})
* @Gedmo\IpTraceable(on="change", fields={"field1", "field2"})
* strings which should be updated if at least one of the given fields changed
*/

/*
* example
*
* @gedmo:IpTraceable(on="create")
* @Gedmo\IpTraceable(on="create")
* @Column(type="string")
* $created
*/
Expand Down
10 changes: 4 additions & 6 deletions src/Loggable/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\Loggable;

/**
* This interface is not necessary but can be implemented for
* Domain Objects which in some cases needs to be identified as
* Loggable
* Marker interface for objects which can be identified as loggable.
*
* @author Gediminas Morkevicius <[email protected]>
*/
Expand All @@ -21,14 +19,14 @@ interface Loggable
// this interface is not necessary to implement

/*
* @gedmo:Loggable
* to mark the class as loggable use class annotation @gedmo:Loggable
* @Gedmo\Loggable
* to mark the class as loggable use class annotation @Gedmo\Loggable
* this object will contain now a history
* available options:
* logEntryClass="My\LogEntryObject" (optional) defaultly will use internal object class
* example:
*
* @gedmo:Loggable(logEntryClass="My\LogEntryObject")
* @Gedmo\Loggable(logEntryClass="My\LogEntryObject")
* class MyEntity
*/
}
4 changes: 1 addition & 3 deletions src/ReferenceIntegrity/ReferenceIntegrity.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\ReferenceIntegrity;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified te have
* ReferenceIntegrity checks
* Marker interface for objects which can be identified as requiring reference integrity checks.
*
* @author Evert Harmeling <[email protected]>
*/
Expand Down
12 changes: 5 additions & 7 deletions src/Sluggable/Sluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\Sluggable;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified as
* Sluggable
* Marker interface for objects which can be identified as sluggable.
*
* @author Gediminas Morkevicius <[email protected]>
*/
Expand All @@ -21,13 +19,13 @@ interface Sluggable
// use now annotations instead of predefined methods, this interface is not necessary

/*
* @gedmo:Sluggable
* to mark the field as sluggable use property annotation @gedmo:Sluggable
* @Gedmo\Sluggable
* to mark the field as sluggable use property annotation @Gedmo\Sluggable
* this field value will be included in built slug
*/

/*
* @gedmo:Slug - to mark property which will hold slug use annotation @gedmo:Slug
* @Gedmo\Slug - to mark property which will hold slug use annotation @Gedmo\Slug
* available options:
* updatable (optional, default=true) - true to update the slug on sluggable field changes, false - otherwise
* unique (optional, default=true) - true if slug should be unique and if identical it will be prefixed, false - otherwise
Expand All @@ -40,7 +38,7 @@ interface Sluggable
*
* example:
*
* @gedmo:Slug(style="camel", separator="_", prefix="", suffix="", updatable=false, unique=false)
* @Gedmo\Slug(style="camel", separator="_", prefix="", suffix="", updatable=false, unique=false)
* @Column(type="string", length=64)
* $property
*/
Expand Down
10 changes: 4 additions & 6 deletions src/SoftDeleteable/SoftDeleteable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\SoftDeleteable;

/**
* This interface is not necessary but can be implemented for
* Domain Objects which in some cases needs to be identified as
* SoftDeleteable
* Marker interface for objects which can be identified as soft-deletable.
*
* @author Gustavo Falco <[email protected]>
* @author Gediminas Morkevicius <[email protected]>
Expand All @@ -22,12 +20,12 @@ interface SoftDeleteable
// this interface is not necessary to implement

/*
* @gedmo:SoftDeleteable
* to mark the class as SoftDeleteable use class annotation @gedmo:SoftDeleteable
* @Gedmo\SoftDeleteable
* to mark the class as SoftDeleteable use class annotation @Gedmo\SoftDeleteable
* this object will be able to be soft deleted
* example:
*
* @gedmo:SoftDeleteable
* @Gedmo\SoftDeleteable
* class MyEntity
*/
}
14 changes: 6 additions & 8 deletions src/Sortable/Sortable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\Sortable;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified as
* Sortable
* Marker interface for objects which can be identified as sortable.
*
* @author Lukas Botsch <[email protected]>
*/
Expand All @@ -21,27 +19,27 @@ interface Sortable
// use now annotations instead of predefined methods, this interface is not necessary

/*
* @gedmo:SortablePosition - to mark property which will hold the item position use annotation @gedmo:SortablePosition
* @Gedmo\SortablePosition - to mark property which will hold the item position use annotation @Gedmo\SortablePosition
* This property has to be numeric. The position index can be negative and will be counted from right to left.
*
* example:
*
* @gedmo:SortablePosition
* @Gedmo\SortablePosition
* @Column(type="int")
* $position
*
* @gedmo:SortableGroup
* @Gedmo\SortableGroup
* @Column(type="string", length=64)
* $category
*
*/

/*
* @gedmo:SortableGroup - to group node sorting by a property use annotation @gedmo:SortableGroup on this property
* @Gedmo\SortableGroup - to group node sorting by a property use annotation @Gedmo\SortableGroup on this property
*
* example:
*
* @gedmo:SortableGroup
* @Gedmo\SortableGroup
* @Column(type="string", length=64)
* $category
*/
Expand Down
16 changes: 7 additions & 9 deletions src/Timestampable/Timestampable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\Timestampable;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified as
* Timestampable
* Marker interface for objects which can be identified as timestampable.
*
* @author Gediminas Morkevicius <[email protected]>
*/
Expand All @@ -21,35 +19,35 @@ interface Timestampable
// timestampable expects annotations on properties

/*
* @gedmo:Timestampable(on="create")
* @Gedmo\Timestampable(on="create")
* dates which should be updated on insert only
*/

/*
* @gedmo:Timestampable(on="update")
* @Gedmo\Timestampable(on="update")
* dates which should be updated on update and insert
*/

/*
* @gedmo:Timestampable(on="change", field="field", value="value")
* @Gedmo\Timestampable(on="change", field="field", value="value")
* dates which should be updated on changed "property"
* value and become equal to given "value"
*/

/*
* @gedmo:Timestampable(on="change", field="field")
* @Gedmo\Timestampable(on="change", field="field")
* dates which should be updated on changed "property"
*/

/*
* @gedmo:Timestampable(on="change", fields={"field1", "field2"})
* @Gedmo\Timestampable(on="change", fields={"field1", "field2"})
* dates which should be updated if at least one of the given fields changed
*/

/*
* example
*
* @gedmo:Timestampable(on="create")
* @Gedmo\Timestampable(on="create")
* @Column(type="date")
* $created
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Translatable/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ interface Translatable
// use now annotations instead of predefined methods, this interface is not necessary

/*
* @gedmo:TranslationEntity
* @Gedmo\TranslationEntity
* to specify custom translation class use
* class annotation @gedmo:TranslationEntity(class="your\class")
* class annotation @Gedmo\TranslationEntity(class="your\class")
*/

/*
* @gedmo:Translatable
* @Gedmo\Translatable
* to mark the field as translatable,
* these fields will be translated
*/

/*
* @gedmo:Locale OR @gedmo:Language
* @Gedmo\Locale OR @Gedmo\Language
* to mark the field as locale used to override global
* locale settings from TranslatableListener
*/
Expand Down
16 changes: 7 additions & 9 deletions src/Tree/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
namespace Gedmo\Tree;

/**
* This interface is not necessary but can be implemented for
* Entities which in some cases needs to be identified as
* Tree Node
* Marker interface for objects which can be identified as a tree node.
*
* @method void setSibling(self $node)
* @method ?self getSibling()
Expand All @@ -24,25 +22,25 @@ interface Node
// use now annotations instead of predefined methods, this interface is not necessary

/*
* @gedmo:TreeLeft
* to mark the field as "tree left" use property annotation @gedmo:TreeLeft
* @Gedmo\TreeLeft
* to mark the field as "tree left" use property annotation @Gedmo\TreeLeft
* it will use this field to store tree left value
*/

/*
* @gedmo:TreeRight
* to mark the field as "tree right" use property annotation @gedmo:TreeRight
* @Gedmo\TreeRight
* to mark the field as "tree right" use property annotation @Gedmo\TreeRight
* it will use this field to store tree right value
*/

/*
* @gedmo:TreeParent
* @Gedmo\TreeParent
* in every tree there should be link to parent. To identify a relation
* as parent relation to child use @Tree:Ancestor annotation on the related property
*/

/*
* @gedmo:TreeLevel
* @Gedmo\TreeLevel
* level of node.
*/

Expand Down
Loading

0 comments on commit 8d658b4

Please sign in to comment.