<p>Found out that entry can be accessed with <code>$this-&gt;element-&gt;owner</code></p>

CC BY-SA 3.0
2017-01-29T13:25:41.860Z
2017-01-29T13:25:41.860Z
Yuri Salimovskiy
<p>I have a custom fieldtype (used within Neo block) and I need to know the ID/content of entry it belongs to, when editing the entry.</p>

<p>I need to both populate field values based on value in other field (if present) and also perform validation on save by comparing with other fields in same entry.</p>

<p>So I need to know the entry content (or at least entry ID so I could fetch those) within <code>getInputHtml</code> and <code>validate</code> functions.</p>

<p>I know I could use <code>$this-&gt;model</code> and <code>$this-&gt;element</code> but those don't seem to provide any data related to entry</p>

<plugin-development><custom-fieldtype>
Get owner entry from fieldtype
# Get owner entry from fieldtype

(Asked by: username_0 on 2017-01-24)

I have a custom fieldtype (used within Neo block) and I need to know the ID/content of entry it belongs to, when editing the entry.

I need to both populate field values based on value in other field (if present) and also perform validation on save by comparing with other fields in same entry.

So I need to know the entry content (or at least entry ID so I could fetch those) within `getInputHtml` and `validate` functions.

I know I could use `$this->model` and `$this->element` but those don't seem to provide any data related to entry

**Tags:** plugin-development, custom-fieldtype


---

## 1 answers

### Answer by username_0 on 2017-01-29. Score: 0 | Accepted answer

Found out that entry can be accessed with `$this->element->owner`


---

