Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Jan 19, 2014
1 parent 01a57ef commit 4613927
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions ORM/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -767,57 +767,4 @@ public function count($conditions = null) {
));
}

public function assignProperty(Entity $entity, $alias, $value) {
$name = Inflector::underscore($alias);

$Model = $this->getAssociatedModel($alias);
if ($Model) {
if (is_array($value) && (empty($value) || Hash::numeric(array_keys($value)))) {
$result = array();
foreach ($value as $columns) {
$data = array($alias => $columns);
$result[] = $Model->newEntity($data);
}
$name = Inflector::pluralize($name);
$value = $result;
} else {
$data = array($alias => $value);
$value = $Model->newEntity($data);
}
}

$entity->{$name} = $value;
}

public function getAssociatedModel($alias) {
if ($this->schema($alias) || !preg_match('/^[A-Z]/', $alias)) {
return null;
}

$Model = null;

foreach ($this->_associations as $type) {
if (!empty($this->{$type}[$alias])) {
$association = $this->{$type}[$alias];

$Model = ClassRegistry::init(array(
'class' => $association['className'],
'alias' => $alias,
));

break;
}
}

if (!$Model) {
$Model = ClassRegistry::init($alias);
}

if ($Model && $Model instanceof Table) {
return $Model;
}

return null;
}

}

0 comments on commit 4613927

Please sign in to comment.