diff --git a/includes/class-QueryRoom.php b/includes/class-QueryRoom.php index 86f2763..f7764f0 100644 --- a/includes/class-QueryRoom.php +++ b/includes/class-QueryRoom.php @@ -1,82 +1,92 @@ . /** * Methods related to a QueryRoom class */ trait QueryRoomTrait { /** * Where the Room is... * * @param object $event Room * @return self */ public function whereRoom( $event ) { return $this->whereRoomID( $event->getRoomID() ); } /** * Where the Room ID is... * * @param int $id Room ID * @return self */ public function whereRoomID( $id ) { return $this->whereInt( $this->ROOM_ID, $id ); } + /** + * Where the Room UID is... + * + * @param string $uid Room ID + * @return self + */ + public function whereRoomUID( $uid ) { + return $this->whereStr( Room::UID, $uid ); + } + /** * Join a generic table with the Room table * * @param string $type Join type * @return self */ public function joinRoom( $type = 'INNER' ) { // build the: // INNER JOIN room ON (room.room_ID = room_ID) return $this->joinOn( $type, Room::T, Room::ID_, $this->ROOM_ID ); } } /** * Utility used to Query a Room. */ -class QueryRoom { +class QueryRoom extends Query { use QueryRoomTrait; /** * Full name of the column of the Room ID */ protected $ROOM_ID = 'room_ID'; /** * Constructor */ public function __construct() { parent::__construct(); $this->from( Room::T ); $this->defaultClass( Room::class ); } }