All Projects → KumbiaPHP → ActiveRecord

KumbiaPHP / ActiveRecord

Licence: other
New Active Record for KumbiaPHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ActiveRecord

paper trail-association tracking
Plugin for the PaperTrail gem to track and reify associations
Stars: ✭ 103 (+347.83%)
Mutual labels:  activerecord
squint
Search PostgreSQL jsonb and hstore columns
Stars: ✭ 26 (+13.04%)
Mutual labels:  activerecord
activerecord-shard for
Database Sharding Library for ActiveRecord
Stars: ✭ 16 (-30.43%)
Mutual labels:  activerecord
nxt state machine
A simple but powerful state machine implementation.
Stars: ✭ 14 (-39.13%)
Mutual labels:  activerecord
activerecord-cockroachdb-adapter
CockroachDB adapter for ActiveRecord.
Stars: ✭ 90 (+291.3%)
Mutual labels:  activerecord
siphon
Siphon enables you to easily combine your scopes with params
Stars: ✭ 23 (+0%)
Mutual labels:  activerecord
Neo
Orm框架:基于ActiveRecord思想开发的至简化的java的Orm框架
Stars: ✭ 35 (+52.17%)
Mutual labels:  activerecord
workflow-activerecord
ActiveRecord/Rails Integration for the Workflow library
Stars: ✭ 24 (+4.35%)
Mutual labels:  activerecord
scopy
Common ActiveRecord scopes as model concerns
Stars: ✭ 13 (-43.48%)
Mutual labels:  activerecord
yii2-rest-client
REST client (AR-like model) for Yii Framework 2.0 (via yii2-http-client)
Stars: ✭ 19 (-17.39%)
Mutual labels:  activerecord
index shotgun
duplicate index checker 🔥 🔫 👮
Stars: ✭ 35 (+52.17%)
Mutual labels:  activerecord
sinatra-api-server-toolbox
Sinatra API Server Toolbox (Ruby, Sinatra, ActiveRecord, postgreSQL, JSON, jQuery, AJAX)
Stars: ✭ 21 (-8.7%)
Mutual labels:  activerecord
Sandbox
KumbiaPHP sandbox with examples
Stars: ✭ 16 (-30.43%)
Mutual labels:  kumbiaphp
activerecord-setops
Union, Intersect, and Difference set operations for ActiveRecord (also, SQL's UnionAll).
Stars: ✭ 21 (-8.7%)
Mutual labels:  activerecord
ar-role
ActiveRecord behavior, which provides relation roles (table inheritance)
Stars: ✭ 34 (+47.83%)
Mutual labels:  activerecord
sinatras-skeleton
Basic Sinatra Skeleton MVC CRUD App with Sprockets, Warden, ActiveRecord and PostgresQL
Stars: ✭ 13 (-43.48%)
Mutual labels:  activerecord
activeentity
Active Record without Database
Stars: ✭ 46 (+100%)
Mutual labels:  activerecord
ar-variation
Variation behavior for ActiveRecord
Stars: ✭ 46 (+100%)
Mutual labels:  activerecord
u-observers
Simple and powerful implementation of the observer pattern.
Stars: ✭ 31 (+34.78%)
Mutual labels:  activerecord
active record distinct on
Support for `DISTINCT ON` statements when querying with ActiveRecord
Stars: ✭ 23 (+0%)
Mutual labels:  activerecord

KumbiaPHP

Scrutinizer Code Quality Code Coverage Build Status Code Climate

ESPAÑOL - ENGLISH

ActiveRecord

Nuevo ActiveRecord en desarrollo.

No usar en producción

Instalar con composer en KumbiaPHP

Necesita KumbiaPHP > 0.9RC

  • Crear el archivo composer.json en la raiz del proyecto:
--proyecto  
    |  
    |--vendor  
    |--default  
    |--core  
    |--composer.json        Acá va nuestro archivo  
  • Añadir el siguiente código:
{
    "require": {
        "kumbia/activerecord" : "dev-master"
    }
}
  • Ejecutar el comando composer install

  • Seguir los pasos 2 y 3 de la siguiente sección.

Instalar en KumbiaPHP

Necesita KumbiaPHP > 0.9RC

  1. Copiar config/config_databases.php en app/config/databases.php y configurar

  2. (Opcional) Añadir en app/libs/ : lite_record.php y/o act_record.php

LiteRecord

Para los que prefieren SQL y las ventajas de un ORM, incluye un mini ActiveRecord

<?php
//app/libs/lite_record.php

/**
 * Record 
 * Para los que prefieren SQL con las ventajas de ORM
 *
 * Clase padre para añadir tus métodos
 *
 * @category Kumbia
 * @package ActiveRecord
 * @subpackage LiteRecord
 */

//use Kumbia\ActiveRecord\LiteRecord as ORM;

class LiteRecord extends \Kumbia\ActiveRecord\LiteRecord
{

}

ActRecord

ActiveRecord completo

<?php
//app/libs/act_record.php

/**
 * ActiveRecord Nuevo
 *
 * Clase padre para añadir tus métodos
 *
 * @category Kumbia
 * @package ActiveRecord
 * @subpackage ActiveRecord
 */

//use Kumbia\ActiveRecord\ActiveRecord;

class ActRecord extends \Kumbia\ActiveRecord\ActiveRecord
{

}

Ejemplo

Modelo

<?php
//app/models/personas.php

class Personas extends ActRecord //o LiteRecord según el que prefiera
{

}

O directamente sin clase padre

<?php
//app/models/personas.php

class Personas extends \Kumbia\ActiveRecord\LiteRecord
{

}

Controller

<?php
//app/controller/personas_controller.php

class PersonasController extends AppController {

    public function index() {
        $this->data = Personas::all();
    }
    
    public function find($id) {
        $this->data = Personas::get($id);
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].