@@ -96,7 +96,7 @@ |
||
| 96 | 96 | 'tags' => array(array('name' => 'dtc_grid.source')), |
| 97 | 97 | 'calls' => array( |
| 98 | 98 | array('autoDiscoverColumns'), |
| 99 | - ), ); |
|
| 99 | + ),); |
|
| 100 | 100 | |
| 101 | 101 | if ($columns && isset($gridColumnsNamespace) && isset($gridColumnClass)) { |
| 102 | 102 | $config[$serviceName]['calls'] = array( |
@@ -20,6 +20,9 @@ discard block |
||
| 20 | 20 | private $saveCache; |
| 21 | 21 | private $skeletonDir; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $skeletonDir |
|
| 25 | + */ |
|
| 23 | 26 | public function __construct($skeletonDir, ContainerInterface $container) |
| 24 | 27 | { |
| 25 | 28 | $this->skeletonDir = $skeletonDir; |
@@ -58,6 +61,9 @@ discard block |
||
| 58 | 61 | return array($gridColumnClass, $gridColumnsNamespace, $gridColumnPath, $templatePath); |
| 59 | 62 | } |
| 60 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string $entityDocument |
|
| 66 | + */ |
|
| 61 | 67 | public function generate(BundleInterface $bundle, $entityDocument, $metadata, $columns = false) |
| 62 | 68 | { |
| 63 | 69 | if ($metadata instanceof ClassMetadataInfo) { |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | protected function fromCamelCase($str) |
| 13 | 13 | { |
| 14 | - $func = function ($str) { |
|
| 14 | + $func = function($str) { |
|
| 15 | 15 | return ' '.$str[0]; |
| 16 | 16 | }; |
| 17 | 17 | |
@@ -68,7 +68,6 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * @param mixed $bootstrapCss |
|
| 72 | 71 | */ |
| 73 | 72 | public function setThemeCss(array $themeCss) |
| 74 | 73 | { |
@@ -84,7 +83,6 @@ discard block |
||
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | /** |
| 87 | - * @param mixed $bootstrapJs |
|
| 88 | 86 | */ |
| 89 | 87 | public function setThemeJs(array $themeJs) |
| 90 | 88 | { |
@@ -36,6 +36,9 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | protected $annotationSort; |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param boolean $flag |
|
| 41 | + */ |
|
| 39 | 42 | public function setDebug($flag) |
| 40 | 43 | { |
| 41 | 44 | $this->debug = $flag; |
@@ -386,7 +386,7 @@ |
||
| 386 | 386 | return; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | - uasort($ordered, function ($columnDef1, $columnDef2) { |
|
| 389 | + uasort($ordered, function($columnDef1, $columnDef2) { |
|
| 390 | 390 | $columnParts1 = $columnDef1['arguments']; |
| 391 | 391 | $columnParts2 = $columnDef2['arguments']; |
| 392 | 392 | $order1 = $columnParts1[5]; |
@@ -6,18 +6,33 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | interface GridSourceInterface |
| 8 | 8 | { |
| 9 | + /** |
|
| 10 | + * @return void |
|
| 11 | + */ |
|
| 9 | 12 | public function setId($id); |
| 10 | 13 | |
| 14 | + /** |
|
| 15 | + * @return string |
|
| 16 | + */ |
|
| 11 | 17 | public function getId(); |
| 12 | 18 | |
| 13 | 19 | public function getCount(); |
| 14 | 20 | |
| 15 | 21 | public function getRecords(); |
| 16 | 22 | |
| 23 | + /** |
|
| 24 | + * @return integer |
|
| 25 | + */ |
|
| 17 | 26 | public function getLimit(); |
| 18 | 27 | |
| 28 | + /** |
|
| 29 | + * @return integer |
|
| 30 | + */ |
|
| 19 | 31 | public function getOffset(); |
| 20 | 32 | |
| 33 | + /** |
|
| 34 | + * @return void |
|
| 35 | + */ |
|
| 21 | 36 | public function getLastModified(); |
| 22 | 37 | |
| 23 | 38 | /** |
@@ -38,8 +53,14 @@ discard block |
||
| 38 | 53 | |
| 39 | 54 | public function getOrderBy(); |
| 40 | 55 | |
| 56 | + /** |
|
| 57 | + * @return void |
|
| 58 | + */ |
|
| 41 | 59 | public function setColumns($columns); |
| 42 | 60 | |
| 61 | + /** |
|
| 62 | + * @return boolean |
|
| 63 | + */ |
|
| 43 | 64 | public function hasIdColumn(); |
| 44 | 65 | |
| 45 | 66 | public function find($id); |
@@ -71,6 +71,9 @@ discard block |
||
| 71 | 71 | return $this->debug; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $id |
|
| 76 | + */ |
|
| 74 | 77 | public function add($id, GridSourceInterface $gridSource) |
| 75 | 78 | { |
| 76 | 79 | $this->extraGridSources[$id] = $gridSource; |
@@ -117,9 +120,8 @@ discard block |
||
| 117 | 120 | /** |
| 118 | 121 | * Get a gridsource. |
| 119 | 122 | * |
| 120 | - * @param string $id Entity or Document |
|
| 121 | - * @param EntityManager|DocumentManager|null $manager (optional) Entity or Document manager to use (overrides default) |
|
| 122 | 123 | * |
| 124 | + * @param string|null $entityOrDocumentNameOrId |
|
| 123 | 125 | * @return GridSourceInterface|null |
| 124 | 126 | * |
| 125 | 127 | * @throws \Exception |
@@ -100,12 +100,12 @@ |
||
| 100 | 100 | |
| 101 | 101 | // We need to pass filter information here. |
| 102 | 102 | $params = array( |
| 103 | - 'id' => $this->gridSource->getId(), |
|
| 104 | - 'renderer' => 'datatables', |
|
| 105 | - 'filter' => $this->gridSource->getFilter(), |
|
| 106 | - 'parameters' => $this->gridSource->getParameters(), |
|
| 107 | - 'order' => $this->gridSource->getOrderBy(), |
|
| 108 | - 'fields' => $fields, |
|
| 103 | + 'id' => $this->gridSource->getId(), |
|
| 104 | + 'renderer' => 'datatables', |
|
| 105 | + 'filter' => $this->gridSource->getFilter(), |
|
| 106 | + 'parameters' => $this->gridSource->getParameters(), |
|
| 107 | + 'order' => $this->gridSource->getOrderBy(), |
|
| 108 | + 'fields' => $fields, |
|
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | 111 | $sortInfo = $this->gridSource->getDefaultSort(); |
@@ -75,11 +75,17 @@ |
||
| 75 | 75 | return array(substr($entity, 0, $pos), substr($entity, $pos + 1)); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | + /** |
|
| 79 | + * @param string $entity |
|
| 80 | + */ |
|
| 78 | 81 | protected function getEntityMetadata($entity) |
| 79 | 82 | { |
| 80 | 83 | return $this->getContainer()->get('doctrine.orm.default_entity_manager')->getClassMetadata($entity); |
| 81 | 84 | } |
| 82 | 85 | |
| 86 | + /** |
|
| 87 | + * @param string $document |
|
| 88 | + */ |
|
| 83 | 89 | protected function getDocumentMetadata($document) |
| 84 | 90 | { |
| 85 | 91 | return $this->getContainer()->get('doctrine_mongodb.odm.default_document_manager')->getClassMetadata($document); |
@@ -23,6 +23,9 @@ |
||
| 23 | 23 | return $this->saveFile($target, $output); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string $output |
|
| 28 | + */ |
|
| 26 | 29 | protected function saveFile($target, $output) |
| 27 | 30 | { |
| 28 | 31 | if (!is_dir(dirname($target))) { |