Isswp101\Persimmon\Relationship\HasManyRelationship::find PHP 메소드

find() 공개 메소드

Find model by id.
public find ( mixed $id ) : ElasticsearchModel | null
$id mixed
리턴 Isswp101\Persimmon\ElasticsearchModel | null
    public function find($id)
    {
        $child = $this->childClassName;
        $model = $child::findWithParentId($id, $this->parent->getId());
        if ($model) {
            $model->setParent($this->parent);
        }
        return $model;
    }