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 @@
namespace
LeanMapperWorkflow
;
abstract
class
AbstractRepository
extends
\LeanMapper\Repository
{
...
...
@@ -10,6 +11,8 @@ abstract class AbstractRepository extends \LeanMapper\Repository
*/
abstract
public
function
createRestriction
();
/**
* @param \DibiFluent $statement
* @param Restriction|null $restriction
...
...
src/LeanMapperWorkflow/AbstractRestriction.php
View file @
839042b0
...
...
@@ -2,15 +2,28 @@
namespace
LeanMapperWorkflow
;
abstract
class
AbstractRestriction
{
const
FLAG_COUNT
=
'count'
;
protected
$properties
=
array
();
private
$values
=
array
();
/** @var array */
protected
$properties
=
[];
/** @var array */
private
$values
=
[];
/** @var \LeanMapper\IMapper */
protected
$mapper
;
/**
* @param \LeanMapper\IMapper $mapper
*/
public
function
__construct
(
\LeanMapper\IMapper
$mapper
)
{
$this
->
mapper
=
$mapper
;
...
...
@@ -35,10 +48,14 @@ abstract class AbstractRestriction
$this
->
initDefaults
();
}
protected
function
initDefaults
()
{
}
/**
* @param string $property
*
...
...
@@ -54,6 +71,8 @@ abstract class AbstractRestriction
);
}
/**
* @param string $key
*
...
...
@@ -64,6 +83,8 @@ abstract class AbstractRestriction
return
array_key_exists
(
$key
,
$this
->
values
);
}
/**
* @param string $key
*/
...
...
@@ -73,6 +94,8 @@ abstract class AbstractRestriction
unset
(
$this
->
values
[
$key
]);
}
/**
* @param mixed $key
*
...
...
@@ -117,6 +140,8 @@ abstract class AbstractRestriction
$this
->
values
[
$key
]
=
$value
;
}
/**
* @param string $key
*
...
...
@@ -132,6 +157,8 @@ abstract class AbstractRestriction
return
$this
->
values
[
$key
];
}
/**
* @return array
*/
...
...
@@ -140,6 +167,8 @@ abstract class AbstractRestriction
return
$this
->
values
;
}
/**
* @param \DibiFluent $statement
* @param string|null $flag
...
...
src/LeanMapperWorkflow/Entity.php
View file @
839042b0
...
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
abstract
class
Entity
extends
\LeanMapper\Entity
{
}
src/LeanMapperWorkflow/EntityFactory.php
View file @
839042b0
...
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
class
EntityFactory
implements
\LeanMapper\IEntityFactory
{
...
...
@@ -13,6 +14,8 @@ class EntityFactory implements \LeanMapper\IEntityFactory
return
new
$entityClass
(
$arg
);
}
/*
* @inheritdoc
*/
...
...
src/LeanMapperWorkflow/Mapper.php
View file @
839042b0
...
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
/**
* Class Mapper
*/
...
...
src/LeanMapperWorkflow/Repository.php
View file @
839042b0
...
...
@@ -5,6 +5,7 @@ namespace LeanMapperWorkflow;
use
InvalidArgumentException
;
use
LogicException
;
/**
* Class Repository
*/
...
...
@@ -40,6 +41,8 @@ class Repository extends AbstractRepository
return
$this
->
createEntity
(
$row
);
}
/**
* @param Restriction|int[]|null $param
*
...
...
@@ -70,6 +73,8 @@ class Repository extends AbstractRepository
return
$this
->
createEntities
(
$statement
->
fetchAll
());
}
/**
* @param Restriction|null $param
*
...
...
@@ -95,6 +100,8 @@ class Repository extends AbstractRepository
return
(
int
)
$statement
->
fetchSingle
();
}
/**
* @param string $key
* @param string $value
...
...
@@ -120,6 +127,8 @@ class Repository extends AbstractRepository
return
$statement
->
fetchPairs
(
$key
,
$value
);
}
/**
* @return Restriction
*/
...
...
src/LeanMapperWorkflow/Restriction.php
View file @
839042b0
...
...
@@ -2,6 +2,7 @@
namespace
LeanMapperWorkflow
;
/**
* @property array|int $id
* @property int $limit
...
...
@@ -10,8 +11,11 @@ namespace LeanMapperWorkflow;
class
Restriction
extends
AbstractRestriction
{
/** @var array */
protected
$joins
=
[];
/**
* @param \DibiFluent $statement
* @param Repository $repository
...
...
@@ -38,6 +42,8 @@ class Restriction extends AbstractRestriction
$statement
->
offset
(
$this
->
offset
);
}
/**
* @param Repository $repository
* @return string
...
...
@@ -54,6 +60,8 @@ class Restriction extends AbstractRestriction
}
}
/**
* @param string $name
* @param callback $callback callback($statement)
...
...
@@ -71,6 +79,8 @@ class Restriction extends AbstractRestriction
}
}
/**
* [applyJoins description]
* @param [type] $statement [description]
...
...
src/LeanMapperWorkflow/RestrictionWithOrdering.php
View file @
839042b0
...
...
@@ -2,14 +2,19 @@
namespace
LeanMapperWorkflow
;
class
RestrictionWithOrdering
extends
Restriction
{
const
ORDER_ID
=
'id'
;
/** @var array(self::ORDER_* => "ASC"|"DESC"|mixed) */
protected
$orderBys
=
[];
/**
* @param \DibiFluent $statement
* @param Repository $repository
...
...
@@ -26,6 +31,8 @@ class RestrictionWithOrdering extends Restriction
}
}
/**
* @param array $orderBys
*/
...
...
@@ -34,6 +41,8 @@ class RestrictionWithOrdering extends Restriction
$this
->
orderBys
=
$orderBys
;
}
/**
* @param string $order self::ORDER_*
* @param string $direction "ASC"|"DESC"|mixed
...
...
@@ -43,6 +52,8 @@ class RestrictionWithOrdering extends Restriction
$this
->
orderBys
[
$order
]
=
$direction
;
}
/**
* @param string $order self::ORDER_*
* @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