[TYPO3-german] Re: Extbase/ Fluid: Query-Objekt an Partial übergeben

Raphael Weber mailinglisten at screensolutions.de
Tue May 22 13:13:20 CEST 2012


Hallo Frank,

Am 22.05.12 12:42, schrieb Frank Gerards:
> Hallo,
>
> bei mir funktioniert dies reibungslos, das dem View übergebene Objekt kann unabhängig vom Objekttyp dem Partial übergeben werden. Ich mache dies immer mit allen statischen Daten, z.b. Ländern, Währungen etc. Wie sieht denn dein Country-Model aus ?

So:

[PHP]
class Tx_Extkey_Domain_Model_Country extends 
Tx_Extbase_DomainObject_AbstractEntity {

	/**
	 * Identifier for 'static_countries'
	 *
	 * @var int
	 * @validate NotEmpty
	 */
	protected $countryUid;

	/**
	 * ISO 2 Code of the Country
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $countryIso2;

	/**
	 * Local Country Name
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $countryNameLocal;

	/**
	 * International Country Name
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $countryNameInternational;

	/**
	 * ISO-3 Code of the country
	 *
	 * @var string
	 */
	protected $countryIso3;
	

	/**
	 * Returns the countryUid
	 *
	 * @return int countryUid
	 */
	public function getCountryUid() {
		return $this->countryUid;
	}

	/**
	 * Sets the countryUid
	 *
	 * @param int $countryUid
	 * @return int countryUid
	 */
	public function setCountryUid($countryUid) {
		$this->countryUid = $countryUid;
	}

	/**
	 * Returns the countryIso2
	 *
	 * @return string countryIso2
	 */
	public function getCountryIso2() {
		return $this->countryIso2;
	}

	/**
	 * Sets the countryIso2
	 *
	 * @param string $countryIso2
	 * @return string countryIso2
	 */
	public function setCountryIso2($countryIso2) {
		$this->countryIso2 = $countryIso2;
	}

	/**
	 * Returns the countryNameLocal
	 *
	 * @return string countryNameLocal
	 */
	public function getCountryNameLocal() {
		return $this->countryNameLocal;
	}

	/**
	 * Sets the countryNameLocal
	 *
	 * @param string $countryNameLocal
	 * @return string countryNameLocal
	 */
	public function setCountryNameLocal($countryNameLocal) {
		$this->countryNameLocal = $countryNameLocal;
	}

	/**
	 * Returns the countryNameInternational
	 *
	 * @return string countryNameInternational
	 */
	public function getCountryNameInternational() {
		return $this->countryNameInternational;
	}

	/**
	 * Sets the countryNameInternational
	 *
	 * @param string $countryNameInternational
	 * @return string countryNameInternational
	 */
	public function setContactName($countryNameInternational) {
		$this->countryNameInternational = $countryNameInternational;
	}

	/**
	 * Returns the countryIso3
	 *
	 * @return string $countryIso3
	 */
	public function getCountryIso3() {
		return $this->countryIso3;
	}

	/**
	 * Sets the countryIso3
	 *
	 * @param string $countryIso3
	 * @return void
	 */
	public function setCountryIso3($countryIso3) {
		$this->countryIso3 = $countryIso3;
	}

	/**
	 * Sets the countryNameInternational
	 *
	 * @param string $countryNameInternational
	 * @return void
	 */
	public function setCountryNameInternational($countryNameInternational) {
		$this->countryNameInternational = $countryNameInternational;
	}

}
[/PHP]

Wie man wahrscheinlich sieht, wurde das Modell mit dem extension_builder 
erzeugt.
Das Mapping dazu sieht so aus:

[TS]
plugin.tx_extkey {
    persistence {
       Tx_Extkey_Domain_Model_Country {
          mapping {
             tableName = static_countries
             recordType = Tx_Extkey_Domain_Model_Country
                columns {
                   uid.mapOnProperty = countryUid
                   cn_iso_2.mapOnProperty = countryIso2
                   cn_iso_3.mapOnProperty = countryIso3
                   cn_official_name_local.mapOnProperty = countryNameLocal
                   cn_official_name_en.mapOnProperty = 
countryNameInternational
                   }
                }
             }
	}
     }
}

[/TS]

Grüße,
	raphael


More information about the TYPO3-german mailing list