Permalink
Browse files

upgrad for annotations to work with the current master

  • Loading branch information...
1 parent ab5835f commit f980689b835b2c640df7deceeec5305404337bb0 @tlayh committed Apr 26, 2012
@@ -24,27 +24,29 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* Default controller with some basic stuff, each other controller should extend
* this controller to get functions like the sidebar snippetes and the login data
*/
-class BaseController extends \TYPO3\FLOW3\MVC\Controller\ActionController {
+class BaseController extends \TYPO3\FLOW3\Mvc\Controller\ActionController {
/**
* @var \Layh\Twitcode\Domain\Model\Login
- * @inject
+ * @FLOW3\Inject
*/
protected $login;
/**
* @var \Layh\Twitcode\Domain\Repository\CodetypeRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $codetypeRepository;
/**
* @var \Layh\Twitcode\Domain\Repository\CodeRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $codeRepository;
@@ -60,7 +62,7 @@ class BaseController extends \TYPO3\FLOW3\MVC\Controller\ActionController {
/*
* Inject the settings
- *
+ *
* @param array $settings
* @return void
*/
@@ -1,7 +1,7 @@
<?php
namespace Layh\Twitcode\Controller;
-require_once('/var/www/vhosts/twitcode.org/httpdocs/Packages/Applications/Layh.Twitcode/Resources/Private/Lib/oauth/EpiTwitter.php');
+require_once('/var/www/vhosts/twitcode.org/subdom/flow/htdocs/Packages/Applications/Layh.Twitcode/Resources/Private/Lib/oauth/EpiTwitter.php');
/***************************************************************
* Copyright notice
@@ -26,6 +26,8 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* Code controller for the Twitcode package
*
@@ -35,19 +37,19 @@ class CodeController extends \Layh\Twitcode\Controller\BaseController {
/**
* @var \Layh\Twitcode\Domain\Repository\CommentRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $commentRepository;
/**
* @var \Layh\Twitcode\Domain\Repository\UserRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $userRepository;
/**
* @var \Layh\Twitcode\Domain\Repository\TagRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $tagRepository;
@@ -108,7 +110,7 @@ public function loginAction() {
$this->redirect('');
}
- /*
+ /**
* index action
*
* @return void
@@ -127,14 +129,14 @@ public function indexAction() {
/**
* display snippet with
*
- * @dontvalidate \Layh\Twitcode\Domain\Model\Code $code
+ * @FLOW3\IgnoreValidation("\Layh\Twitcode\Domain\Model\Code $code")
* @param \Layh\Twitcode\Domain\Model\Code $code
* @return void
*/
public function showAction(\Layh\Twitcode\Domain\Model\Code $code) {
-
+
$this->login->setSettings($this->settings);
-
+
$this->initSidebarLogin();
// check if code belongs to current user
@@ -215,7 +217,7 @@ public function updateAction(\Layh\Twitcode\Domain\Model\Code $code, $tags) {
* show snippet form
*
* @param \Layh\Twitcode\Domain\Model\Code $code
- * @dontvalidate $code
+ * @@FLOW3\IgnoreValidation("\Layh\Twitcode\Domain\Model\Code $code")
* @return void
*/
public function createAction(\Layh\Twitcode\Domain\Model\Code $code=NULL) {
@@ -24,6 +24,11 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
+/**
+ *
+ */
class CodelibController extends \Layh\Twitcode\Controller\BaseController {
public function indexAction() {
@@ -24,6 +24,8 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+ use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* Discussion controller for the Twitcode package
*
@@ -33,7 +35,7 @@ class CommentController extends \Layh\Twitcode\Controller\BaseController {
/**
* @var \Layh\Twitcode\Domain\Repository\CommentRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $commentRepository;
@@ -24,6 +24,8 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* Import controller for the Twitcode package
*
@@ -33,19 +35,19 @@ class ImportController extends \TYPO3\FLOW3\MVC\Controller\ActionController {
/**
* @var Layh\Twitcode\Domain\Repository\CodeRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $codeRepository;
/**
* @var Layh\Twitcode\Domain\Repository\CodetypeRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $codeTypeRepository;
/**
* @var Layh\Twitcode\Domain\Repository\UserRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $userRepository;
@@ -24,6 +24,9 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+/**
+ * Controller for more or less static pages
+ */
class PagesController extends \Layh\Twitcode\Controller\BaseController {
public function aboutAction() {
@@ -24,26 +24,24 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* ProfilController
*
* Show settings of a user and save them
- *
- * @author Thomas Layh <develop@layh.com>
- * Date: 13.03.11
- * Time: 19:50
*/
class ProfileController extends \Layh\Twitcode\Controller\BaseController {
/**
* @var \Layh\Twitcode\Domain\Repository\CommentRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $commentRepository;
/**
* @var \Layh\Twitcode\Domain\Repository\UserRepository
- * @inject
+ * @FLOW3\Inject
*/
protected $userRepository;
@@ -24,52 +24,57 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use Doctrine\ORM\Mapping as ORM;
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* A code snippet
*
- * @scope prototype
- * @entity
+ * @FLOW3\Scope("prototype")
+ * @FLOW3\Entity
*/
class Code {
/**
- * @identity
+ * @ORM\Id
* @var integer
*/
protected $uid;
/**
* @var string
- * @validate StringLength(minimum = 5, maximum=100)
+ * @FLOW3\Validate(type="Text")
+ * @FLOW3\Validate(type="StringLength", options={"minimum"=5, "maximum"=100})
*/
protected $label;
/**
* @var Layh\Twitcode\Domain\Model\User
- * @ManyToOne
+ * @ORM\ManyToOne
*/
protected $user;
/**
* @var string
- * @validate StringLength(minimum = 10)
- * @Column(type="text")
+ * @FLOW3\Validate(type="Text")
+ * @FLOW3\Validate(type="StringLength", options={"minimum"=10})
+ * @ORM\Column(type="text")
*/
protected $code;
/**
* The code type the snippet belongs to
*
* @var Layh\Twitcode\Domain\Model\Codetype
- * @ManyToOne
+ * @ORM\ManyToOne
*/
protected $codetype;
/**
* The code description
* @var string
- * @validate StringLength(minimum = 10)
- * @Column(type="text")
+ * @FLOW3\Validate(type="StringLength", options={"minimum"=10})
+ * @ORM\Column(type="text")
*/
protected $description;
@@ -82,7 +87,7 @@ class Code {
/**
* @var \Doctrine\Common\Collections\ArrayCollection<\Layh\Twitcode\Domain\Model\Tag>
- * @ManyToMany(inversedBy="codes", cascade={"all"})
+ * @ORM\ManyToMany(inversedBy="codes", cascade={"all"})
*/
protected $tags;
@@ -24,11 +24,14 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use Doctrine\ORM\Mapping as ORM;
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* A code type
*
- * @scope prototype
- * @entity
+ * @FLOW3\Scope("prototype")
+ * @FLOW3\Entity
*/
class Codetype {
@@ -42,7 +45,7 @@ class Codetype {
/**
* The type
*
- * @identity
+ * @ORM\Id
* @var string
*/
protected $type = '';
@@ -24,34 +24,37 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+use Doctrine\ORM\Mapping as ORM;
+use \TYPO3\FLOW3\Annotations as FLOW3;
+
/**
* A discussion
*
- * @scope prototype
- * @entity
+ * @FLOW3\Scope("prototype")
+ * @FLOW3\Entity
*/
class Comment {
/**
* The user the discussion belongs to
* @var Layh\Twitcode\Domain\Model\User
- * @ManyToOne
+ * @ORM\ManyToOne
*/
protected $user;
/**
* The discussion
* @var string
- * @validate StringLength(minimum = 10)
- * @Column(type="text")
+ * @FLOW3\Validate(type="StringLength", options={"minimum"=10})
+ * @ORM\Column(type="text")
*/
protected $comment;
/**
* The code the discussion belongs to
*
* @var Layh\Twitcode\Domain\Model\Code
- * @ManyToOne
+ * @ORM\ManyToOne
*/
protected $code;
Oops, something went wrong.

0 comments on commit f980689

Please sign in to comment.