'%d', 'name' => '%s', 'email' => '%s', 'phone' => '%s', 'bio' => '%s', 'photo_id' => '%d', 'color' => '%s', 'timezone' => '%s', 'status' => '%s', 'sort' => '%d', ); } /** * The staff member linked to a WordPress user. * * @param int $user_id User. */ public function for_user( int $user_id ): ?array { if ( $user_id <= 0 ) { return null; } // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery $row = $this->db->get_row( $this->db->prepare( "SELECT * FROM {$this->table} WHERE user_id = %d AND status <> 'archived' LIMIT 1", $user_id ), ARRAY_A ); return $row ? $this->hydrate( $row ) : null; } }