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()])); }
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()])); }
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; }
/** @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]); }
/** * 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); }
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()])); }
/** * 16-byte string (big-endian byte order) * * @return string */ public function getBytes() { return $this->ramseyUuid->getBytes(); }