Comments (24)
@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.
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.
Did you install DoctrineORMModule?
from doctrinemodule.
yes
actually i installed DoctrineOrmModule at first
didnt install DoctrineModule
but ive seen it installed automatically with DoctrineOrmModule
is that makes problem?
from doctrinemodule.
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.
in vendor/ZendFramework/Version.php
i have this :
const VERSION = '2.0.0beta3';
from doctrinemodule.
I'm talking about the vendor/ZendFramework
submodule, which should be at revision 50ca25bbcf742a6bf0014798cfdf8c8d8c344faa
from doctrinemodule.
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.
@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.
cloning it to another folder....
which folder should i copy/paste to my current folder?
from doctrinemodule.
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.
ok
how can i set my DB info for Doctrine to connect to DB?
from doctrinemodule.
That's in the .dist
file in config/
(and described in README.md
)
from doctrinemodule.
can you give me an example of that configuration?
from doctrinemodule.
Did you check https://github.com/doctrine/DoctrineORMModule/blob/master/config/module.doctrine_orm.local.config.php.dist ?
from doctrinemodule.
@placebo got this fixed? Can I close? :)
from doctrinemodule.
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.
Sorry, didn't understand your last comment...
from doctrinemodule.
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.
@placebo that means you probably didn't set annotations/mappings correctly...
from doctrinemodule.
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.
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.
yes
ISSUE totally fixed
thank u verry much for you support
from doctrinemodule.
No problem ;)
from doctrinemodule.
Related Issues (20)
- vendor/bin/doctrine-module only works if it's a symlink HOT 12
- Unit tests should be executed with PHP 8.0 HOT 1
- Pushed breaking change in 4.2 release HOT 4
- incompatible with doctrine/orm >= 2.12.0 HOT 3
- Missing Versions on Packagist HOT 2
- Deprecate doctrine/cache HOT 8
- Release 5.3.0 with PHP 8.2 Support HOT 5
- Can't install due to conflicting requirements HOT 25
- Current CLI implementation triggers api-tools-mvc-auth events HOT 2
- 6.0.2 regex change is too restrictive HOT 6
- Missing requirement in composer.json HOT 2
- Migration to v6 leads to cache issues HOT 11
- Authentication Error when no credentialCallable is given. HOT 5
- Allow cleanSearchValue method to accept an integer HOT 4
- Mapping error doctrine find, findOneBy, findBy. HOT 1
- Package incorrectly states that it does provide `laminas/laminas-cache-storage-implementation` HOT 3
- Bump to PHP 8.3 ? HOT 3
- orm3 compatibility HOT 1
- Implement CacheItemPoolInterface
- Upgrade to ServiceManager 4 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrinemodule.