Model/ExtendedFieldModel.php
public function getEntities(array $args = [])
    {
        // @todo - use permission base to exclude secure if necessary.
        $replacementFilter = [
            'column' => 'f.object',
            'expr'   => 'neq',
            'value'  => ['company'],
        ];
        foreach ($args as $type => &$arg) {
            if ('filter' === $type) {
                foreach ($arg as $key => &$filter) {
                    if ('force' === $key) {
                        foreach ($filter as $forceKey => &$forceFilter) {
                            if (
                                !empty($forceFilter['column'])
                                && 'f.object' == $forceFilter['column']
                                && !empty($forceFilter['expr'])
                                && 'eq' == $forceFilter['expr']
                                && !empty($forceFilter['value'])
                                && 'lead' == $forceFilter['value']
                            ) {
                                $forceFilter = $replacementFilter;
                            }
                        }
                    } elseif ('object' === $key && 'lead' === $filter) {
                        // Move the filter to force mode in order to replace.
                        if (!isset($arg['force'])) {
                            $arg['force'] = [];
                        }
                        $arg['force'][] = $replacementFilter;
                        unset($arg[$key]);
                    }
                }
            }
        }

        return parent::getEntities($args);
    }
public function getEntities(array $args = [])
    {
        // @todo - use permission base to exclude secure if necessary.
        $replacementFilter = [
            'column' => 'f.object',
            'expr'   => 'neq',
            'value'  => ['company'],
        ];
        foreach ($args as $type => &$arg) {
            if ('filter' === $type) {
                foreach ($arg as $key => &$filter) {
                    if ('force' === $key) {
                        foreach ($filter as $forceKey => &$forceFilter) {
                            if (
                                !empty($forceFilter['column'])
                                && 'f.object' == $forceFilter['column']
                                && !empty($forceFilter['expr'])
                                && 'eq' == $forceFilter['expr']
                                && !empty($forceFilter['value'])
                                && 'lead' == $forceFilter['value']
                            ) {
                                $forceFilter = $replacementFilter;
                            }
                        }
                    } elseif ('object' === $key && 'lead' === $filter) {
                        // Move the filter to force mode in order to replace.
                        if (!isset($arg['force'])) {
                            $arg['force'] = [];
                        }
                        $arg['force'][] = $replacementFilter;
                        unset($arg[$key]);
                    }
                }
            }
        }

        return parent::getEntities($args);
    }
public function getEntities ( array $ args = [ ] ) { // @todo - use permission base to exclude secure if necessary. $ replacementFilter = [ 'column' => 'f.object' , 'expr' => 'neq' , 'value' => [ 'company' ] , ] ; foreach ( $ args as $ type => & $ arg ) { if ( 'filter' === $ type ) { foreach ( $ arg as $ key => & $ filter ) { if ( 'force' === $ key ) { foreach ( $ filter as $ forceKey => & $ forceFilter ) { if ( ! empty ( $ forceFilter [ 'column' ] ) && 'f.object' == $ forceFilter [ 'column' ] && ! empty ( $ forceFilter [ 'expr' ] ) && 'eq' == $ forceFilter [ 'expr' ] && ! empty ( $ forceFilter [ 'value' ] ) && 'lead' == $ forceFilter [ 'value' ] ) { $ forceFilter = $ replacementFilter ; } } } elseif ( 'object' === $ key && 'lead' === $ filter ) { // Move the filter to force mode in order to replace. if ( ! isset ( $ arg [ 'force' ] ) ) { $ arg [ 'force' ] = [ ] ; } $ arg [ 'force' ] [ ] = $ replacementFilter ; unset ( $ arg [ $ key ] ) ; } } } } return parent :: getEntities ( $ args ) ; }
Returns lead custom fields.

Alterations to core:
Include extended objects when various methods attempt to get fields of object 'lead'.

@param $args

@return array
Returns lead custom fields .