public function beforeFind(Event $event, Query $query, ArrayObject $options, $primary)
    {
        $status = array_key_exists('fieldable', $options) ? $options['fieldable'] : $this->config('status');
        if (!$status) {
            return;
        }

        if (array_key_exists('eav', $options)) {
            unset($options['eav']);
        }

        return parent::beforeFind($event, $query, $options, $primary);
    }
public function beforeFind(Event $event, Query $query, ArrayObject $options, $primary)
    {
        $status = array_key_exists('fieldable', $options) ? $options['fieldable'] : $this->config('status');
        if (!$status) {
            return;
        }

        if (array_key_exists('eav', $options)) {
            unset($options['eav']);
        }

        return parent::beforeFind($event, $query, $options, $primary);
    }
public function beforeFind ( Event $ event , Query $ query , ArrayObject $ options , $ primary ) { $ status = array_key_exists ( 'fieldable' , $ options ) ? $ options [ 'fieldable' ] : $ this -> config ( 'status' ) ; if ( ! $ status ) { return ; } if ( array_key_exists ( 'eav' , $ options ) ) { unset ( $ options [ 'eav' ] ) ; } return parent :: beforeFind ( $ event , $ query , $ options , $ primary ) ; }
Modifies the query object in order to merge custom fields records into each
entity under the `_fields` property.

You can enable or disable this behavior for a single `find()` or `get()`
operation by setting `fieldable` or `eav` to false in the options array for
find method. e.g.:

```php
$contents = $this->Contents->find('all', ['fieldable' => false]);
$content = $this->Contents->get($id, ['fieldable' => false]);
```

It also looks for custom fields in WHERE clause. This will search entities in
all bundles this table may have, if you need to restrict the search to an
specific bundle you must use the `bundle` key in find()'s options:

```php
$this->Contents
->find('all', ['bundle' => 'articles'])
->where(['article-title' => 'My first article!']);
```

The `bundle` option has no effects if no custom fields are given in the
WHERE clause.

@param \Cake\Event\Event $event The beforeFind event that was triggered
@param \Cake\ORM\Query $query The original query to modify
@param \ArrayObject $options Additional options given as an array
@param bool $primary Whether this find is a primary query or not
@return void
Modifies the query object in order to merge custom fields records into each entity under the _fields property .