REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1011 B
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Doctrine/EntityTraits/SafeToOneAssociationLoadTrait.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Doctrine\EntityTraits; if (!defined('ABSPATH')) exit; use MailPoetVendor\Doctrine\ORM\EntityNotFoundException; use MailPoetVendor\Doctrine\ORM\Proxy\Proxy; trait SafeToOneAssociationLoadTrait { private function safelyLoadToOneAssociation(string $propertyName, $emptyValue = null) { if (!property_exists($this, $propertyName)) { throw new \InvalidArgumentException("Property '$propertyName' does not exist on class '" . get_class($this) . "'"); } if (!$this->$propertyName instanceof Proxy) { return; } if ($this->$propertyName->__isInitialized()) { return; } // if a proxy exists (= we have related entity ID), try to load it // to see if it is a valid ID referencing an existing entity try { $this->$propertyName->__load(); } catch (EntityNotFoundException $e) { $this->$propertyName = $emptyValue; } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AutoincrementedIdTrait.php
543 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CreatedAtTrait.php
590 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DeletedAtTrait.php
636 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SafeToOneAssociationLoadTrait.php
1011 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UpdatedAtTrait.php
579 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).