-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename MonthelableTrait as MonthYearTrait and add interfaces
- Loading branch information
1 parent
1d61f9f
commit 2b839c4
Showing
5 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
`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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Smart\CoreBundle\Entity; | ||
|
||
interface CreatableInterface | ||
{ | ||
public function getCreatedAt(): ?\DateTime; | ||
|
||
public function setCreatedAt(?\DateTime $createdAt): static; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Smart\CoreBundle\Entity; | ||
|
||
interface MonthYearInterface | ||
{ | ||
public function getMonth(): int; | ||
|
||
public function setMonth(int $month): void; | ||
|
||
public function getYear(): int; | ||
|
||
public function setYear(int $year): void; | ||
|
||
public function setMonthYearFromDate(\DateTime $date): void; | ||
|
||
public function getFormattedMonth(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters