This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from archdevil666pl/master
Added repository pattern samples
- Loading branch information
Showing
5 changed files
with
81 additions
and
12 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
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,48 @@ | ||
<?php | ||
/** | ||
* This file is part of Vegas package | ||
* | ||
* @author Radosław Fąfara <radek@amsterdam-standard.pl> | ||
* @copyright Amsterdam Standard Sp. Z o.o. | ||
* @homepage http://vegas-cmf.github.io | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Vegas\Db\Decorator\Helper; | ||
|
||
/** | ||
* Trait RepositoryTrait | ||
* Sample trait to be used by Model/Collection repositories. | ||
* @package Vegas\Db\Decorator\Helper | ||
*/ | ||
trait RepositoryTrait | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function find($parameters=null) | ||
{ | ||
$classname = get_parent_class(__CLASS__); | ||
return $classname::find($parameters); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function findFirst($parameters=null) | ||
{ | ||
$classname = get_parent_class(__CLASS__); | ||
return $classname::findFirst($parameters); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function findById($id) | ||
{ | ||
$classname = get_parent_class(__CLASS__); | ||
return $classname::findById($id); | ||
} | ||
} |
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