Giter VIP home page Giter VIP logo

propel3's Introduction

Propel3

Propel3 is an open-source Object-Relational Mapping (ORM) for modern PHP 7.1+.

Build Status Code Climate PPM Compatible Gitter

Version 3 of Propel ORM replaces Propel2, which is not maintained anymore. Propel3 introduces a data-mapper implementation which separates your entities from the actual persisting logic.

Status

This is in current development and is not yet ready to use.

Features

  • Propel is blazing fast
  • Data mapper with runtime UnitOfWork for high performance with massive object counts (bulks inserts/updates)
  • Query-Builder
  • Very IDE friendly thanks to code-generation
  • Generation of methods for all columns and relations
  • Database schema migration
  • Schema reverse engineering
  • Customizable
  • Propel comes with common ‘behaviors’
  • Completely unit tested for MySQL, PostgreSQL, SQLite. Oracle and MSSQL are experimental.

Example

Define the entity

XML
<database name="default">
  <entity name="Vendor\Car">
      <field name="id" primaryKey="true" autoIncrement="true" type="INTEGER" />
      <field name="name" type="VARCHAR" required="true"  />
      <relation target="Publisher" onDelete="setnull"/>
      <relation target="Author" onDelete="setnull" onUpdate="cascade"/>
  </entity>
</database>
or annotations

In work.

namespace Vendor

use Propel\Annotations\Entity;
use Propel\Annotations\Field;
use Propel\Annotations\PrimaryKey;

/**
 * @Entity()
 */ 
class Car
{
    /**
     * @PrimaryKey(auto_increment=true)
     */
    private $id;
    
    /**
     * @Field(type="VARCHAR")
     */
    private $name;
    
    // getters/setters
}

Data mapper

$propel = new Propel\Runtime\Configuration('path/to/propel.yml');

// require a session for each request/workload
$session = $propel->getSession();

$car = new Vendor\Car();
$car->setName('Ford');

$session->persist($car);
$session->commit();

RAD/Active-record

// use <entity name="Vendor\Car" activeRecord="true">
$car = new Vendor\Car();
$car->setName('Ford');
$car->save();

Installation

Read the Propel documentation. This documentation is for Propel2 still.

Contribute

Everybody can contribute to Propel. Just fork it, and send Pull Requests. You have to follow PSR2 coding standards and provides unit tests as much as possible.

Please see our contribution guideline. Thank you!

License

See the LICENSE file.

propel3's People

Contributors

andrey-yantsen avatar benoitleveque avatar cedriclombardot avatar cristianoc72 avatar fzaninotto avatar gharlan avatar gigablah avatar gossi avatar gromnan avatar havvg avatar jaugustin avatar k-phoen avatar kendallhopkins avatar lunika avatar marcj avatar mhitza avatar mpetrovich avatar nibsirahsieu avatar nnarhinen avatar nymo avatar oujesky avatar pablogd avatar robin850 avatar rouffj avatar sbarex avatar shanielh avatar staabm avatar themouette avatar willdurand avatar xiurobert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.