Please enter your database host [localhost]: Please enter your database port [3306]: Please enter your database name: propel_example Please enter your database user [root]: Please enter your database password: *password*
Which charset would you like to use? [utf8]:
Connected to sql server successful!
The initial step in every Propel project is the"build". During build time, a developer describes the structure ofthe datamodel ina XML file called the"schema".
From this schema, Propel generates PHP classes, called "model classes", made of object-oriented PHP code optimized fora given RDMBS. The model classes are the primary interface to find and manipulate data inthe database in Propel.
The XML schema can also be used to generate SQL code to setup your database. Alternatively, you can generate the schema froman existing database.
Do you have an existing database you want to use with propel? [no]: yes
Where do you want to store your schema.xml? [C:\xampp\htdocs\propel_example\orm]: Where do you want propel to save the generated php models? [C:\xampp\htdocs\propel_example\orm]: C:\xampp\htdocs\propel_example\orm\model Which namespace should the generated php models use?:
Schema reverse engineering finished.
Propel asks you to define some data to work properly, for instance: connection parameters, working directories, flags to take decisions and so on. You can pass these data via a configuration file.
The name ofthe configuration file is propel, withoneofthe supported extensions (yml, xml, json, ini, php). E.g. propel.yml or propel.json.
Please enter theformatto use forthe generated configuration file (yml, xml, json, ini, php) [yml]: [0] yml [1] xml [2] json [3] ini [4] php
Propel 2 Initializer - Summary
The Propel 2 Initializer will set up your project withthe following settings:
Path to schema.xml: C:\xampp\htdocs\propel_example\orm/schema.xml Path to config file: C:\xampp\htdocs\propel_example\orm/propel.yml Path to generated php models: C:\xampp\htdocs\propel_example\orm\model Namespace of generated php models:
Database management system: mysql Charset: utf8 User: root
/** * The value for the name field. * * @var string */ protected$name;
/** * Get the [name] column value. * * @return string */ publicfunctiongetName() { return$this->name; }
/** * Set the value of [name] column. * * @param string $v new value * @return $this|\Blog The current object (for fluent API support) */ publicfunctionsetName($v) { if ($v !== null) { $v = (string) $v; }
* @method ChildBlog findOneById(int $id) Return the first ChildBlog filtered by the id column * @method ChildBlog findOneByName(string $name) Return the first ChildBlog filtered by the name column * @method ChildBlog findOneByDomain(string $domain) Return the first ChildBlog filtered by the domain column * @method ChildBlog findOneByOwner(string $owner) Return the first ChildBlog filtered by the owner column * @method ChildBlog findOneByCreatedAt(string $created_at) Return the first ChildBlog filtered by the created_at column *