Returns parent class name that extends TableQuery Object if is set this class must extends ModelCriteria for be compatible
@return string
542890
public function getParentClass()
    {
        $parentClass = $this->getBehaviorContent('parentClass');
        return null === $parentClass ? ($this->getTable()->getBaseQueryClass() != "" ? $this->getTable()->getBaseQueryClass() : 'ModelCriteria') : $parentClass;
    }
143979
public function getExtendsClassDefinition()
    {
        if (!$this->extendsClassDefinition && $this->extendsClass) {
            if ($this->compiler) {
                $this->setExtendsClassDefinition($this->compiler->getClassDefinition($this->extendsClass));
            }
        }

        return $this->extendsClassDefinition;
    }
398393
public function getInheritedElement()
    {
        /** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */
        $associatedClass = $this->getParent();

        if (($associatedClass instanceof ClassDescriptor || $associatedClass instanceof InterfaceDescriptor)
            && ($associatedClass->getParent() instanceof ClassDescriptor
                || $associatedClass->getParent() instanceof InterfaceDescriptor
            )
        ) {
            /** @var ClassDescriptor|InterfaceDescriptor $parentClass */
            $parentClass = $associatedClass->getParent();

            return $parentClass->getProperties()->get($this->getName());
        }

        return null;
    }
1041338
protected function getParentsHierarchyField() {
		// see if we've got Parent values
        $parents = array();

        $parent = $this->owner;
        while ($parent && $parent->ParentID) {
            $parents[] = (int) $parent->ParentID;
            $parent = $parent->Parent();
            // fix for odd behaviour - in some instance a node is being assigned as its own parent. 
            if ($parent->ParentID == $parent->ID) {
                $parent = null;
            }
        }
        return $parents;
	}
654188
public function getTableName()
    {
        if (is_null($this->_tableName)) {
            $parts = explode('\\', $this->getClassName());
            $name = end($parts);
            $this->_tableName = Text::plural(strtolower($name));
        }
        return $this->_tableName;
    }
746076
public function getBaseClass()
    {
        // Use explicit base class
        if ($this->baseClass) {
            return $this->baseClass;
        }
        // Default to the basename of the record
        $schema = DataObject::getSchema();
        if ($this->record) {
            return $schema->baseDataClass($this->record);
        }
        // During dev/build only the table is assigned
        $tableClass = $schema->tableClass($this->getTable());
        if ($tableClass && ($baseClass = $schema->baseDataClass($tableClass))) {
            return $baseClass;
        }
        // Fallback to global default
        return DataObject::class;
    }
947586
private static function table()
    {
        if (!isset(self::$tableMap[static::class])) {
            if (isset(static::$table)) {
                self::$tableMap[static::class] = static::$table;
            } else {
                self::$tableMap[static::class] = strtolower((new \ReflectionClass(static::class))->getShortName());
            }
        }
        return self::$tableMap[static::class];
    }
958094
public function getParentClass()
    {
        return ($reflection = parent::getParentClass()) ? new self($reflection->getName(), $this->mapper, $this->entityReflectionProvider) : null;
    }
1278638
final public function parent()
    {
        $parent = NULL;

        if(!!isset($this->dom_element->parentNode))
        {
            if($this->dom_element->parentNode->nodeType == 1)
            {
                $parent = new PHPHtmlDomElement($this->dom_element->parentNode);
            }
            else
            {
                $parent = $this->dom_element->parentNode;
            }
        }
        return $parent;
    }
987149
public function getParent()
    {
        return $this->owner
            ->hasOne($this->ownerClassName, [ $this->primaryKey => $this->parentIdField ])
            ->one();
    }
69487
protected function applyListParentToQuery($query)
    {
        if ( ! $this->listParentRelation) {

            if ($this->showsTopParentsOnly()) {
                $query->has($this->getModelInformation()->list->default_top_relation, '<', 1);
            }

            return $this;
        }

        // Use list parent information collected to get the model
        /** @var ListParentData $parentInfo */
        $parentInfo = array_last($this->listParents);

        if ( ! $parentInfo) {
            return $this;
        }

        // For morph relation, we need a special query
        $relationInstance = $query->getModel()->{$this->listParentRelation}();
        if ($relationInstance instanceof MorphTo) {

            $separator = $this->getListParentMorphKeySeparator();

            // If parent record indicator $key does not contain class/key separator symbol, ignore
            if (false === strpos($this->listParentRecordKey, $separator)) {
                return $this;
            }

            list($parentType, $parentKey) = explode($separator, $this->listParentRecordKey, 2);

            $parentType = $this->getRelationMappedMorphType($parentType);

            $query
                ->withoutGlobalScopes()
                ->where($query->getModel()->getTable() . '.' . $relationInstance->getMorphType(), $parentType)
                ->where($relationInstance->getQualifiedForeignKey(), $parentKey);

            return $this;
        }

        $query->whereHas($this->listParentRelation, function ($query) use ($parentInfo) {
            /** @var Builder $query */
            $query
                ->withoutGlobalScopes()
                ->where($parentInfo->model->getKeyName(), $this->listParentRecordKey);
        });

        return $this;
    }
637240
public function scopeOrderModel($query)
    {
        $parentFields = $this->getParentFieldName();
        if ($parentFields) {
            $parentFields = (array) $parentFields;
            foreach ($parentFields as $parentFieldName) {
                $query->where($parentFieldName, $this->{$parentFieldName});
            }
        }

        return $query->orderBy($this->getOrderField(), 'ASC');
    }
1302746
private function getChildOidsDeclaration()
    {

        $children = $this->entity->pgClass->getChildren();

        if( $children->count() === 0 ) {
            return;
        }

        $output = array();
        foreach( $children as $child ) {
            $output[$child->oid] = $child->getEntityName();
        }

        $ids = implode( ', ', array_keys( $output ) );
        $names = implode( ', ', $output );

        $this->class->classComponents[] = new VariableDeclaration(
            'childOids',
            new SFormatf( <<<'PHP'
                /**
                 * ChildOids. The oids of any relations which inherit from this table
                 * @var array
                 */
                protected $childOids = [%s]; // %s
PHP
                , $ids
                , $names
            )
        );

    }
339876
public function parent()
    {
        if (!$this->has('slug')) {
            throw new FatalErrorException(__d('content', "Missing property 'slug', make sure to include it using Query::select()."));
        }

        return TableRegistry::get('Content.Contents')
            ->find()
            ->select(['id', 'slug', 'content_type_slug', 'language'])
            ->where([
                'id' => $this->translation_for,
                'status' => 1,
            ])
            ->first();
    }
757173
private function getControllerClassName() : string
    {
        $tableName = App::shortName(get_class($this->table), 'Model/Table', 'Table');

        return (string)App::className($tableName . 'Controller', 'Controller');
    }
1199779
protected function getClassExtends()
    {
        $parentPlaceholderClass = sprintf(
            "\\%s\\%s",
            $this->options['entityPlaceholder'],
            $this->pgClass->getParent()->getEntityName()
        );
        $this->class->addExtends($parentPlaceholderClass);
    }
163625
public function getChildren()
    {
        return $this->owner
            ->hasMany($this->ownerClassName, [ $this->parentIdField => $this->primaryKey ])
            ->orderBy([
                "$this->tableName.$this->sortField" => SORT_ASC,
                "$this->tableName.$this->primaryKey" => SORT_ASC,
            ]);
    }