Ejemplo n.º 1
0
 public function getByUuid(UuidInterface $uuid) : Token
 {
     return $this->getTokenFromRow($this->getRow('
         SELECT token_uuid, pass_code, user_uuid, expires
           FROM tokens
          WHERE token_uuid = :token_uuid
     ', ['token_uuid' => $uuid->getBytes()]));
 }
Ejemplo n.º 2
0
 public function getByUuid(UuidInterface $uuid) : User
 {
     return $this->getUserFromRow($this->getRow('
             SELECT user_uuid, email_address, password, display_name, created, updated
               FROM users
         INNER JOIN objects ON (user_uuid = uuid AND type = "users")
              WHERE user_uuid = :user_uuid
     ', ['user_uuid' => $uuid->getBytes()]));
 }
Ejemplo n.º 3
0
 public function getByUuid(UuidInterface $uuid) : Page
 {
     $page = $this->getPageFromRow($this->getRow('
             SELECT page_uuid, title, slug, short_title, parent_uuid, sort_order, status, created, updated
               FROM pages
         INNER JOIN objects ON (page_uuid = uuid AND type = "pages")
              WHERE page_uuid = :page_uuid
     ', ['page_uuid' => $uuid->getBytes()]));
     $this->getBlocksForPages([$page]);
     return $page;
 }
Ejemplo n.º 4
0
 /** @return  void */
 public function delete(string $type, UuidInterface $uuid)
 {
     $this->pdo->prepare('DELETE FROM objects WHERE uuid = :uuid AND type = :type')->execute(['uuid' => $uuid->getBytes(), 'type' => $type]);
 }
Ejemplo n.º 5
0
 /**
  * Encodes a UUID into a string (LSB first) according to the alphabet
  * If leftmost (MSB) bits 0, string might be shorter
  *
  * @param UuidInterface $uuid
  * @return string
  */
 public function encode($uuid)
 {
     $padLength = $this->encodedLength(strlen($uuid->getBytes()));
     return $this->numToString($uuid->getInteger(), $padLength);
 }
Ejemplo n.º 6
0
 public function getByUuid(UuidInterface $uuid) : File
 {
     return $this->getFileFromRow($this->getRow('
             SELECT file_uuid, name, path, mime_type, created, updated
               FROM files
         INNER JOIN objects ON (file_uuid = uuid AND type = "files")
              WHERE file_uuid = :file_uuid
     ', ['file_uuid' => $uuid->getBytes()]));
 }
Ejemplo n.º 7
0
 /**
  * 16-byte string (big-endian byte order)
  *
  * @return string
  */
 public function getBytes()
 {
     return $this->ramseyUuid->getBytes();
 }