src/Base.php
public static function find($stmt)
    {
         try {
            $result = $stmt->fetch(PDO::FETCH_ASSOC);
            if(! $result) {
                throw new Exception(" Record not found.");
            }

            $object = new static;
            $object->id = $result['id'];
            $object->result = json_encode($result);

            return $object;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function find($stmt)
    {
         try {
            $result = $stmt->fetch(PDO::FETCH_ASSOC);
            if(! $result) {
                throw new Exception(" Record not found.");
            }

            $object = new static;
            $object->id = $result['id'];
            $object->result = json_encode($result);

            return $object;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function find ( $ stmt ) { try { $ result = $ stmt -> fetch ( PDO :: FETCH_ASSOC ) ; if ( ! $ result ) { throw new Exception ( " Record not found." ) ; } $ object = new static ; $ object -> id = $ result [ 'id' ] ; $ object -> result = json_encode ( $ result ) ; return $ object ; } catch ( PDOException $ pe ) { return $ pe -> getMessage ( ) ; } catch ( Exception $ e ) { return $ e -> getMessage ( ) ; } }
Finds a record in the database using the statement object passed in
@param  PDO statement $stmt
Finds a record in the database using the statement object passed in