Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created March 10, 2016 13:48
Show Gist options
  • Save ScullWM/31d3920e9f49df553e6e to your computer and use it in GitHub Desktop.
Save ScullWM/31d3920e9f49df553e6e to your computer and use it in GitHub Desktop.
<?php
class test {
$typeAssoc = [
DocumentInterface::TYPE_QUOTATION => DocumentInterface::CLASSNAME_QUOTATION,
DocumentInterface::TYPE_QUOTATION => DocumentInterface::CLASSNAME_QUOTATION,
DocumentInterface::TYPE_QUOTATION => DocumentInterface::CLASSNAME_QUOTATION,
DocumentInterface::TYPE_QUOTATION => DocumentInterface::CLASSNAME_QUOTATION,
];
public function getTypeClassName()
{
if (isset($this->typeAssoc[$this->getType()]) {
return $this->typeAssoc[$this->getType()];
}
throw new \Exception('WTF entity');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment