Skip to content

Instantly share code, notes, and snippets.

@thecodedrift
Created August 17, 2012 22:16
Show Gist options
  • Select an option

  • Save thecodedrift/3383215 to your computer and use it in GitHub Desktop.

Select an option

Save thecodedrift/3383215 to your computer and use it in GitHub Desktop.
Reversable Transaction Entities
<?PHP
/**
* Required Include Files
*/
require_once(DIR_CLASSES . 'container/datatypecontainer.php');
class TransactionEntry
{
function TransactionEntry()
{
$this->Container = new DataTypeContainer();
}
function importData($data) {}
function exportData($preserveId = true) {}
function setEntryId($v) {}
function getEntryId() {}
function setTransactionId($v) {}
function getTransactionId() {}
function setEntityId($v) {}
function getEntityId() {}
function setAccountType($v) {}
function getAccountType() {}
function setObjectId($v) {}
function getObjectId() {}
function setAttribute($v) {}
function getAttribute() {}
function setAsAdd() {}
function setAsSubtract() {}
function setPolarity($v) {}
function getPolarity() {}
function setTimestamp($v) {}
function getTimestamp() {}
function setStatus($v) {}
function getStatus() {}
function cloneInverse()
{
$obj = new TransactionEntry();
$data = $this->exportData(false);
$data["polarity"] = $data["polarity"] * -1;
$obj->importData($data);
return $obj;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment