CakePHP 3 - Easiest way to retrieve a single field from the database
<p>In CakePHP 2 I could do something like this:</p>

<pre><code>$name = $this-&gt;User-&gt;field('name', ['email' =&gt; 'user@example.com']);
</code></pre>

<p>In CakePHP 3 you have to do something like this to achieve the same thing:</p>

<pre><code>$users = TableRegistry::get('Users');

$query = $users-&gt;find()
    -&gt;select('name')
    -&gt;where(['email' =&gt; 'user@example.com']);

$name = $query-&gt;isEmpty() ? null : $query-&gt;first()-&gt;name;
</code></pre>

<p>Is there a simpler way to perform these kinds of operations? I'm not very familiar with the new ORM.</p>

<hr>

<p><strong>Edit:</strong> I have added an example of a class which adds this behavior for Cake 3:</p>

<p><a href="https://stackoverflow.com/a/42136955/851885">https://stackoverflow.com/a/42136955/851885</a></p>