Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120825648
ObjectReadCommand.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
ObjectReadCommand.php
View Options
<?php
namespace
App\Console
;
/**
* This abstract class provides a means to treat objects in our model using CRUD.
*/
abstract
class
ObjectReadCommand
extends
ObjectCommand
{
public
function
__construct
()
{
$this
->
description
=
"Read a {$this->objectName}"
;
$this
->
signature
=
sprintf
(
"%s%s:read {%s}"
,
$this
->
commandPrefix
?
$this
->
commandPrefix
.
":"
:
""
,
$this
->
objectName
,
$this
->
objectName
);
$this
->
signature
.=
" {--attr=* : Attributes other than the primary unique key to include}"
;
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$argument
=
$this
->
argument
(
$this
->
objectName
);
$object
=
$this
->
getObject
(
$this
->
objectClass
,
$argument
,
$this
->
objectTitle
);
if
(!
$object
)
{
$this
->
error
(
"No such {$this->objectName} {$argument}"
);
return
1
;
}
$this
->
info
(
$this
->
toString
(
$object
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 10:41 AM (3 d, 27 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18816531
Default Alt Text
ObjectReadCommand.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline