Giter Club home page Giter Club logo

eavactiverecord's Introduction

Top Languages Card

picture

eavactiverecord's People

Contributors

iachilles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eavactiverecord's Issues

Checking actual value of the entity's primary key attribute.

If the entity's primary key attribute is manually assigned with a different value, methods EavActiveRecord::saveWithEavAttributes() and EavActiveRecord::updateWithEavAttributes() must check it and refresh it in the related tables (tables that store values of EAV attributes) as needed.

EavActiveRecord::updateWithEavAttributes(), EavActiveRecord::saveEavAttributes() perform an unexpected insert.

The entity table

id attr1 attr2 eav_set_id
1 abc def 1

"eav_attribute_int" table

id eav_attribute_id entity_id entity value
1 1 1 entity 1
$model = Model::model()->withEavAttributes()->findByPk(1);
$model->eavAttr = 1; //The value is not changed
$model->updateWithEavAttributes(); 

"eav_attribute_int" table

id eav_attribute_id entity_id entity value
1 1 1 entity 1
$model = Model::model()->withEavAttributes()->findByPk(1);
$model->eavAttr = 2; //Assigns the new value
$model->updateWithEavAttributes(); //Updates the existing record in the "eav_attribute_int" table
$model->updateWithEavAttributes(); //Inserts a new record in the "eav_attribute_int" table. It must nothing to do in this case
id eav_attribute_id entity_id entity value
1 1 1 entity 2
2 1 1 entity 2

The method EavActiveRecord::saveEavAttributes() has the same wrong behavior as updatesWithEavAttributes().

The class EavAttributeExtended should use composition instead of inheritance.

The class EavAttributeExtended (from the eav module) should use composition instead of inheritance. A serialized instance of the class EavAttribute must be stored in cache, but now when a new EAV attribute is created through the GUI module, it saves in the cache a serialized instance of the class EavAttributeExtended.

Add type conversion for some string values

If the property "value" of the class CDefaultValueValidatorForm assigned from user input, the following values must be converted to the specific data types, as shown below:
"10" = 10
"54.2" = 54.2
"true", "TRUE" = true
"false", "FALSE" = false
"null", "NULL" = null
"()" = array()

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.