Как создать критерии со сложным запросом в среде Yii?

Для школьного проекта мне нужно создать простое приложение для рисования, которое может рисовать линии, овалы и прямоугольники.

В задании указано, что мне нужны кнопки панели инструментов и пункты меню для каждый тип формы.

Я хотел бы пойти немного дальше и дальше, сделав кнопки JToggleButtons на панели инструментов и пункты меню JRadioButtonMenuItems . Кроме того, я хочу, чтобы когда вы выбираете одну из кнопок панели инструментов, она отменяет выбор других, выбирает соответствующий пункт меню и отменяет выбор других пунктов меню. То же самое для выбора одного из пунктов меню.

Я знаю, что могу сгруппировать любую AbstractButton с помощью ButtonGroup , но я не уверен, что это правильный путь, потому что хотя он отлично справляется с одной "группой" кнопок, Итак, я попробовал следующее в /Configuration/TypoScript/setup.txt: plugin.myextension ....

Я расширил таблицу страниц и теперь хочу использовать некоторые данные в объекте домена под названием «Теги ".
Итак, я попробовал следующее в /Configuration/TypoScript/setup.txt :

plugin.myextension.persistence.classes.Tx_myextension_Domain_Model_Tag {
    mapping {
        tableName = pages
        recordType = Tx_myextension_Domain_Model_Tag
        columns {
            tx_myextension_tag_name.mapOnProperty = name
            uid.mapOnProperty = id
        }
    }
}

Но кажется, что расширение пытается получить доступ к таблице Tx_myextension_Domain_Model_Tag (которой не существует)

Это ошибка, которую я получаю:

Tx_Extbase_Persistence_Storage_Exception_SqlError`

Таблица 'tx_myextension_domain_model_tag' не существует: SELECT tx_myextension_domain_model_tag. * FROM tx_myextension_domain_model_tag. * FROM tx_myextension_domain_model_tag. * FROM tx_myextension_domain_model_tag. * FROM tx_myextension_domain_model_tag. 121 --- 1853032-

Могу ли я скрыть свои поля ICollection <t>, когда у меня есть отображение "один ко многим" только в коде EF4? </t> Мои классы домена, которые имеют сопоставления "один ко многим", обычно принимают следующая форма (непроверенный код): public Customer Customer { // Public methods. public Order AddOrder(Order order) { ...

My domain classes that have one-to-many mappings generally take the following form (untested code):

public Customer Customer
{
    // Public methods.

    public Order AddOrder(Order order)
    {
        _orders.Add(order);
    }

    public Order GetOrder(long id)
    {
        return _orders.Where(x => x.Id).Single();
    }

    // etc.

    // Private fields.

    private ICollection _orders = new List();
}

The EF4 code-only samples I've seen expose a public ICollection when dealing with one-to-many relationships.

Is there a way to persist and restore my collections with exposing them? If not, it would appear that my domain objects will be designed to meet the requirements of the ORM, which seems to go against the spirit of the endeavour. Exposing an ICollection (with it's Add, etc. methods) doesn't seem particularly clean, and wouldn't be my default approach.

Update

Found this post that suggests it wasn't possible in May. Of course, the Microsoft poster did say that they were "strongly considering implementing" it (I'd hope so) and we're half a year on, so maybe there's been some progress?

6
задан dommer 3 November 2010 в 14:57
поделиться