static public function getMediotecasForCustomer(CNabuCustomer $nb_customer)
    {
        $nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID);
        if (is_numeric($nb_customer_id)) {
            $retval = CNabuMedioteca::buildObjectListFromSQL(
                NABU_MEDIOTECA_FIELD_ID,
                'select * '
                . 'from ' . NABU_MEDIOTECA_TABLE . ' '
                . 'where nb_customer_id=%cust_id$d',
                array(
                    'cust_id' => $nb_customer_id
                ),
                $nb_customer
            );
        } else {
            $retval = new CNabuMediotecaList($nb_customer);
        }

        return $retval;
    }