/** * Get meta data, key support dot notation levels * @param string $key * @return mixed */ public function getMeta($key = null) { if (!is_array($this->meta)) { return $this->meta; } else { return H::arrayGet($this->meta, $key); } }
/** * Get registered class name * @param string $type * @return void */ public function getRegisteredClass($type) { return H::arrayGet($this->classes, $type, false); }
public function testArrayIsMulti() { $this->assertTrue(H::arrayIsMulti(array('foo' => 'bar', 'bar' => array('foo' => 'bar')))); $this->assertFalse(H::arrayIsMulti(array('foo' => 'bar', 'bar' => 'foo'))); }
protected function getKey($type) { return H::arrayGet($this->keys, $type); }
/** * Get value of PK * @return mixed */ public function getKey() { return H::arrayGet($this->attributes, static::$key); }
/** * Build relationship models using in model data * @param string $key attribute name * @return array */ protected function getInModelData($key) { $model = $this->getCallingModel(); if ($model->attributeExists($key)) { $data = $model->getRawAttribute($key); if (H::arrayIsAssoc($data)) { $data = array($data); } return $this->query->buildModels($data); } return false; }