[TYPO3-mvc] Extendig of other model fails

David Greiner davidgreiner at gmx.net
Wed Apr 16 12:23:36 CEST 2014


Hi Stefan!
 
Non namespaced extensions are extendable by namespaced extensions too. 
 
I did this on TYPO3 6.1.7 with tx_news. 
 
My extending extension is called vtm_news_extend. 
 
Inside vtm_news_extend there is a file called ext_typoscript_setup.txt with the following contents. 
 

config.tx_extbase {
objects {
  Tx_News_Domain_Model_Media.className = Vtm\VtmNewsExtend\Domain\Model\Media
 }
 persistence.classes {
  Tx_News_Domain_Model_Media.subclasses.Tx_VtmNewsExtend_Media = Vtm\VtmNewsExtend\Domain\Model\Media
  Vtm\VtmNewsExtend\Domain\Model\Media {
   mapping {
    tableName = tx_news_domain_model_media
    recordType =
   }
  }
 }
}

I am not really sure whether "Tx_VtmNewsExtend_Media" behind "subclasses" is neccessary, but i think this can be some value of your choice.
 
 
The file EXT:vtm_news_extend/Classes/Domain/Model/Media.php is namespaced and extends Tx_News_Domain_Model_Media: 
 
namespace Vtm\VtmNewsExtend\Domain\Model;
....
Class Media extends \Tx_News_Domain_Model_Media {
...
}
 
 
This setup works very fine.
 
 
Greetings, David.
 

Gesendet: Dienstag, 15. April 2014 um 17:14 Uhr
Von: "Stefan Kruse" <besucher80 at gmx.de>
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] Extendig of other model fails
Hello,

im always trying to extend the In2Snippets Extension. I need to extend one
Model with a Model from me. The In2Snippets Extension is non-Namespaced but
my Extension is namespaced.
Could this be the problem that the extending not work?
I try it with:

config.tx_extbase{
persistence{
classes{

\Tx_In2snippets_Domain_Model_Code {
subclasses {
Tx_In2snippetsextening_Code =
SK\In2snippetsextening\Domain\Model\Code

}
}
SK\In2snippetsextening\Domain\Model\Code {
mapping {
tableName = tx_in2snippets_domain_model_code
recordType = Tx_In2snippetsextening_Code
}
}

}
}
}

But the new properties from me are not working. If I put my new properties,
getters and setters in the original file from the In2Snippets Extension it
works.
I think the class extending doesn't work, but why?
Thanks a lot Stefan

_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list