Esempio n. 1
0
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);
}
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);
}
Esempio n. 3
0
/**
 * 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);
}