GithubHelp home page GithubHelp logo

Comments (24)

Ocramius avatar Ocramius commented on July 21, 2024

@placebo be sure to have latest skeleton in place.

Assuming you have modified your .php.dist config file, and dropped it into your config/autoload directory (removing .dist from its name), it should work.

Actually, it should work even without that, but it should throw something like Access denied for user 'testuser'@'localhost' with the default config when running

./vendor/bin/doctrine-module orm:validate-schema

Also, you are using the wrong cli (doctrine instead of doctrine-module). Can you check that?

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

ok ... used this -> D:\xampp\htdocs\ttadmin\vendor\bin>doctrine-module orm:validate-schema

and got this :

'stty' is not recognized as an internal or external command,
operable program or batch file.



  [InvalidArgumentException]
  There are no commands defined in the "orm" namespace.

here is the content of D:\xampp\htdocs\ttadmin\config\autoload\module.doctrine.global.config.php

<?php

/**
 * Doctrine Configuration
 *
 * If you have a ./configs/autoload/ directory set up for your project, you can
 * drop this config file in it and change the values as you wish.
 */
return array(
    'di' => array(
        'instance' => array(
            'DoctrineModule\Authentication\Adapter\DoctrineObject' => array(
                'parameters' => array(
                    'identityClassName' => 'Application\Model\User',
                    'identityProperty' => 'username',
                    'credentialProperty' => 'password',
                    'credentialCallable' => 'Application\Model\User::hashPassword'
                ),

            ),

        ),
    ),
);

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

Did you install DoctrineORMModule?

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

yes

actually i installed DoctrineOrmModule at first

didnt install DoctrineModule

but ive seen it installed automatically with DoctrineOrmModule

is that makes problem?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

Nope, that is quite correct. Are you running on the latest status of the skeleton (with the vendor/ZendFramework synchronized to the correct version)?

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

in vendor/ZendFramework/Version.php

i have this :

const VERSION = '2.0.0beta3';

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

I'm talking about the vendor/ZendFramework submodule, which should be at revision 50ca25bbcf742a6bf0014798cfdf8c8d8c344faa

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

i dont get what u mean

i downloaded the latest zf2 in a zip file @ http://framework.zend.com/zf2

is there any way debuggin this issue in CLI?
adding var_dump somewhere to understand why it cant find ORM namespace?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

@placebo the latest zf2 doesn't work because of the latest changes in Zend\Di\Di, which is something I still have to investigate. Anyway, please use git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive to get the skeleton.

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

cloning it to another folder....

which folder should i copy/paste to my current folder?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

You actually shouldn't. Just put the composer.json and composer.phar in the new cloned dir and run php composer.phar install

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

ok

how can i set my DB info for Doctrine to connect to DB?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

That's in the .dist file in config/ (and described in README.md)

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

can you give me an example of that configuration?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

Did you check https://github.com/doctrine/DoctrineORMModule/blob/master/config/module.doctrine_orm.local.config.php.dist ?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

@placebo got this fixed? Can I close? :)

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

fixed and orm validate works

but no table created

when i use : doctrine-module orm:schema-tool:create

i got
doctrine-module orm:schema-tool:create

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

Sorry, didn't understand your last comment...

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

sorry ..

i mean i got this :

D:\xampp\htdocs\ttadmin\vendor\bin>doctrine-module orm:schema-tool:create --dump
-sql
No Metadata Classes to process.

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

@placebo that means you probably didn't set annotations/mappings correctly...

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

does it works without YAML files?

i mean creating a file in Application/src/Application/Entity/News.php like :

<?php
namespace Admin\Model;


use Doctrine\ORM\Mapping;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of News
 *
 * @author Sina Miandashti
 */

/** Entity */
class News {

    /**
     * @Column(type="integer")
     * @Id @GeneratedValue
     */
    private $id;

    /**
     * @Column(type="string")
     */
    private $title;

    /**
     * @Column(type="text")
     */
    private $description;
    /**
     * @Column(type="text")
     */
    private $body;

    /**
     * @Column(type="integer")
     */
    private $publishdate;

    /**
     * @Column(type="integer")
     */
    private $addeddate;

    /**
     * @Column(type="integer")
     */
    private $finishdate;

    /**
     * @Column(type="string",unique=true)
     */
    private $slug;



    /**
     * @Column(type="string",unique=true)
     */
    private $objectid;



    public function __construct() {
        $this->publishtypes = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function getId() {
        return $this->id;
    }

    public function setId($id) {
        $this->id = $id;
    }

    public function getName() {
        return $this->name;
    }

    public function setName($name) {
        $this->name = $name;
    }

    public function getDesc() {
        return $this->description;
    }

    public function setDesc($desc) {
        $this->description = $desc;
    }

    public function getPublishdate() {
        return $this->publishdate;
    }

    public function setPublishdate($publishdate) {
        $this->publishdate = $publishdate;
    }

    public function getAddeddate() {
        return $this->addeddate;
    }

    public function setAddeddate($addeddate) {
        $this->addeddate = $addeddate;
    }

    public function getFinishdate() {
        return $this->finishdate;
    }

    public function setFinishdate($finishdate) {
        $this->finishdate = $finishdate;
    }

    public function getSlug() {
        return $this->slug;
    }

    public function setSlug($slug) {
        $this->slug = $slug;
    }

    public function getPriority() {
        return $this->priority;
    }

    public function setPriority($priority) {
        $this->priority = $priority;
    }

    public function getRating() {
        return $this->rating;
    }

    public function setRating($rating) {
        $this->rating = $rating;
    }

    public function getObjectid() {
        return $this->objectid;
    }

    public function setObjectid($objectid) {
        $this->objectid = $objectid;
    }

    public function getPublishtypes() {
        return $this->publishes;
    }

    public function setPublishtypes($publishtypes) {
        $this->publishtypes = $publishtypes;
    }

    public function getPhoto() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $file = $em->getRepository('Files')->findOneBy(array('objectid' => $this->getObjectid()));

        return $file;
    }

    public function getThumbnail() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $file = $em->getRepository('Files')->findOneBy(array('objectid' => $this->getObjectid(),'type' => 'moviephoto'));

        return $file;
    }

    public function getAllPhotos() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $files = $em->getRepository('Files')->findBy(array('objectid' => $this->getObjectid(), 'type' => "moviephotopage"));

        return $files;
    }

    public function getAllPhotosFiles() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $files = $em->getRepository('Files')->findBy(array('objectid' => $this->getObjectid()));

        return $files;
    }

    public function getPersons() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $relations = $em->getRepository('PersonRelations')->findBy(array('movie' => $this));


        if (isset($relations[0])) {
            return $relations[0]->getPerson();
        }
    }

    public function getRelations() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        //$relations = $em->getRepository('PersonRelations')->findAll();
        $relations = $em->getRepository('PersonRelations')->findBy(array('movie' => $this));

        return $relations;
    }

    public function getTags() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $Tags = $em->getRepository('TagsData')->findBy(array('type' => "movies", 'objectid' => $this->getObjectid()));


        return $Tags;
    }

    public function setTags($tags) {
        $this->tags = $tags;
    }

    public function getReviews() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $reviews = $em->getRepository('Reviews')->findBy(array('objectid' => $this->getObjectid()));
        return $reviews;
    }

    public function getComments() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $reviews = $em->getRepository('Comments')->findBy(array('objectid' => $this->getObjectid()));
        return $reviews;
    }

    public function getFeaturedImage() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $files = $em->getRepository('Files')->findBy(array('objectid' => $this->getObjectid(), 'type' => "featureimage"));

        return $files;
    }

    public function getCinemasShowing() {
        $em = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('entityManager');
        $scheduls = $em->getRepository('Schedules')->findAll(array('movie' => $this));


        $salon = array();
        foreach ($scheduls as $schec) {
            $thissalon = $schec->getSalon();
            if (!in_array($thissalon, $salon)) {

                $salon[] = $thissalon;
            }
        }

        return $salon;
    }

    public function getFeatured() {
        return $this->featured;
    }

    public function setFeatured($featured) {
        $this->featured = $featured;
    }

    public function getActive() {
        return $this->active;
    }

    public function setActive($active) {
        $this->active = $active;
    }

    public function getPublishes() {
        return $this->publishes;
    }

    public function setPublishes($publishes) {
        $this->publishes = $publishes;
    }

    public function addTags(Tags $tag) {

        $this->tags[] = $tag;
    }

}

?>```

will create DB schema or not?

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

Well, your annotations aren't set correctly. First, the notation is (as you imported Doctrine\ORM\Mapping as ORM) @ORM\Entity, @ORM\Column, etc. Plus your entity is missing the @ORM\Entity annotation.

from doctrinemodule.

sinamiandashti avatar sinamiandashti commented on July 21, 2024

yes

ISSUE totally fixed

thank u verry much for you support

from doctrinemodule.

Ocramius avatar Ocramius commented on July 21, 2024

No problem ;)

from doctrinemodule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.