Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- class Guid extends Object implements Guid_Interface
- {
- public function __construct()
- {
- try{
- try{parent::__construct(NULL);}
- catch(DatatypeExpectedException $e){throw new DatatypeExpectedException($e->getCode());}
- catch(ArgumentNullException $e){throw new ArgumentNullException($e->getCode());}
- $uid = new String;
- $int = new Integer;
- $cat = new String;
- $uid->set((string) md5($this->getHashCode()->get()))
- ->insert($int->set(8), $cat->set('-'))
- ->insert($int->set(13), $cat)
- ->insert($int->set(18), $cat)
- ->insert($int->set(23), $cat);
- $this->set($uid->get());
- $this->finalize()->lock();
- }catch(SystemException $e){throw new ObjectHandlerException(ObjectHandlerException::ERROR_CAN_NOT_CREATE, $e);}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement