Options
All
  • Public
  • Public/Protected
  • All
Menu

Data access object (Dao) class for Cart model entity

see

Dao

Hierarchy

  • CartDao

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Create a Cart data access object.

    Returns CartDao

Properties

Private _pool

_pool: Pool

Methods

create

  • Creates a new record in database provided by given Cart entity.

    Parameters

    • cart: Cart

      A new Cart entity to create in database.

    Returns Promise<Cart>

    a Cart entity of the newly created record.

delete

  • Deletes cart record in database for given Cart entity, record is acquired by id field in given Cart entity.

    Parameters

    • cart: Cart

      Cart entity to be deleted from database.

    Returns Promise<Cart>

    the deleted Cart entity, null if no record is found.

read

  • read(id: number): Promise<Cart>
  • Queries for a cart with a given id.

    Parameters

    • id: number

      Unique identifier for a cart to acquire.

    Returns Promise<Cart>

    a Cart model entity for resultant record, null if none found.

readAll

  • readAll(): Promise<Cart[]>
  • Queries for all carts stored in database.

    Returns Promise<Cart[]>

    A collection of Cart model entities.

update

  • Updates record attributes to values specified in params, record is acquired by id field in given Cart entity.

    Parameters

    • cart: Cart

      Cart entity to be updated.

    • params: CartParams

      JSON object with specified fields to be updated with new values.

    Returns Promise<Cart>

    the updated Cart entity, null if no record is found.

Generated using TypeDoc