/** * A private method to return the account ID of the * account that should "own" audit trail entries for * this entity type; NOT related to the account ID * of the currently active account performing an * action. * * @return integer The account ID to insert into the * "account_id" column of the audit trail * database table. */ public function getOwningAccountIds($resetCache = false) { $accountType = OA_Permission::getAccountType(false); switch ($accountType) { case OA_ACCOUNT_ADMIN: return parent::_getOwningAccountIdsByAccountId($accountId = OA_Permission::getAccountId()); case OA_ACCOUNT_ADVERTISER: $parentTable = 'clients'; $parentKeyName = 'clientid'; break; case OA_ACCOUNT_TRAFFICKER: $parentTable = 'affiliates'; $parentKeyName = 'affiliateid'; break; case OA_ACCOUNT_MANAGER: $parentTable = 'agency'; $parentKeyName = 'agencyid'; break; } return $this->_getOwningAccountIds($parentTable, $parentKeyName); }