public function delete($entity)
    {
        $query = $this->db->table($entity->definition()->getName());
        $primary = $entity->id();
        if (isset($this->objects[$entity->definition()->getName()][base64_encode(serialize($primary))])) {
            foreach ($primary as $k => $v) {
                $query->filter($k, $v);
            }
            $query->delete();
            unset($this->objects[$entity->definition()->getName()][base64_encode(serialize($primary))]);
        }
    }
public function delete($entity)
    {
        $query = $this->db->table($entity->definition()->getName());
        $primary = $entity->id();
        if (isset($this->objects[$entity->definition()->getName()][base64_encode(serialize($primary))])) {
            foreach ($primary as $k => $v) {
                $query->filter($k, $v);
            }
            $query->delete();
            unset($this->objects[$entity->definition()->getName()][base64_encode(serialize($primary))]);
        }
    }
public function delete ( $ entity ) { $ query = $ this -> db -> table ( $ entity -> definition ( ) -> getName ( ) ) ; $ primary = $ entity -> id ( ) ; if ( isset ( $ this -> objects [ $ entity -> definition ( ) -> getName ( ) ] [ base64_encode ( serialize ( $ primary ) ) ] ) ) { foreach ( $ primary as $ k => $ v ) { $ query -> filter ( $ k , $ v ) ; } $ query -> delete ( ) ; unset ( $ this -> objects [ $ entity -> definition ( ) -> getName ( ) ] [ base64_encode ( serialize ( $ primary ) ) ] ) ; } }
Delete an entity from the database

@param object $entity
@return void
Delete an entity from the database