Repo/Dao/Account.php
public function getSystemAccountId($assetTypeId)
    {
        /* TODO: add cache for accounts ids */
        $result = null;
        $custId = $this->getSystemCustomerId();
        if ($custId) {
            $found = $this->getByCustomerId($custId, $assetTypeId);
            if ($found) {
                $result = $found->getId();
            } else {
                /* there is no yet system account for this asset type */
                $account = new Entity();
                $account->setAssetTypeId($assetTypeId);
                $account->setCustomerId($custId);
                $result = $this->create($account);
            }
        }
        return $result;
    }
public function getSystemAccountId($assetTypeId)
    {
        /* TODO: add cache for accounts ids */
        $result = null;
        $custId = $this->getSystemCustomerId();
        if ($custId) {
            $found = $this->getByCustomerId($custId, $assetTypeId);
            if ($found) {
                $result = $found->getId();
            } else {
                /* there is no yet system account for this asset type */
                $account = new Entity();
                $account->setAssetTypeId($assetTypeId);
                $account->setCustomerId($custId);
                $result = $this->create($account);
            }
        }
        return $result;
    }
Return system account ID for given asset type. Create new account if there is no yet system
account for this asset type.

@param int $assetTypeId
@return int|null
@throws \Exception