Skip to content

Commit

Permalink
Merge pull request #622 from malarzm/fix-doctor-rst-errors
Browse files Browse the repository at this point in the history
Fix DOCtor-RST errors on 4.1.x
  • Loading branch information
malarzm committed Feb 27, 2020
2 parents 92a8ff2 + 1a9b0c0 commit 6f94729
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
1 change: 0 additions & 1 deletion Resources/doc/cookbook/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ and its template:
.. code-block:: html+jinja

{# src/Acme/AccountBundle/Resources/views/Account/register.html.twig #}

{{ form_start(form, {'action': path('create'), 'method': 'POST'}) }}
{{ form_widget(form) }}

Expand Down
50 changes: 25 additions & 25 deletions Resources/doc/first_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ in a number of different formats including XML or directly inside the

.. configuration-block::

.. code-block:: xml
<!-- src/Acme/StoreBundle/Resources/config/doctrine/Product.mongodb.xml -->
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
https://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="Acme\StoreBundle\Document\Product">
<id />
<field fieldName="name" type="string" />
<field fieldName="price" type="float" />
</document>
</doctrine-mongo-mapping>
.. code-block:: php
// src/Acme/StoreBundle/Document/Product.php
Expand Down Expand Up @@ -87,21 +102,6 @@ in a number of different formats including XML or directly inside the
protected $price;
}
.. code-block:: xml
<!-- src/Acme/StoreBundle/Resources/config/doctrine/Product.mongodb.xml -->
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="Acme\StoreBundle\Document\Product">
<id />
<field fieldName="name" type="string" />
<field fieldName="price" type="float" />
</document>
</doctrine-mongo-mapping>
.. seealso::

You can also check out Doctrine's `Basic Mapping Documentation`_ for
Expand Down Expand Up @@ -169,9 +169,9 @@ If you are using `autowiring`, you can use type hinting to fetch the ``doctrine_
// App/Controller/DefaultController.php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Doctrine\ODM\MongoDB\DocumentManager as DocumentManager;
use App\Document\Product;
use Doctrine\ODM\MongoDB\DocumentManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends AbstractController
Expand Down Expand Up @@ -269,12 +269,12 @@ to easily fetch objects based on multiple conditions:
.. code-block:: php
// query for one product matching be name and price
$product = $repository->findOneBy(array('name' => 'foo', 'price' => 19.99));
$product = $repository->findOneBy(['name' => 'foo', 'price' => 19.99]);
// query for all products matching the name, ordered by price
$product = $repository->findBy(
array('name' => 'foo'),
array('price' => 'ASC'),
['name' => 'foo'],
['price' => 'ASC'],
);
Updating an Object
Expand Down Expand Up @@ -383,7 +383,7 @@ To do this, add the name of the repository class to your mapping definition.
*/
class Product
{
//...
// ...
}
.. code-block:: xml
Expand All @@ -393,7 +393,7 @@ To do this, add the name of the repository class to your mapping definition.
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
https://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="Acme\StoreBundle\Document\Product"
repository-class="Acme\StoreBundle\Repository\ProductRepository">
Expand Down Expand Up @@ -451,8 +451,8 @@ is to use the repository as a service and inject it as a dependency into other s
namespace Acme\StoreBundle\Repository;
use Acme\StoreBundle\Document\Product;
use Doctrine\Bundle\MongoDBBundle\Repository\ServiceDocumentRepository;
use Doctrine\Bundle\MongoDBBundle\ManagerRegistry;
use Doctrine\Bundle\MongoDBBundle\Repository\ServiceDocumentRepository;
/**
* Remember to map this repository in the corresponding document's repositoryClass.
Expand Down Expand Up @@ -491,9 +491,9 @@ repositories as services you can use the following service configuration:
https://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<defaults autowire="true" autoconfigure="true"/>
<defaults autowire="true" autoconfigure="true" />
<prototype namespace="Acme\StoreBundle\Repository\" resource="%kernel.root_dir%/../src/Acme/StoreBundle/Repository/*"/>
<prototype namespace="Acme\StoreBundle\Repository\" resource="%kernel.root_dir%/../src/Acme/StoreBundle/Repository/*" />
</services>
</container>
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ register the new bundle:
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
$bundles = [
// ...
new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle(),
);
];
// ...
}
Expand Down

0 comments on commit 6f94729

Please sign in to comment.