Библиотека для cis, online, cms1
This commit is contained in:
commit
3c2e614d87
269 changed files with 39854 additions and 0 deletions
24
core/adapter.php
Normal file
24
core/adapter.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Èíòåðôåéñ ê ìàññèâó è îáüåêòó êàê ê êîëëåêöèè
|
||||
*/
|
||||
class Adapter
|
||||
{
|
||||
protected $adaptee;
|
||||
public function __construct ($adaptee)
|
||||
{
|
||||
$this->adaptee = $adaptee;
|
||||
}
|
||||
|
||||
public function get ($name)
|
||||
{
|
||||
if (is_array ($this->adaptee)) {
|
||||
return $this->adaptee [$name];
|
||||
} else {
|
||||
return $this->adaptee->$name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue