[TYPO3-mvc] Find records by difference storage page id

Eat Dimanche dimanche at web-essentials.asia
Tue Jul 13 13:21:19 CEST 2010


On 07/02/2010 04:55 AM, "Christian Müller [kitsunet]" wrote:
> On 01.07.2010 21:02, Thomas "Thasmo" Deinhamer wrote:
>> Am 01.07.2010 15:10, schrieb Eat Dimanche:
>>> I have one class is called Tx_XX_Domain_Model_Comapny which has a
>>> relationship with Tx_XX_Domain_Model_Country. The company contains a
>>> country, and for table country it is selected data from static_countries
>>> table. When I am working on the frontend I want to list all the
>>> countries in a dropdown, but I can't.
>>
>> Hello!
>>
>> Actually there is a patch which would at least enable you to query
>> objects via all find*ByUid() without pid restriction. For repositories
>> I'm not sure if you can use them to get objects from pid 0, because a
>> page with uid 0 does NOT exist.
>>
>> Of course records can have pid 0, but that just means that these records
>> don't have any pid assigned. So they've no real relation to any page. In
>> case of the backend, these records are listed on the super-rootpage.
>>
>> The patch I'm talking about is this:
>> http://forge.typo3.org/issues/5631
>>
>> I also think if you use the trunk version of Extbase,
>> this patch is already included.
>>
>> For querying multiple objects via repository I'm not sure if it's
>> possible to get objects from pid 0.
>>
>> Thomas
>
> Hi,
>
> I have done the same with static_countries and you need the mentioned
> patch to make it work.
>
> Christian

Hi Christian,

Related to the table static_countries(Tx_XX_Domain_Model_Country). I am 
wondering why I could not get the object of it through a 
Company(Tx_XX_Domain_Model_Company) when I debug the company object it 
shows empty value for the field country which is contained in the 
company object.

Here is the debug result:

|Object:

Tx_XX_Domain_Model_Company Object
(
     [name:protected] => ABC
     [byline:protected] => 123
     [logo:protected] => 1279006768BE.JPG
     [street:protected] => #123
     [poBox:protected] => 44
     [zip:protected] => 123
     [city:protected] => city

     [country:protected] =>

     [email:protected] => sovan at gmail.com
     [feUser:protected] => Tx_Hbt_Domain_Model_FeUser Object
         (
             [username:protected] => sovan
             [password:protected] => sovan
             [usergroup:protected] => 
Tx_Extbase_Persistence_ObjectStorage Object
                 (
                     [storage:protected] => Array
                         (
				.............................
				.............................
				.............................

Here is my typoscript configuration:

config {
   tx_extbase {
     persistence {
       updateReferenceIndex = 1
       classes {
         Tx_XX_Domain_Model_Country {
           mapping {
             tableName = static_countries
             recordType = 0
           }
         }
       }
     }
   }
}

Do you have any idea?


Thanks,
Dimanche


More information about the TYPO3-project-typo3v4mvc mailing list