lithium\data\Entity::data PHP Метод

data() публичный Метод

Access the data fields of the record. Can also access a $named field.
public data ( string $name = null ) : mixed
$name string Optionally included field name.
Результат mixed Entire data array if $name is empty, otherwise the value from the named field.
    public function data($name = null)
    {
        if ($name) {
            return $this->__get($name);
        }
        return $this->to('array');
    }

Usage Example

Пример #1
0
 public function testConversion()
 {
     $data = array('foo' => '!!', 'bar' => '??', 'baz' => '--');
     $entity = new Entity(compact('data'));
     $this->assertEqual($data, $entity->to('array'));
     $this->assertEqual($data, $entity->data());
     $this->assertEqual($entity, $entity->to('foo'));
 }
All Usage Examples Of lithium\data\Entity::data