Exemplo n.º 1
0
 /**
  * Counts the number of related beans in an N-M relation.
  * Counts the number of beans of type $type that are related to $bean,
  * using optional filtering SQL $sql with $bindings. This count will
  * only search for N-M associated beans (works like countShared).
  * The $bean->countShared() method is the preferred way to obtain this
  * number.  
  *
  * @warning not a preferred method, use $bean->countShared if possible.
  * 
  * @param RedBean_OODBBean $bean     the bean you have, the reference bean
  * @param string           $type     the type of bean you want to count
  * @param string           $sql      SQL snippet for extra filtering
  * @param array            $bindings values to be inserted in SQL slots
  *
  * @return integer
  */
 public static function relatedCount($bean, $type, $sql = NULL, $bindings = array())
 {
     return self::$associationManager->relatedCount($bean, $type, $sql, $bindings);
 }