Created
February 24, 2014 14:39
-
-
Save mnapoli/9189509 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
trait class ABetterNameHere | |
{ | |
public function someGenericMethod() | |
{ | |
// ... | |
} | |
} | |
// Still generic definition of a sortable entity (text blocks or such) | |
trait ModelWithPositionField | |
{ | |
private $position; | |
public function setPosition($newPosition) | |
{ | |
$this->position = $newPosition; | |
} | |
} | |
// Another generic definition of an entity with some given functionality that might be of use for multiple concrete entities | |
trait ModelWithSomeOtherFunctionality | |
{ | |
public function someOtherMethod() | |
{ | |
// ... | |
} | |
} | |
class ActualEntityModel | |
{ | |
use ABetterNameHere; | |
use ModelWithPositionField; | |
use ModelWithSomeOtherFunctionality; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment