function _get_propel_object_list_nuevo($object, $method, $options, $criteria = null) { // get the lists of objects $through_class = _get_option($options, 'through_class'); //neofis //print_r($criteria); //$cr = ($criteria instanceof Criteria) ? $criteria : null; /* $criteria = new Criteria(); if ($ignorar_grupo_todos = _get_option($options, 'ignorar_grupo_todos')){ $criteria->add(GrupoPeer::ID_GRUPO , 1 , Criteria::NOT_EQUAL); } if ($nuevo_criteria = _get_option($options, 'criteria')) { $criteria = ($nuevo_criteria instanceof Criteria) ? $nuevo_criteria : new Criteria(); } */ $objects = sfPropelManyToMany::getAllObjects($object, $through_class, '', $criteria); $objects_associated = sfPropelManyToMany::getRelatedObjects($object, $through_class); $ids = array_map(create_function('$o', 'return $o->getPrimaryKey();'), $objects_associated); return array($objects, $objects_associated, $ids); }
if ($column->isPrimaryKey()) { continue; } $credentials = $this->getParameterValue('edit.fields.' . $column->getName() . '.credentials'); $input_type = $this->getParameterValue('edit.fields.' . $column->getName() . '.type'); $user_params = $this->getParameterValue('edit.fields.' . $column->getName() . '.params'); $user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); $through_class = isset($user_params['through_class']) ? $user_params['through_class'] : ''; if ($through_class) { $class = $this->getClassName(); $related_class = sfPropelManyToMany::getRelatedClass($class, $through_class); $related_table = constant($related_class . 'Peer::TABLE_NAME'); $middle_table = constant($through_class . 'Peer::TABLE_NAME'); $this_table = constant($class . 'Peer::TABLE_NAME'); $related_column = sfPropelManyToMany::getRelatedColumn($class, $through_class); $column = sfPropelManyToMany::getColumn($class, $through_class); if ($input_type == 'admin_double_list' || $input_type == 'admin_check_list' || $input_type == 'admin_select_list') { if ($credentials) { $credentials = str_replace("\n", ' ', var_export($credentials, true)); ?> if ($this->getUser()->hasCredential(<?php echo $credentials; ?> )) { <?php } ?> // Update many-to-many for "<?php echo $name; ?>
continue; } $credentials = $this->getParameterValue('edit.fields.' . $column->getName() . '.credentials'); $input_type = $this->getParameterValue('edit.fields.' . $column->getName() . '.type'); $user_params = $this->getParameterValue('edit.fields.' . $column->getName() . '.params'); $user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); $through_class = isset($user_params['through_class']) ? $user_params['through_class'] : ''; $remote_column = isset($user_params['related_column']) ? $user_params['related_column'] : ''; if ($through_class) { $class = $this->getClassName(); $related_class = sfPropelManyToMany::getRelatedClass($class, $through_class, $remote_column); $related_table = constant(constant($related_class . '::PEER') . '::TABLE_NAME'); $middle_table = constant(constant($through_class . '::PEER') . '::TABLE_NAME'); $this_table = constant(constant($class . '::PEER') . '::TABLE_NAME'); $related_column = sfPropelManyToMany::getRelatedColumn($class, $through_class, $remote_column); $column = sfPropelManyToMany::getColumn($class, $through_class, $remote_column); if ($input_type == 'admin_double_list' || $input_type == 'admin_check_list' || $input_type == 'admin_select_list') { if ($credentials) { $credentials = str_replace("\n", ' ', var_export($credentials, true)); ?> if ($this->getUser()->hasCredential(<?php echo $credentials; ?> )) { <?php } ?> // Update many-to-many for "<?php echo $name; ?>
function _get_propel_object_list($object, $method, $options) { // get the lists of objects $through_class = _get_option($options, 'through_class'); $objects = sfPropelManyToMany::getAllObjects($object, $through_class); $objects_associated = sfPropelManyToMany::getRelatedObjects($object, $through_class); $ids = array_map(create_function('$o', 'return $o->getPrimaryKey();'), $objects_associated); return array($objects, $objects_associated, $ids); }
/** * retrieve object list via propel * * @return array * @param object root object * @param string retrieving method * @param string name of satellite class **/ function _get_object_list($object, $method, $middleClass, $peer_method) { // get object $object = $object instanceof sfOutputEscaper ? $object->getRawValue() : $object; // get all objects $objects = sfPropelManyToMany::getAllObjects($object, $middleClass, null, $peer_method); // get related objects $objects_associated = sfPropelManyToMany::getRelatedObjects($object, $middleClass); // get ids $ids = array_map(create_function('$o', 'return $o->getPrimaryKey();'), $objects_associated); return array($objects, $objects_associated, $ids); }