Prado\Data\DataGateway\TDataGatewayCommand::update PHP Method

update() public method

Updates the table with new data.
public update ( $data, $criteria ) : integer
return integer number of records affected.
    public function update($data, $criteria)
    {
        $where = $criteria->getCondition();
        $parameters = $criteria->getParameters()->toArray();
        $command = $this->getBuilder()->createUpdateCommand($data, $where, $parameters);
        $this->onCreateCommand($command, $criteria);
        $command->prepare();
        return $this->onExecuteCommand($command, $command->execute());
    }