Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LeanMapper Workflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Mpro
LeanMapper Workflow
Commits
839042b0
Commit
839042b0
authored
May 26, 2014
by
Tomas Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typo: add whitespaces between methods, add comments
parent
4486b466
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
2 deletions
+69
-2
AbstractRepository.php
src/LeanMapperWorkflow/AbstractRepository.php
+3
-0
AbstractRestriction.php
src/LeanMapperWorkflow/AbstractRestriction.php
+31
-2
Entity.php
src/LeanMapperWorkflow/Entity.php
+1
-0
EntityFactory.php
src/LeanMapperWorkflow/EntityFactory.php
+3
-0
Mapper.php
src/LeanMapperWorkflow/Mapper.php
+1
-0
Repository.php
src/LeanMapperWorkflow/Repository.php
+9
-0
Restriction.php
src/LeanMapperWorkflow/Restriction.php
+10
-0
RestrictionWithOrdering.php
src/LeanMapperWorkflow/RestrictionWithOrdering.php
+11
-0
No files found.
src/LeanMapperWorkflow/AbstractRepository.php
View file @
839042b0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
abstract
class
AbstractRepository
extends
\LeanMapper\Repository
abstract
class
AbstractRepository
extends
\LeanMapper\Repository
{
{
...
@@ -10,6 +11,8 @@ abstract class AbstractRepository extends \LeanMapper\Repository
...
@@ -10,6 +11,8 @@ abstract class AbstractRepository extends \LeanMapper\Repository
*/
*/
abstract
public
function
createRestriction
();
abstract
public
function
createRestriction
();
/**
/**
* @param \DibiFluent $statement
* @param \DibiFluent $statement
* @param Restriction|null $restriction
* @param Restriction|null $restriction
...
...
src/LeanMapperWorkflow/AbstractRestriction.php
View file @
839042b0
...
@@ -2,15 +2,28 @@
...
@@ -2,15 +2,28 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
abstract
class
AbstractRestriction
abstract
class
AbstractRestriction
{
{
const
FLAG_COUNT
=
'count'
;
const
FLAG_COUNT
=
'count'
;
protected
$properties
=
array
();
private
$values
=
array
();
/** @var array */
protected
$properties
=
[];
/** @var array */
private
$values
=
[];
/** @var \LeanMapper\IMapper */
protected
$mapper
;
protected
$mapper
;
/**
* @param \LeanMapper\IMapper $mapper
*/
public
function
__construct
(
\LeanMapper\IMapper
$mapper
)
public
function
__construct
(
\LeanMapper\IMapper
$mapper
)
{
{
$this
->
mapper
=
$mapper
;
$this
->
mapper
=
$mapper
;
...
@@ -35,10 +48,14 @@ abstract class AbstractRestriction
...
@@ -35,10 +48,14 @@ abstract class AbstractRestriction
$this
->
initDefaults
();
$this
->
initDefaults
();
}
}
protected
function
initDefaults
()
protected
function
initDefaults
()
{
{
}
}
/**
/**
* @param string $property
* @param string $property
*
*
...
@@ -54,6 +71,8 @@ abstract class AbstractRestriction
...
@@ -54,6 +71,8 @@ abstract class AbstractRestriction
);
);
}
}
/**
/**
* @param string $key
* @param string $key
*
*
...
@@ -64,6 +83,8 @@ abstract class AbstractRestriction
...
@@ -64,6 +83,8 @@ abstract class AbstractRestriction
return
array_key_exists
(
$key
,
$this
->
values
);
return
array_key_exists
(
$key
,
$this
->
values
);
}
}
/**
/**
* @param string $key
* @param string $key
*/
*/
...
@@ -73,6 +94,8 @@ abstract class AbstractRestriction
...
@@ -73,6 +94,8 @@ abstract class AbstractRestriction
unset
(
$this
->
values
[
$key
]);
unset
(
$this
->
values
[
$key
]);
}
}
/**
/**
* @param mixed $key
* @param mixed $key
*
*
...
@@ -117,6 +140,8 @@ abstract class AbstractRestriction
...
@@ -117,6 +140,8 @@ abstract class AbstractRestriction
$this
->
values
[
$key
]
=
$value
;
$this
->
values
[
$key
]
=
$value
;
}
}
/**
/**
* @param string $key
* @param string $key
*
*
...
@@ -132,6 +157,8 @@ abstract class AbstractRestriction
...
@@ -132,6 +157,8 @@ abstract class AbstractRestriction
return
$this
->
values
[
$key
];
return
$this
->
values
[
$key
];
}
}
/**
/**
* @return array
* @return array
*/
*/
...
@@ -140,6 +167,8 @@ abstract class AbstractRestriction
...
@@ -140,6 +167,8 @@ abstract class AbstractRestriction
return
$this
->
values
;
return
$this
->
values
;
}
}
/**
/**
* @param \DibiFluent $statement
* @param \DibiFluent $statement
* @param string|null $flag
* @param string|null $flag
...
...
src/LeanMapperWorkflow/Entity.php
View file @
839042b0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
abstract
class
Entity
extends
\LeanMapper\Entity
abstract
class
Entity
extends
\LeanMapper\Entity
{
{
}
}
src/LeanMapperWorkflow/EntityFactory.php
View file @
839042b0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
class
EntityFactory
implements
\LeanMapper\IEntityFactory
class
EntityFactory
implements
\LeanMapper\IEntityFactory
{
{
...
@@ -13,6 +14,8 @@ class EntityFactory implements \LeanMapper\IEntityFactory
...
@@ -13,6 +14,8 @@ class EntityFactory implements \LeanMapper\IEntityFactory
return
new
$entityClass
(
$arg
);
return
new
$entityClass
(
$arg
);
}
}
/*
/*
* @inheritdoc
* @inheritdoc
*/
*/
...
...
src/LeanMapperWorkflow/Mapper.php
View file @
839042b0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
/**
/**
* Class Mapper
* Class Mapper
*/
*/
...
...
src/LeanMapperWorkflow/Repository.php
View file @
839042b0
...
@@ -5,6 +5,7 @@ namespace LeanMapperWorkflow;
...
@@ -5,6 +5,7 @@ namespace LeanMapperWorkflow;
use
InvalidArgumentException
;
use
InvalidArgumentException
;
use
LogicException
;
use
LogicException
;
/**
/**
* Class Repository
* Class Repository
*/
*/
...
@@ -40,6 +41,8 @@ class Repository extends AbstractRepository
...
@@ -40,6 +41,8 @@ class Repository extends AbstractRepository
return
$this
->
createEntity
(
$row
);
return
$this
->
createEntity
(
$row
);
}
}
/**
/**
* @param Restriction|int[]|null $param
* @param Restriction|int[]|null $param
*
*
...
@@ -70,6 +73,8 @@ class Repository extends AbstractRepository
...
@@ -70,6 +73,8 @@ class Repository extends AbstractRepository
return
$this
->
createEntities
(
$statement
->
fetchAll
());
return
$this
->
createEntities
(
$statement
->
fetchAll
());
}
}
/**
/**
* @param Restriction|null $param
* @param Restriction|null $param
*
*
...
@@ -95,6 +100,8 @@ class Repository extends AbstractRepository
...
@@ -95,6 +100,8 @@ class Repository extends AbstractRepository
return
(
int
)
$statement
->
fetchSingle
();
return
(
int
)
$statement
->
fetchSingle
();
}
}
/**
/**
* @param string $key
* @param string $key
* @param string $value
* @param string $value
...
@@ -120,6 +127,8 @@ class Repository extends AbstractRepository
...
@@ -120,6 +127,8 @@ class Repository extends AbstractRepository
return
$statement
->
fetchPairs
(
$key
,
$value
);
return
$statement
->
fetchPairs
(
$key
,
$value
);
}
}
/**
/**
* @return Restriction
* @return Restriction
*/
*/
...
...
src/LeanMapperWorkflow/Restriction.php
View file @
839042b0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
/**
/**
* @property array|int $id
* @property array|int $id
* @property int $limit
* @property int $limit
...
@@ -10,8 +11,11 @@ namespace LeanMapperWorkflow;
...
@@ -10,8 +11,11 @@ namespace LeanMapperWorkflow;
class
Restriction
extends
AbstractRestriction
class
Restriction
extends
AbstractRestriction
{
{
/** @var array */
protected
$joins
=
[];
protected
$joins
=
[];
/**
/**
* @param \DibiFluent $statement
* @param \DibiFluent $statement
* @param Repository $repository
* @param Repository $repository
...
@@ -38,6 +42,8 @@ class Restriction extends AbstractRestriction
...
@@ -38,6 +42,8 @@ class Restriction extends AbstractRestriction
$statement
->
offset
(
$this
->
offset
);
$statement
->
offset
(
$this
->
offset
);
}
}
/**
/**
* @param Repository $repository
* @param Repository $repository
* @return string
* @return string
...
@@ -54,6 +60,8 @@ class Restriction extends AbstractRestriction
...
@@ -54,6 +60,8 @@ class Restriction extends AbstractRestriction
}
}
}
}
/**
/**
* @param string $name
* @param string $name
* @param callback $callback callback($statement)
* @param callback $callback callback($statement)
...
@@ -71,6 +79,8 @@ class Restriction extends AbstractRestriction
...
@@ -71,6 +79,8 @@ class Restriction extends AbstractRestriction
}
}
}
}
/**
/**
* [applyJoins description]
* [applyJoins description]
* @param [type] $statement [description]
* @param [type] $statement [description]
...
...
src/LeanMapperWorkflow/RestrictionWithOrdering.php
View file @
839042b0
...
@@ -2,14 +2,19 @@
...
@@ -2,14 +2,19 @@
namespace
LeanMapperWorkflow
;
namespace
LeanMapperWorkflow
;
class
RestrictionWithOrdering
extends
Restriction
class
RestrictionWithOrdering
extends
Restriction
{
{
const
ORDER_ID
=
'id'
;
const
ORDER_ID
=
'id'
;
/** @var array(self::ORDER_* => "ASC"|"DESC"|mixed) */
/** @var array(self::ORDER_* => "ASC"|"DESC"|mixed) */
protected
$orderBys
=
[];
protected
$orderBys
=
[];
/**
/**
* @param \DibiFluent $statement
* @param \DibiFluent $statement
* @param Repository $repository
* @param Repository $repository
...
@@ -26,6 +31,8 @@ class RestrictionWithOrdering extends Restriction
...
@@ -26,6 +31,8 @@ class RestrictionWithOrdering extends Restriction
}
}
}
}
/**
/**
* @param array $orderBys
* @param array $orderBys
*/
*/
...
@@ -34,6 +41,8 @@ class RestrictionWithOrdering extends Restriction
...
@@ -34,6 +41,8 @@ class RestrictionWithOrdering extends Restriction
$this
->
orderBys
=
$orderBys
;
$this
->
orderBys
=
$orderBys
;
}
}
/**
/**
* @param string $order self::ORDER_*
* @param string $order self::ORDER_*
* @param string $direction "ASC"|"DESC"|mixed
* @param string $direction "ASC"|"DESC"|mixed
...
@@ -43,6 +52,8 @@ class RestrictionWithOrdering extends Restriction
...
@@ -43,6 +52,8 @@ class RestrictionWithOrdering extends Restriction
$this
->
orderBys
[
$order
]
=
$direction
;
$this
->
orderBys
[
$order
]
=
$direction
;
}
}
/**
/**
* @param string $order self::ORDER_*
* @param string $order self::ORDER_*
* @param string $direction "ASC"|"DESC"|mixed
* @param string $direction "ASC"|"DESC"|mixed
...
...
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