GithubHelp home page GithubHelp logo

wearethefoos / codeigniter_gasoline Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 111 KB

CakePHP-like Models, Behaviors, and Validation

Home Page: http://foxycoder.com/read/2011/10/gasoline-package-cakephp-like-models-behaviors-and-validation-for-codeigniter

PHP 100.00%

codeigniter_gasoline's People

Contributors

wearethefoos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nbourguig

codeigniter_gasoline's Issues

Undefined variable: options : Mongo_db::update_all

Undefined variable "$options"

public function update_all($collection = "", $data = array())
{
    if (empty($collection))
    {
        show_error("No Mongo collection selected to update", 500);
    }

    if (is_array($data) && count($data) > 0)
    {
        $this->updates = array_merge($data, $this->updates);
    }

    if (count($this->updates) == 0)
    {
        show_error("Nothing to update in Mongo collection or update is not an array", 500); 
    }

    if (isset($this->wheres['_id']) and ! ($this->wheres['_id'] instanceof MongoId))
    {
        $this->wheres['_id'] = new MongoId($this->wheres['_id']);
    }

    try
    {
        $options = array_merge($options, array($this->query_safety => TRUE, 'multiple' => TRUE));
        $this->db->{$collection}->update($this->wheres, $this->updates, $options);
        $this->_clear();
        return (TRUE);
    }
    catch (MongoCursorException $e)
    {
        show_error("Update of data into MongoDB failed: {$e->getMessage()}", 500);
    }
}

Please add new parameter for $options in update_all function.

public function update_all($collection = "", $data = array(), $options = array())

Thanks

Safim

Fatal Error : Call to undefined method Mongo_db::where_init()

Fetal error on "like " query

public function like($field = "", $value = "", $flags = "i", $enable_start_wildcard = TRUE, $enable_end_wildcard = TRUE)
{
$field = (string) trim($field);
$this->where_init($field);

And original function is with "_" (underscore).

private function _where_init($param)
{
    if ( ! isset($this->wheres[$param]))
    {
        $this->wheres[ $param ] = array();
    }
}

Undefined variable: fields : Mongo_db::pop

Undefined variable "$fields"

    elseif (is_array($fields))
    {
        foreach ($fields as $field)
        {
            $this->updates['$pop'][$field] = -1;
        }
    }

    return $this;
}

I think it should like this

    elseif (is_array($field))
    {
        foreach ($field as $fld)
        {
            $this->updates['$pop'][$fld] = -1;
        }
    }

    return $this;
}

What do you think?

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.