0

eclipse PDTを使用してORMとしてdoctrine 2を備えたcodeigniter 2フレームワークを使用してプロジェクトを書いています。doctrine 2 Entities クラス (\application\models\Entities フォルダーにあるもの) でオートコンプリートを機能させる方法があるかどうかを知りたいのですが、私はそれを CASUALLY で一度だけ機能させることができたので、それが可能であることを知っています。今、それを常に機能させる方法や、何が間違っているのか疑問に思っています。

明確にするために、次のコントローラーがあるとしましょう。

class Main extends My_Controller {

    function index() {

        $casualAccount = $this->doctrine->em->find('Entities\Account' , 1);
        $casualAccount-> **AUTOCOMPLETITION NOT WORKING HERE**
        $this->load->view('welcome_message.php');

    }
}

このモデルは にあり\models\Entitiesます:

use Doctrine\ORM\Mapping as ORM;

/**
 * Entities\Account
 */
class Account

{
    /**
     * @var integer $id
     */
    private $id;

    /**
     * @var string $Mail
     */
    private $Mail;

    /**
     * @var string $Password
     */
    private $Password;

    /**
     * @var string $Type
     */
    private $Type;

    /**
     * @var string $First_name
     */
    private $First_name;

    /**
     * @var string $Last_name
     */
    private $Last_name;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set Mail
     *
     * @param string $mail
     * @return Account
     */
    public function setMail($mail)
    {
        $this->Mail = $mail;
        return $this;
    }

    /**
     * Get Mail
     *
     * @return string 
     */
    public function getMail()
    {
        return $this->Mail;
    }

    /**
     * Set Password
     *
     * @param string $password
     * @return Account
     */
    public function setPassword($password)
    {
        $this->Password = $password;
        return $this;
    }

    /**
     * Get Password
     *
     * @return string 
     */
    public function getPassword()
    {
        return $this->Password;
    }

    /**
     * Set Type
     *
     * @param string $type
     * @return Account
     */
    public function setType($type)
    {
        $this->Type = $type;
        return $this;
    }

    /**
     * Get Type
     *
     * @return string 
     */
    public function getType()
    {
        return $this->Type;
    }

    /**
     * Set First_name
     *
     * @param string $firstName
     * @return Account
     */
    public function setFirstName($firstName)
    {
        $this->First_name = $firstName;
        return $this;
    }

    /**
     * Get First_name
     *
     * @return string 
     */
    public function getFirstName()
    {
        return $this->First_name;
    }

    /**
     * Set Last_name
     *
     * @param string $lastName
     * @return Account
     */
    public function setLastName($lastName)
    {
        $this->Last_name = $lastName;
        return $this;
    }

    /**
     * Get Last_name
     *
     * @return string 
     */
    public function getLastName()
    {
        return $this->Last_name;
    }

アップデート。Manix のコメントが少し役に立っています。次の構文を使用して、どのクラスになるかを示す変数をクラスで宣言することができます。

class Main extends My_Controller {
    /**
    * @var Entities\Account
    */
    var $casualAccount;

 ....

}

これは少しは役立つかもしれませんが、自動オートコンプリート Eclipse ができるはずのことにはまだほど遠いです。

4

1 に答える 1