Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
cc0f7375
Commit
cc0f7375
authored
Oct 08, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from nWidart-Modules/feature/CoreRepositories
Feature/core repositories
parents
5c122607
41c9bbcf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
0 deletions
+136
-0
en.json
Assets/js/vendor/datatables/en.json
+23
-0
fr.json
Assets/js/vendor/datatables/fr.json
+22
-0
BaseRepository.php
Repositories/BaseRepository.php
+32
-0
EloquentBaseRepository.php
Repositories/Eloquent/EloquentBaseRepository.php
+59
-0
No files found.
Assets/js/vendor/datatables/en.json
0 → 100644
View file @
cc0f7375
{
"sEmptyTable"
:
"No data available in table"
,
"sInfo"
:
"Showing _START_ to _END_ of _TOTAL_ entries"
,
"sInfoEmpty"
:
"Showing 0 to 0 of 0 entries"
,
"sInfoFiltered"
:
"(filtered from _MAX_ total entries)"
,
"sInfoPostFix"
:
""
,
"sInfoThousands"
:
","
,
"sLengthMenu"
:
"Show _MENU_ entries"
,
"sLoadingRecords"
:
"Loading..."
,
"sProcessing"
:
"Processing..."
,
"sSearch"
:
"Search:"
,
"sZeroRecords"
:
"No matching records found"
,
"oPaginate"
:
{
"sFirst"
:
"First"
,
"sLast"
:
"Last"
,
"sNext"
:
"Next"
,
"sPrevious"
:
"Previous"
},
"oAria"
:
{
"sSortAscending"
:
": activate to sort column ascending"
,
"sSortDescending"
:
": activate to sort column descending"
}
}
\ No newline at end of file
Assets/js/vendor/datatables/fr.json
0 → 100644
View file @
cc0f7375
{
"sProcessing"
:
"Traitement en cours..."
,
"sSearch"
:
"Rechercher :"
,
"sLengthMenu"
:
"Afficher _MENU_ éléments"
,
"sInfo"
:
"Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments"
,
"sInfoEmpty"
:
"Affichage de l'élement 0 à 0 sur 0 éléments"
,
"sInfoFiltered"
:
"(filtré de _MAX_ éléments au total)"
,
"sInfoPostFix"
:
""
,
"sLoadingRecords"
:
"Chargement en cours..."
,
"sZeroRecords"
:
"Aucun élément à afficher"
,
"sEmptyTable"
:
"Aucune donnée disponible dans le tableau"
,
"oPaginate"
:
{
"sFirst"
:
"Premier"
,
"sPrevious"
:
"Précédent"
,
"sNext"
:
"Suivant"
,
"sLast"
:
"Dernier"
},
"oAria"
:
{
"sSortAscending"
:
": activer pour trier la colonne par ordre croissant"
,
"sSortDescending"
:
": activer pour trier la colonne par ordre décroissant"
}
}
\ No newline at end of file
Repositories/BaseRepository.php
0 → 100644
View file @
cc0f7375
<?php
namespace
Modules\Core\Repositories
;
/**
* Interface CoreRepository
* @package Modules\Core\Repositories
*/
interface
BaseRepository
{
/**
* @param $id
* @return mixed
*/
public
function
find
(
$id
);
/**
* @return mixed
*/
public
function
all
();
/**
* @param $data
* @return mixed
*/
public
function
add
(
$data
);
/**
* @param $ids
* @return mixed
*/
public
function
remove
(
$ids
);
}
Repositories/Eloquent/EloquentBaseRepository.php
0 → 100644
View file @
cc0f7375
<?php
namespace
Modules\Core\Repositories\Eloquent
;
use
Illuminate\Database\Eloquent\Model
;
use
Modules\Core\Repositories\BaseRepository
;
/**
* Class EloquentCoreRepository
* @package Modules\Core\Repositories\Eloquent
*/
abstract
class
EloquentBaseRepository
implements
BaseRepository
{
/**
* @var Model An instance of the Eloquent Model
*/
protected
$model
;
/**
* @param Model $model
*/
public
function
__construct
(
Model
$model
)
{
$this
->
model
=
$model
;
}
/**
* @param int $id
* @return mixed
*/
public
function
find
(
$id
)
{
return
$this
->
model
->
find
(
$id
);
}
/**
* @return mixed
*/
public
function
all
()
{
return
$this
->
model
->
all
();
}
/**
* @param mixed $data
* @return mixed
*/
public
function
add
(
$data
)
{
return
$this
->
model
->
create
(
$data
);
}
/**
* @param int|int[] $ids
* @return mixed
*/
public
function
remove
(
$ids
)
{
return
$this
->
model
->
destroy
(
$ids
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment