PHP utility collection with hybrid and fluent APIs.

⌈⌋ branch:  hybrid7 libraries


Check-in [1cfd351bc9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:1cfd351bc92481a10a1319bcbab79789c3f00f9f
Date: 2015-01-07 15:32:08
User: mario
Comment:Silently return NULL for absent ->column data from first result row.
Tags And Properties
  • branch=trunk inherited from [da152c56bc]
  • sym-trunk inherited from [da152c56bc]
Context
2015-01-13
18:47
[2734b95caa] Obsolete/unused bindings for Inspekt (user: mario, tags: trunk)
2015-01-07
15:32
[1cfd351bc9] Silently return NULL for absent ->column data from first result row. (user: mario, tags: trunk)
2015-01-06
17:29
[b453cef6ba] Remove debugging examples. (user: mario, tags: trunk)
Changes

Changes to db.php.

383
384
385
386
387
388
389
390
391
392







393
394
395
396
397
398
399
        return call_user_func_array(array($this->results, $func), $args);
    }

    // Single column access
    function offsetGet($name) {
    
        // get first result, transfuse into $this
        if (is_object($this->results)) {
            $this->exchangeArray($this->results->fetch());
            unset($this->results);







        }
        
        // suffice __get
        return parent::offsetGet($name);
    }

    // Just let PDOStatement handle the Traversable







|
<

>
>
>
>
>
>
>







383
384
385
386
387
388
389
390

391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
        return call_user_func_array(array($this->results, $func), $args);
    }

    // Single column access
    function offsetGet($name) {
    
        // get first result, transfuse into $this
        if (is_object($r = $this->results)) {

            unset($this->results);
            if ($row = $r->fetch()) {
                $this->exchangeArray($row);
            }
            // no row returned, silently return
            else {
                return NULL;
            }
        }
        
        // suffice __get
        return parent::offsetGet($name);
    }

    // Just let PDOStatement handle the Traversable