Menu

## ParseTrait

ParseTrait.php : 21

### Table of Contents

#### Methods

all() : array<string|int, mixed>|null
  Returns all items from the CDatabase. If a callback is passed, it will be called on each item in the resultset
delete() : PDOStatement|null
where() : static
runGet() : mixed
runSelect() : array<string|int, mixed>|null

### Methods

#### all()

ParseTrait.php : 59

Returns all items from the CDatabase. If a callback is passed, it will be called on each item in the resultset

`public all([callable|null $callback = null ]) : array<string|int, mixed>|null`

##### Parameters

$callback : callable|null = null

  This is the receiver for the current resultset

##### Tags

example

      // Assignment method
      $row = Table::from('user')
          ->filter(['last_name' => 'Ezra'])
         ->all();

      // Callback method- this is little bit faster than the assignment method
      Table::from('user')
         ->filter(['last_name' => 'Ezra'])
        ->all(function($row) {
           echo $row->first_name;
       });

##### Return values

array<string|int, mixed>|null

#### delete()

ParseTrait.php : 79
`public delete(int|array<string|int, mixed>|string $where[, string|null $idField = 'id' ]) : PDOStatement|null`

##### Parameters

$where : int|array<string|int, mixed>|string
$idField : string|null = 'id'

##### Tags

example

        $res1 = Porm::from('users')->delete(1); // deletes a user with id 1
        $res2 = Porm::from('users')->delete(['name' => 'John']); // deletes a user with name John

##### Return values

PDOStatement|null

#### where()

ParseTrait.php : 64
`public where(array<string|int, mixed> $where) : static`

##### Parameters

$where : array<string|int, mixed>

##### Return values

static

#### runGet()

ParseTrait.php : 35
`private runGet() : mixed`

#### runSelect()

ParseTrait.php : 24
`private runSelect(callable|null $callback) : array<string|int, mixed>|null`

##### Parameters

$callback : callable|null

##### Return values

array<string|int, mixed>|null

## Search results