This repository has been archived by the owner on Feb 13, 2019. It is now read-only.
-
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.
You can now specify only required information. DBM load automatically your entity and your form type without fullPath and other details. Permissions of all entities are more efficiently managed and easier to configure. Now, DBM can also configure your views with default settings.
- Loading branch information
Showing
9 changed files
with
237 additions
and
76 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
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 | ||
|
||
namespace DB\ManagerBundle\Model; | ||
|
||
use DB\ManagerBundle\Model\ListingEntityInterface; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* Storage agnostic manager full compatible object. | ||
* | ||
* @author Hugo Fouquet <[email protected]> | ||
*/ | ||
abstract class BaseManager implements ListingEntityInterface | ||
{ | ||
private $bloquedMethods = array('getVars', 'getProperties'); | ||
|
||
/** | ||
* @return All properties values | ||
*/ | ||
public function getVars(){ | ||
return $this->getProp(true); | ||
} | ||
|
||
/** | ||
* @return All properties names | ||
*/ | ||
public function getProperties(){ | ||
return $this->getProp(false); | ||
} | ||
|
||
private function getProp(bool $execute) { | ||
$reflect = new \ReflectionClass($this); | ||
$methods = $reflect->getMethods(\ReflectionProperty::IS_PUBLIC); | ||
|
||
$tmp = array(); | ||
foreach ($methods as $met) { | ||
$metName = $met->getName(); | ||
if (0 === strpos($metName, 'get') && !in_array($metName, $this->bloquedMethods)) { | ||
if ($execute) | ||
$tmp[] = $this->$metName(); | ||
else | ||
$tmp[] = str_replace('get', '', $metName); | ||
} | ||
} | ||
return $tmp; | ||
} | ||
} | ||
|
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,9 @@ | ||
<?php | ||
|
||
namespace DB\ManagerBundle\Model; | ||
|
||
interface ListingEntityInterface | ||
{ | ||
public function getVars(); | ||
public function getProperties(); | ||
} |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
Comin soon | ||
Comin soon | ||
|
||
Amélioration du config.yml | ||
name and bundle in same | ||
|
||
Ajout du routing dans le README | ||
|
||
Gérer bdd vide | ||
|
||
template for listing in config | ||
|
||
Entity: | ||
formtype: #Optional |
Oops, something went wrong.