public function _billingCode($from, $to, $action)
{
switch ($action) {
case static::ACT_CONVERT_TO_OBJECT:
/* @var $from CostCentreEntity */
$to->billingCode = $from->getProperty(CostCentrePropertyEntity::NAME_BILLING_CODE);
break;
case static::ACT_CONVERT_TO_ENTITY:
/** @var $to CostCentreEntity */
throw new NotYetImplementedException();
break;
case static::ACT_GET_FILTER_CRITERIA:
$cc = new CostCentreEntity();
$property = new CostCentrePropertyEntity();
return [AbstractEntity::STMT_FROM => "\n JOIN {$property->table()} ON {$property->columnCcId} = {$cc->columnCcId}\n AND {$property->columnName} = " . $property->qstr('name', CostCentrePropertyEntity::NAME_BILLING_CODE) . "\n ", AbstractEntity::STMT_WHERE => "{$property->columnValue} = " . $property->qstr('value', $from->billingCode)];
}
}