public function readOne($primary)
    {
        if (!$primary) {
            return $this->getTable()::create();
        }

        $row = $this->getTable()::findRow($primary);

        if (!$row) {
            throw new NotFoundException('Record not found');
        }

        $row = $this->filterRow($row);

        return $row;
    }
public function readOne($primary)
    {
        if (!$primary) {
            return $this->getTable()::create();
        }

        $row = $this->getTable()::findRow($primary);

        if (!$row) {
            throw new NotFoundException('Record not found');
        }

        $row = $this->filterRow($row);

        return $row;
    }
public function readOne ( $ primary ) { if ( ! $ primary ) { return $ this -> getTable ( ) :: create ( ) ; } $ row = $ this -> getTable ( ) :: findRow ( $ primary ) ; if ( ! $ row ) { throw new NotFoundException ( 'Record not found' ) ; } $ row = $ this -> filterRow ( $ row ) ; return $ row ; }
Get record from Db or create new object

@param  mixed $primary

@return Db\RowInterface
@throws TableNotFoundException
@throws NotFoundException
Get record from Db or create new object