Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117755945
PlanObserver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
635 B
Referenced Files
None
Subscribers
None
PlanObserver.php
View Options
<?php
namespace
App\Observers
;
use
App\Plan
;
/**
* This is an observer for the Plan model definition.
*/
class
PlanObserver
{
/**
* Handle the "creating" event on an Plan.
*
* Ensures that the entry uses a custom ID (uuid).
*
* @param Plan $plan The Plan being created.
*
* @return void
*/
public
function
creating
(
Plan
$plan
)
{
while
(
true
)
{
$allegedly_unique
=
\App\Utils
::
uuidStr
();
if
(!
Plan
::
find
(
$allegedly_unique
))
{
$plan
->{
$plan
->
getKeyName
()}
=
$allegedly_unique
;
break
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Apr 4, 8:24 AM (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6f/42/6039af67029be82ef64e40c5794e
Default Alt Text
PlanObserver.php (635 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline