TYPO3 Extension
setup.txt
plugin.tx_linuxmcemaps_map {
view {
templateRootPaths.0 = {$plugin.tx_linuxmcemaps_map.view.templateRootPath}
partialRootPaths.0 = {$plugin.tx_linuxmcemaps_map.view.partialRootPath}
layoutRootPaths.0 = {$plugin.tx_linuxmcemaps_map.view.layoutRootPath}
}
persistence {
storagePid = 31
classes {
Linuxmce\Linuxmcemaps\Domain\Model\User {
mapping {
tableName = tt_address
recordType = Linuxmce\Linuxmcemaps\Domain\Model\User
columns {
birthday.mapOnProperty = dateOfBirth
street.mapOnProperty = thoroughfare
}
}
}
}
}
}
Repository/UserRepository.php
namespace Linuxmce\Linuxmcemaps\Domain\Repository;
/**
* Class UserRepository
*
* @package Linuxmce\Linuxmcemaps\Domain\Repository
*/
class UserRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
}
Model/User.php
<?php
namespace Linuxmce\Linuxmcemaps\Domain\Model;
/***************************************************************
*
* Copyright notice
*
* (c) 2015 Patrick Lobacher <patrick.lobacher@pluswerk.ag>, Pluswerk AG
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* User
*/
class User extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* rufst
*
* @var string
* @validate NotEmpty
*/
protected $name = '';
/**
* sdfsfsd
*
* @var string
*/
protected $email = '';
/**
* Returns the name
*
* @return string $name
*/
public function getName()
{
return $this->name;
}
/**
* Sets the name
*
* @param string $name
* @return void
*/
public function setName($name)
{
$this->name = $name;
}
/**
* Returns the email
*
* @return string $email
*/
public function getEmail()
{
return $this->email;
}
/**
* Sets the email
*
* @param string $email
* @return void
*/
public function setEmail($email)
{
$this->email = $email;
}
}
Controller
namespace Linuxmce\Linuxmcemaps\Controller;
class MapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* @var \Linuxmce\Linuxmcemaps\Domain\Repository\UserRepository
* @inject
*/
protected $userRepository = NULL;
public function initializeAction(){
}
public function initializeListAction(){
}
public function showAction(){
$authors = $this->objectManager->get('Linuxmce\\Linuxmcemaps\\Domain\\Repository\\UserRepository')->findAll();
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($authors);
$this->view->assign('blogs',$authors);
$this->view->assign('search','asdsadsd');
}
}