/** * The opposite of related(). Returns all the beans that are not * associated with the bean provided. * * @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 array $beans beans */ public static function unrelated(RedBean_OODBBean $bean, $type, $sql=null, $values=array()) { $keys = self::$associationManager->related( $bean, $type ); $idfield = self::$writer->getIDField( $type ); $sqlSnippet = self::$writer->getSQLSnippetFilter($idfield, $keys, $sql, true); return self::find( $type, $sqlSnippet, $values ); }