src/ORM/DataObjectSchema.php
public function compositeFields($class, $aggregated = true)
    {
        $class = ClassInfo::class_name($class);
        if ($class === DataObject::class) {
            return [];
        }
        $this->cacheDatabaseFields($class);

        // Get fields for this class
        $compositeFields = $this->compositeFields[$class];
        if (!$aggregated) {
            return $compositeFields;
        }

        // Recursively merge
        $parentFields = $this->compositeFields(get_parent_class($class));
        return array_merge($compositeFields, array_diff_key($parentFields, $compositeFields));
    }
public function compositeFields($class, $aggregated = true)
    {
        $class = ClassInfo::class_name($class);
        if ($class === DataObject::class) {
            return [];
        }
        $this->cacheDatabaseFields($class);

        // Get fields for this class
        $compositeFields = $this->compositeFields[$class];
        if (!$aggregated) {
            return $compositeFields;
        }

        // Recursively merge
        $parentFields = $this->compositeFields(get_parent_class($class));
        return array_merge($compositeFields, array_diff_key($parentFields, $compositeFields));
    }
public function compositeFields ( $ class , $ aggregated = true ) { $ class = ClassInfo :: class_name ( $ class ) ; if ( $ class === DataObject :: class ) { return [ ] ; } $ this -> cacheDatabaseFields ( $ class ) ; // Get fields for this class $ compositeFields = $ this -> compositeFields [ $ class ] ; if ( ! $ aggregated ) { return $ compositeFields ; } // Recursively merge $ parentFields = $ this -> compositeFields ( get_parent_class ( $ class ) ) ; return array_merge ( $ compositeFields , array_diff_key ( $ parentFields , $ compositeFields ) ) ; }
Returns a list of all the composite if the given db field on the class is a composite field.
Will check all applicable ancestor classes and aggregate results.

Can be called directly on an object. E.g. Member::composite_fields(), or Member::composite_fields(null, true)
to aggregate.

Includes composite has_one (Polymorphic) fields

@param string $class Name of class to check
@param bool $aggregated Include fields in entire hierarchy, rather than just on this table

@return array List of composite fields and their class spec
Returns a list of all the composite if the given db field on the class is a composite field . Will check all applicable ancestor classes and aggregate results .