Find the zero id by identifier type.

@param Type $type The dbal identifier type

@return null|int|string
332152
private static function findZeroIdValue(Type $type)
    {
        if ($type instanceof GuidType) {
            $value = '00000000-0000-0000-0000-000000000000';
        } elseif (self::isNumberType($type)) {
            $value = 0;
        } elseif (self::isStringType($type)) {
            $value = '';
        } else {
            $value = null;
        }

        return $value;
    }
929515
public function type($type=null)
    {
        if (isset($type)) {
            $this->data['type'] = $type;
            return $this;
        }
        
        return isset($this->data['type']) ? $this->data['type'] : 'select';
    }
3540
public function find($fileId, $type = null)
	{
		if (! is_string($fileId)) {
			return null;
		}

		if (empty($type)) {
			$type = FileAbstraction::CN();
		}
		
		return $this->getDoctrineEntityManager()
				->find($type, $fileId);
	}
742221
public function getTypeName($type = null)
	{
		$group = $this->getGroup();
		$type  = $type === null ? $this->getType() : $type;

		return $GLOBALS['BOOTSTRAP']['wrappers'][$group][$type]['name'];
	}
526976
public function getID($title, $type = null) {
        $filter = [
            'title' => $title
        ];

        if (isset($type)) {
            $filter['type'] = $type;
        }

        $result = $this->read($filter);

        switch (count($result)) {
            case 0:
                throw new RuntimeException('Object not found');
            case 1:
                if (!array_key_exists(0, $result) ||
                    !array_key_exists('id', $result[0])) {
                    throw new RuntimeException('Bad result');
                }

                return $result[0]['id'];
            default:
                throw new RuntimeException('Found %s objects', count($result));
        }
    }
1257531
private static function getTyped($type)
    {
        if (!isset(static::$types[$type])) {
            static::$types[$type] = new self($type);
        }

        return static::$types[$type];
    }
271191
private function getIdGenerator($type)
    {
        if (!isset($this->idGenerators[$type])) {
            $this->idGenerators[$type] = IdGenerator::create($type);
        }

        return $this->idGenerators[$type];
    }
328958
private function checkType($type)
    {
        $isInType = true;

        foreach ($this->getKeys() as $key) {
            if (gettype($key) !== $type) {
                $isInType = false;
                break;
            }
        }

        return $isInType;
    }
1073689
public function type($type = null)
    {
        if (is_null($type)) {
            return $this->type;
        }

        $this->type = $type;

        return $this;
    }
528208
public function getType($type)
    {
        $aliases = array(
            'int'    => 'integer',
            'bool'   => 'boolean',
            'double' => 'float',
            'object' => '\\stdClass'
        );
        $default = array(
            'integer', 'boolean', 'float', '\\stdClass', 'callable', 'string', 'resource', 'void', 'mixed'
        );
        $typeHintEnabled = false;

        if (isset($aliases[$type])) {
            $type = $aliases[$type];
        }

        if (!in_array($type, $default)) {
            $typeHintEnabled = true;
        }

        return array(
            'name' => $type,
            'hint' => $typeHintEnabled
        );
    }
1126628
public function getDefault(string $type)
    {
        switch ($type) {
            case self::TYPE_NULL:
                return null;
            case self::TYPE_BOOLEAN:
                return false;
            case self::TYPE_INTEGER:
            case self::TYPE_FLOAT:
                return 0;
            case self::TYPE_STRING:
            case self::TYPE_BINARY:
                return '';
            case self::TYPE_ARRAY:
            case self::TYPE_OBJECT:
                return [];
        }

        throw new InvalidValueException("Invalid value type: $type");
    }
1029683
public function getNextOfType($type)
    {
        for (; $this->idx < $this->count; ++$this->idx) {
            if ($this->tokens[$this->idx]->type === $type) {
                return $this->tokens[$this->idx++];
            }
        }

        return null;
    }
304783
public function tokenIs($type)
    {
        if (is_string($this->token)) {
            return ($this->token == $type);
        }

        return ($this->token[0] == $type);
    }
1020910
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            $this->type = $type;
        }

        return $this;
    }
43111
public static function getName($type)
    {
        if (array_key_exists($type, self::$formatName)) {
            return self::$formatName[$type];
        } else {
            return Pel::fmt('Unknown format: 0x%X', $type);
        }
    }
252232
public function findSiteByType($type) {
        $type = (int) $type;
        return \Functional\first($this->_getSiteList(), function (CM_Site_Abstract $site) use ($type) {
            return $site->getType() === $type;
        });
    }
469659
protected function getTypeById($type, $id)
    {
        $items = isset($this->$type) ? $this->$type : [];

        if (false === isset($items[$id])) {
            throw new \RuntimeException(sprintf("Unknown %s item with id '%s'", $type, $id), 404);
        }

        return $items[$id];
    }