Returns an object's unique identifier (a short version), useful for debugging.

@param object|null $o
@return int|string A serial number from a global inspection sequence; '' if it is null.
546081
public static function objectId ($o)
  {
    if (is_null ($o))
      return '';
    static $ids = [];
    static $c = 0;
    $id = spl_object_hash ($o);
    if (isset($ids[$id]))
      return $ids[$id];
    return $ids[$id] = ++$c;
  }
652431
public function look($n, $o = 0)
    {
        if ($this->length <= $o) {
            return '';
        }
        return $this->substr($o, $n);
    }
1186853
static final Object getObjectId(Object obj) {
        if (obj == null) {
            throw new NullPointerException();
        }
        if (!(obj instanceof ZooPC)) {
        	//non-peristent class
        	return null;
        }
        long id = Session.getObjectId(obj);
        //non-persistent object --> null
        return id >= 0 ? id : null;
    }
598259
static function fetchByIdentifier( $identifier, $asObject = true )
    {
        return eZPersistentObject::fetchObject( eZContentObjectAttribute::definition(),
                                                null,
                                                array( 'sort_key_string' => $identifier, 'data_type_string' => 'ezstring' ),
                                                $asObject );
    }
163281
public ORID getIdentity(final Object iPojo) {
		final ODocument record = getRecordByUserObject(iPojo, false);
		if (record == null)
			throw new OObjectNotManagedException("The object " + iPojo + " is not managed by current database");

		return record.getIdentity();
	}
806841
public function get($identifier)
    {
        $identifier = (string) $identifier;

        if($this->offsetExists($identifier)) {
            $result = $this->offsetGet($identifier);
        } else {
            $result = null;
        }

        return $result;
    }
5256
public static function parse($oid) {
    // fast checks first
    if ($oid instanceof ObjectId) {
      return $oid;
    }

    $oidParts = self::parseOidString($oid);
    $type = $oidParts['type'];
    $ids = $oidParts['id'];
    $prefix = $oidParts['prefix'];

    // check the type
    if (!ObjectFactory::getInstance('persistenceFacade')->isKnownType($type)) {
      return null;
    }

    // check if number of ids match the type
    $numPks = self::getNumberOfPKs($type);
    if ($numPks == null || $numPks != sizeof($ids)) {
      return null;
    }

    return new ObjectID($type, $ids, $prefix);
  }
209681
public static String getName(ObjectIdentifier oid) {
        OIDInfo info = oidMap.get(oid);
        return (info == null) ? null : info.name;
    }
666881
public function get(string $object)
    {
        return ($this->exists($object)) ? $this->registry[$object] : null;
    }
1142315
public static function objectToID($object)
    {
        $resultID = null;
        if (is_object($object) && method_exists($object, '__toString')
        ) {
            $resultID = $object->__toString();
        } else {
            if (is_array($object)) {
                foreach ($object as $item => $value) {
                    $resultID[$item] = self::objectToID($value);
                }
            } else { //String
                $resultID = $object;
            }
        }

        return $resultID;
    }
1086637
private function optShortName($o) {
		$o = $this->opt($o);
		return is_numeric($this->spec[$o][0]) ? null : $this->spec[$o][0];
	}
517022
private function optLongName($o) {
		$o = $this->opt($o);
		return is_numeric($this->spec[$o][0]) ? $this->spec[$o][0] : $this->spec[$o][1];
	}
93551
protected function getPrefix($object)
    {
        $id = 'user';

        if (method_exists($object, 'getOrganization')) {
            $org = $object->getOrganization();

            if ($org instanceof OrganizationInterface) {
                $id = (string) $org->getId();
            }
        }

        return $id.'__';
    }
1250728
public function getIdentifier()
    {
        if (is_array($this->callback)) {
            $class = $this->callback[0];

            if (is_object($class)) {
                $class = get_class($class);
            }

            return $class . '::' . $this->callback[1];
        }
        else if (is_object($this->callback)) {
            return spl_object_hash((object) $this->callback);
        }

        return (string) $this->callback;
    }
961052
public static function getClassName($object): ?string {
        $validObject = ClassUtil::isValidObject($object);
        if (!$validObject) {
            return null;
        }
        return (new \ReflectionClass($object))->getName();
    }
609903
public function getLastInsID($sequence = null)
    {
        $id = $this->builder->getLastInsID();

        if (is_array($id)) {
            array_walk($id, function (&$item, $key) {
                if ($item instanceof ObjectID) {
                    $item = $item->__toString();
                }
            });
        } elseif ($id instanceof ObjectID) {
            $id = $id->__toString();
        }

        return $id;
    }
1129447
protected function getErrorIdentifier($object, $type)
    {
        $idValue = DomainUtil::getIdentifier($this->om, $object);
        $idError = null;

        if (Domain::TYPE_CREATE === $type && null !== $idValue) {
            $idError = $this->translator->trans('domain.identifier.error_create', [], 'FxpResource');
        } elseif (Domain::TYPE_UPDATE === $type && null === $idValue) {
            $idError = $this->translator->trans('domain.identifier.error_update', [], 'FxpResource');
        } elseif (Domain::TYPE_DELETE === $type && null === $idValue) {
            $idError = $this->translator->trans('domain.identifier.error_delete', [], 'FxpResource');
        } elseif (Domain::TYPE_UNDELETE === $type && null === $idValue) {
            $idError = $this->translator->trans('domain.identifier.error_undeleted', [], 'FxpResource');
        }

        return $idError;
    }