/** * Return the actual list of soft attributes being used by this model * @return array list of initialized soft attributes * @since v1.3.4 */ public function getSoftAttributeNames() { return array_diff(array_keys($this->softAttributes), parent::attributeNames()); }
public function guessNameColumn(EMongoDocument $model) { foreach ($model->attributeNames() as $name) { if (!strcasecmp($name, 'name')) { return $name; } } foreach ($model->attributeNames() as $name) { if (!strcasecmp($name, 'title')) { return $name; } } foreach ($model->attributeNames() as $name) { if ($name == $model->primaryKey()) { return $name; } } return '_id'; }