diff --git a/CHANGELOG_add_trait_monthelable_and_created.md b/CHANGELOG_add_trait_monthelable_and_created.md index a8f2df5..3f3824a 100644 --- a/CHANGELOG_add_trait_monthelable_and_created.md +++ b/CHANGELOG_add_trait_monthelable_and_created.md @@ -1,3 +1,3 @@ ### Added -`Entity::CreatableTrait` Trait with creation date -`Entity::MonthelableTrait` Trait with numeric representation of a month and his numeric year. Useful for statistics purposes. \ No newline at end of file +`Entity::CreatableTrait` Trait & interface with creation date +`Entity::MonthYearTrait` Trait & interface with numeric representation of a month and his numeric year. Useful for statistics purposes. diff --git a/src/Entity/CreatableInterface.php b/src/Entity/CreatableInterface.php new file mode 100644 index 0000000..45760d6 --- /dev/null +++ b/src/Entity/CreatableInterface.php @@ -0,0 +1,11 @@ +year = $year; } - public function setMonthelableDate(\DateTime $date): void + public function setMonthYearFromDate(\DateTime $date): void { $this->month = (int) $date->format('n'); $this->year = (int) $date->format('Y');