Determine the number of unique non-null classes in a Zone. In a valid zone this MUST be 1.

@param Zone $zone

@return int
550692
private static function countClasses(Zone $zone): int
    {
        $classes = [];

        foreach ($zone as $rr) {
            if (null !== $rr->getClass()) {
                $classes[$rr->getClass()] = null;
            }
        }

        return count($classes);
    }
993520
protected function getOffsetFromUtc(string $zone)
    {
        $zone   = str_replace(['GMT','UTC'], '', $zone);
        $zone   = str_replace(':', '', $zone);

        $add    = $zone[0] == '+';
        $zone   = substr($zone, 1);

        switch (strlen($zone)) {
            case 1:
            case 2:
                return $zone * 3600 * ($add?1:-1);
            case 3:
                $hour   = substr($zone, 0, 1) * 3600;
                $minute = substr($zone, 1) * 60;
                return ($hour+$minute) * ($add?1:-1);
            case 4:
                $hour   = substr($zone, 0, 2) * 3600;
                $minute = substr($zone, 2) * 60;
                return ($hour+$minute) * ($add?1:-1);
        }

        return 0;
    }
582393
public function count(QueryBuilderInterface $Builder) {
        $this->parsedQuery = $this->getSerialyser()->setCriteriaList($Builder)->count(true)->serialyse();
        $statement = $this->connector->query($this->parsedQuery);
        $result    = $this->statementToArray($statement);
        return (int)reset($result)->cpt;
    }
73343
public function sortZones()
    {
        $ini = eZINI::instance('zone.ini');
        $zones = $ini->variable( $this->attribute('zone_layout'), 'Zones' );

        $sortedZones = array();
        foreach( $zones as $zone )
        {
            foreach( $this->attribute('zones') as $zoneObj )
            {
                if( !( $zoneObj instanceof eZPageZone ) )
                    continue;

                if ( $zone == $zoneObj->attribute('zone_identifier') )
                    $sortedZones[] = $zoneObj;
            }
        }

        $this->setAttribute( 'zones', $sortedZones );
    }
347985
protected function calculateOffset(string $zone)
    {
        if ($this->resolveStatic(TimezoneValidation::class, 'isLocation', $zone)) {
            return $this->getOffsetFromLocation($zone);
        }

        if ($this->resolveStatic(TimezoneValidation::class, 'isUtc', $zone)) {
            return $this->getOffsetFromUtc($zone);
        }

        if ($this->resolveStatic(TimezoneValidation::class, 'isAbbr', $zone)) {
            return $this->getOffsetFromAbbr($zone);
        }

        return 0;
    }
1255644
@Pure
	public final N getChildAt(OctTreeZone zone) {
		if (zone != null) {
			return getChildAt(zone.ordinal());
		}
		return null;
	}
481214
public function count($mode = COUNT_NORMAL)
    {
        if($mode == COUNT_RECURSIVE)
        {
            $count = 0;
            $data  = $this->__options;
            foreach ($data as $key => $value)
            {
                if(is_array($value) || $value instanceof KObjectConfig)
                {
                    if ($value instanceof KObjectConfigInterface) {
                        $count += $value->count($mode);
                    } else {
                        $count += count($value);
                    }
                }
            }
        }
        else $count = count($this->__options);

        return $count;
    }
994
private function getZoneOptions(\stdClass $zone)
    {
        $options = array(
            'parameters' => array(
                'class' => array(
                    'type' => 'scalar',
                    'options' => array('default' => 'row'),
                ),
            ),
        );

        if (true === property_exists($zone, 'accept')
                && true === is_array($zone->accept)
                && 0 < count($zone->accept)
                && $zone->accept[0] != '') {
            $options['accept'] = $zone->accept;

            $func = function (&$item, $key) {
                        $item = ('' == $item) ? null : 'BackBee\ClassContent\\'.$item;
                    };

            array_walk($options['accept'], $func);
        }

        if (true === property_exists($zone, 'maxentry') && 0 < $zone->maxentry) {
            $options['maxentry'] = $zone->maxentry;
        }

        return $options;
    }
1345746
public function getRecords($zone, $force = false)
    {
        if (!isset($this->zones[$zone])) {
            throw new \Exception("Unknown zone {$zone} requested, did you call getZones() first?");
        }
        if (!isset($this->zonerecords[$zone]) || $force) {
            $this->zonerecords[$zone] = $this->fetchRecords($zone);
        }

        return $this->zonerecords[$zone];
    }
881594
public function getZone(string $zoneIdentifier): APIZone
    {
        if ($this->hasZone($zoneIdentifier)) {
            return $this->zones->get($zoneIdentifier);
        }

        throw LayoutException::noZone($zoneIdentifier);
    }
943551
private function visitLinkedZone(Zone $zone): ?array
    {
        $linkedZone = $zone->getLinkedZone();

        if (!$linkedZone instanceof Zone) {
            return null;
        }

        return [
            'identifier' => $linkedZone->getIdentifier(),
            'layout_id' => $linkedZone->getLayoutId(),
        ];
    }
142935
private function getAllowedBlocks(Zone $zone, LayoutTypeInterface $layoutType)
    {
        if ($layoutType->hasZone($zone->getIdentifier())) {
            $layoutTypeZone = $layoutType->getZone($zone->getIdentifier());
            $allowedBlockDefinitions = $layoutTypeZone->getAllowedBlockDefinitions();

            if (count($allowedBlockDefinitions) > 0) {
                return $allowedBlockDefinitions;
            }
        }

        return true;
    }
822332
public function sortByZoneType()
    {
        return $this->sort(function (Zone $zone1, Zone $zone2) {
            $zone1Order = $zone1->getZoneType()->getOrder();
            $zone2Order = $zone2->getZoneType()->getOrder();

            // implement alpha sort on name if equal ?

            return $zone1Order >= $zone2Order ? 1 : -1;
        });
    }
1013596
public static function getZone($zoneName=null)
    {
        if ($zoneName === null) {
            $zoneName = self::$_outputZone;
        }
        return (isset(self::$_zones[$zoneName]) ? self::$_zones[$zoneName] : null);
    }
1302466
public function delZoneRecord($zone, $recordid)
    {
        if (!$recordid) {
            throw new \Exception('missing record id');
        }
        // Make sure we know what zone to target
        if (!isset($this->zones[$zone])) {
            throw new \Exception("unknown zone {$zone} did you call getZones()?");
        }
        $zoneid = $this->zones[$zone]['id'];
        if (!$zoneid) {
            throw new \Exception("could not determine zone id for {$zone}");
        }
        $uri = $this->baseuri.'/zones/'.$zoneid.'/dns_records/'.$recordid;
        $result = $this->httpDelete($uri);

        return $result;
    }
923979
protected function calculateOffset($zone)
    {
        if ($this->validation()->isLocation($zone)) {
            return $this->getOffsetFromLocation($zone);
        }

        if ($this->validation()->isUtc($zone)) {
            return $this->getOffsetFromUtc($zone);
        }

        if ($this->validation()->isAbbr($zone)) {
            return $this->getOffsetFromAbbr($zone);
        }

        return 0;
    }
1329129
protected function getPriorityBefore(string $fixerClass): int
    {
        if (! is_a($fixerClass, FixerInterface::class, true)) {
            return 0;
        }

        /** @var FixerInterface $fixer */
        $fixer = (new ReflectionClass($fixerClass))->newInstanceWithoutConstructor();

        return $fixer->getPriority() + 5;
    }