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
ec308894
Commit
ec308894
authored
Jun 04, 2014
by
Tomas Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove other usages of Nette
parent
85867541
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
Entity.php
src/LeanMapperWorkflow/Entity.php
+1
-2
Repository.php
src/LeanMapperWorkflow/Repository.php
+1
-1
FindEntity.php
src/LeanMapperWorkflow/Traits/FindEntity.php
+4
-2
No files found.
src/LeanMapperWorkflow/Entity.php
View file @
ec308894
...
...
@@ -6,7 +6,6 @@ use LeanMapper\Relationship\HasMany;
use
LeanMapper\Filtering
;
use
LeanMapper\Fluent
;
use
InvalidArgumentException
;
use
Nette\Utils\Strings
;
abstract
class
Entity
extends
\LeanMapper\Entity
...
...
@@ -25,7 +24,7 @@ abstract class Entity extends \LeanMapper\Entity
throw
new
InvalidArgumentException
(
"Method '
$name
' in entity "
.
get_called_class
()
.
" expects at least one argument with target column name."
);
}
return
$this
->
__call
(
$name
.
Strings
::
firstUpper
(
array_shift
(
$arguments
)),
$arguments
);
return
$this
->
__call
(
$name
.
ucfirst
(
array_shift
(
$arguments
)),
$arguments
);
}
elseif
(
substr
(
$name
,
0
,
10
)
===
'getCountOf'
)
{
$property
=
$this
->
getCurrentReflection
()
->
getEntityProperty
(
lcfirst
(
substr
(
$name
,
10
)));
...
...
src/LeanMapperWorkflow/Repository.php
View file @
ec308894
...
...
@@ -37,7 +37,7 @@ class Repository extends AbstractRepository
$row
=
$statement
->
fetch
();
if
(
$row
===
FALSE
)
{
if
(
is_callable
(
$notFoundCallback
))
{
\Nette\Utils\Callback
::
invokeArgs
(
$notFoundCallback
,
[
$id
]
);
$notFoundCallback
(
$id
);
}
else
{
throw
new
InvalidArgumentException
(
'Not found: '
.
var_export
(
$id
,
TRUE
));
}
...
...
src/LeanMapperWorkflow/Traits/FindEntity.php
View file @
ec308894
...
...
@@ -3,9 +3,11 @@
namespace
LeanMapperWorkflow\Traits
;
use
LeanMapperWorkflow\Repository
;
use
Nette\Application\IPresenter
;
/**
* Trait is prepared for using in Nette presenters only
*/
trait
FindEntity
{
...
...
@@ -19,7 +21,7 @@ trait FindEntity
*/
protected
final
function
findEntity
(
Repository
$repository
,
$id
,
$showMessage
=
FALSE
,
$redirectLink
=
NULL
)
{
if
(
$
this
instanceof
IPresenter
&&
(
$showMessage
!==
FALSE
||
$redirectLink
!==
NULL
)
)
{
if
(
$
showMessage
!==
FALSE
||
$redirectLink
!==
NULL
)
{
$notFoundCallback
=
function
()
use
(
$showMessage
,
$redirectLink
)
{
if
(
$showMessage
)
{
$this
->
flashMessage
(
'@todo'
,
'error'
);
...
...
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