Download the PHP package atlas/symfony without Composer
On this page you can find all versions of the php package atlas/symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atlas/symfony
More information about atlas/symfony
Files in atlas/symfony
Informations about the package symfony
Symfony 4 Bundle for Atlas 3
This package makes the Atlas ORM and command-line tooling available as a bundle for Symfony 4 projects.
(Atlas is a data mapper for your persistence layer, not your domain layer.)
Installation and Configuration
-
In your Symfony 4 project, enable contributor recipes:
-
Require the
atlas/symfony
package; this will activate a Symfony Flex recipe as part of the installation: - Edit these new
.env
variables to define your database connection:
Note:
If you are using PHPStorm, you may wish to copy the IDE meta file to your project to get full autocompletion on Atlas classes:
In the atlas.yaml
config file, these settings are notable:
-
atlas.orm.atlas.log_queries
: set this totrue
to enable the web profiler data collector for query logging. -
atlas.orm.atlas.transaction_class
: set this to one of the Atlas transaction strategy classes, such asAtlas\\Orm\\Transaction\\AutoTransact
. For more information, see the transactions documentation. - The
options
section under any connection configuration can be used to set PDO attributes through the PDO constructor. For example:
Getting Started
Generating Mappers
Use the command-line tooling to create the skeleton files for all your database tables:
The config/packages/atlas.yaml
file specifies App\DataSource\
as the
namespace, and src/DataSource/
as the directory. To change them, modify the
atlas.cli.config.input
values for directory
and namespace
as you see fit.
The database table names will be converted to singular for their relevant
type names in PHP. If you want a different type names for certain tables,
modify the atlas.cli.transform
values in the atlas.yaml
file to map a
from table name to a type name.
As you make changes to the database, re-run the skeleton generator, and the relevant table files will be regenerated.
For more information, see http://atlasphp.io/cassini/skeleton/.
Using Atlas
Now that there are mappers for all the database tables, you can use the Symfony dependency injection system to autowire Atlas into your classes for you.
Full documentation for using Atlas is at http://atlasphp.io/cassini/orm/:
-
Working with Records and RecordSets
- Other topics such as custom mapper methods, single table inheritance, many-to-many relationships, and automated validation
Enjoy!