示例#1
0
 /**
  * Returns only a single associated bean.
  * This works just like R::related but returns a single bean. Which bean will be
  * returned depends on the SQL snippet provided.
  * For more details refer to R::related.
  * 
  * @warning not a preferred method, use $bean->shared if possible.
  *
  * @param RedBean_OODBBean $bean     the bean you have, the reference bean
  * @param string           $type     type of bean you are searching for
  * @param string           $sql      SQL for extra filtering
  * @param array            $bindings values to be inserted in SQL slots
  *
  * @return RedBean_OODBBean
  */
 public static function relatedOne(RedBean_OODBBean $bean, $type, $sql = NULL, $bindings = array())
 {
     return self::$associationManager->relatedOne($bean, $type, $sql, $bindings);
 }
示例#2
0
 /**
  * Returns only single associated bean.
  *
  * @param RedBean_OODBBean $bean bean provided
  * @param string $type type of bean you are searching for
  * @param string $sql SQL for extra filtering
  * @param array $values values to be inserted in SQL slots
  *
  *
  * @return RedBean_OODBBean $bean
  */
 public static function relatedOne(RedBean_OODBBean $bean, $type, $sql = null, $values = array())
 {
     return self::$associationManager->relatedOne($bean, $type, $sql, $values);
 }