Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training mahdy #3

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
init & fix doctorine schema driver paths and start with show products
mohamedMahdyCc committed Jul 4, 2018
commit 2430684e2bb29a6acdc621de4e0936e09c3f9b97
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ RUN apt-get update \
&& apt-get install -y git zlib1g-dev \
&& docker-php-ext-install zip \
&& docker-php-ext-install pdo_mysql \

&& a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/public \
7 changes: 4 additions & 3 deletions config/autoload/doctrine.global.php
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
/**
* Doctrine Global Config
*/

return [
'doctrine' => [
'driver' => [
@@ -11,15 +10,17 @@
'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class,
'cache' => 'array',
'paths' => [
realpath(__DIR__ . '/../../module/Application/src/Entity'),
realpath(__DIR__ . '/../../module/Product/src/Entity'),
realpath(__DIR__ . '/../../module/Category/src/Entity'),
],
],
// default metadata driver, aggregates all other drivers into a single one.
// Override `orm_default` only if you know what you're doing
'orm_default' => [
'drivers' => [
// register `annotation_driver` for any entity under namespace `Application\Entity`
'Application\Entity' => 'annotation_driver',
'Product\Entity' => 'annotation_driver',
'Category\Entity' => 'annotation_driver',
],
],
],
3 changes: 2 additions & 1 deletion module/Product/src/Controller/ProductController.php
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@ class ProductController extends AbstractActionController
public function indexAction()
{
//echo 'ok'; die;
return new ViewModel();
$users = $this->getObjectManager()->getRepository('\Application\Entity\User')->findAll();
return new ViewModel(array('products' => $products));
}

public function addAction()
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class Product
* @ORM\Column(type="string")
* @var string
*/
private $name;
private $title;

/**
* @ORM\Column(type="text")